projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1690 from karlp/pagekite
[project/luci.git]
/
applications
/
luci-app-travelmate
/
luasrc
/
model
/
cbi
/
travelmate
/
wifi_add.lua
diff --git
a/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
b/applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
index
1e8bd7e
..
83011e9
100644
(file)
--- a/
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
+++ b/
applications/luci-app-travelmate/luasrc/model/cbi/travelmate/wifi_add.lua
@@
-4,7
+4,7
@@
local fs = require("nixio.fs")
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")
local fs = require("nixio.fs")
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")
-local trmiface = uci
.
get("travelmate", "global", "trm_iface") or "trm_wwan"
+local trmiface = uci
:
get("travelmate", "global", "trm_iface") or "trm_wwan"
local encr_psk = {"psk", "psk2", "psk-mixed"}
local encr_wpa = {"wpa", "wpa2", "wpa-mixed"}
local encr_psk = {"psk", "psk2", "psk-mixed"}
local encr_wpa = {"wpa", "wpa2", "wpa-mixed"}
@@
-26,18
+26,23
@@
m.hidden = {
wpa_version = http.formvalue("wpa_version")
}
wpa_version = http.formvalue("wpa_version")
}
-if m.hidden.ssid ~= "" then
- wssid = m:field(Value, "ssid", translate("SSID"))
- wssid.datatype = "rangelength(1,32)"
- wssid.default = m.hidden.ssid or ""
-else
+if m.hidden.ssid == "" then
wssid = m:field(Value, "ssid", translate("SSID (hidden)"))
wssid = m:field(Value, "ssid", translate("SSID (hidden)"))
+else
+ wssid = m:field(Value, "ssid", translate("SSID"))
end
end
+wssid.datatype = "rangelength(1,32)"
+wssid.default = m.hidden.ssid or ""
nobssid = m:field(Flag, "no_bssid", translate("Ignore BSSID"))
nobssid = m:field(Flag, "no_bssid", translate("Ignore BSSID"))
-nobssid.default = nobssid.enabled
+if m.hidden.ssid == "" then
+ nobssid.default = nobssid.disabled
+else
+ nobssid.default = nobssid.enabled
+end
-bssid = m:field(Value, "bssid", translate("BSSID"))
+bssid = m:field(Value, "bssid", translate("BSSID"),
+ translatef("The BSSID information '%s' is optional and only required for hidden networks", m.hidden.bssid or ""))
bssid:depends("no_bssid", 0)
bssid.datatype = "macaddr"
bssid.default = m.hidden.bssid or ""
bssid:depends("no_bssid", 0)
bssid.datatype = "macaddr"
bssid.default = m.hidden.bssid or ""
@@
-101,6
+106,8
@@
elseif (tonumber(m.hidden.wpa_version) or 0) > 0 then
authentication:value("EAP-MD5")
authentication:value("EAP-MSCHAPV2")
authentication:value("EAP-TLS")
authentication:value("EAP-MD5")
authentication:value("EAP-MSCHAPV2")
authentication:value("EAP-TLS")
+ authentication:value("auth=PAP")
+ authentication:value("auth=MSCHAPV2")
authentication.default = "EAP-MSCHAPV2"
ident = m:field(Value, "identity", translate("Identity"))
authentication.default = "EAP-MSCHAPV2"
ident = m:field(Value, "identity", translate("Identity"))
@@
-169,6
+176,7
@@
function wssid.write(self, section, value)
end
uci:save("wireless")
uci:commit("wireless")
end
uci:save("wireless")
uci:commit("wireless")
+ luci.sys.call("env -i /bin/ubus call network reload >/dev/null 2>&1")
http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
end
http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
end