luci-app-travelmate: WEP-fixes 3234/head
authorDirk Brenken <dev@brenken.org>
Wed, 23 Oct 2019 08:42:38 +0000 (10:42 +0200)
committerDirk Brenken <dev@brenken.org>
Wed, 23 Oct 2019 08:42:38 +0000 (10:42 +0200)
* fix some more WEP-related form issues

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_edit.lua

index e0d0cedd7e4e155436e30faeec7fb05aede3670f..c93fdd25697f4ea5e37b474c1cd59377c35de938 100644 (file)
@@ -172,6 +172,8 @@ cmd_list.default = cmd or "none"
 cmd_args.default = cmd_args_default
 
 function wssid.write(self, section, value)
+       login_section = (m.hidden.device or "") .. "_" .. (wssid:formvalue(section) or "") .. "_" .. (bssid:formvalue(section) or "")
+       login_section = login_section:gsub("[^%w_]", "_")
        newsection = uci:section("wireless", "wifi-iface", login_section, {
                mode     = "sta",
                network  = trmiface,
index 086853171e4b51771d4b52a1903709b24d1341d5..6c0a3e186e295ee85d60b8af0699c42b2fb1c489 100644 (file)
@@ -48,6 +48,8 @@ if s ~= nil then
 
                        wkey = m:field(Value, "key", translate("Passphrase"))
                        wkey.datatype = "wepkey"
+                       wkey.password = true
+                       wkey.default = s.key
                elseif string.match(s.encryption, '^wpa') then
                        encr = m:field(ListValue, "encryption", translate("Encryption"))
                        encr:value("wpa", "WPA Enterprise")