X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_network%2Fwifi.lua;h=9db42e3c4e9c870f75905dbccfc73ae166e53f57;hp=fff8b2f30a1cd94fa546d9882e0c093588ce14e1;hb=4074440529d7230ef756ee5a8d1580361977def1;hpb=7a3493b1f7d75a3945279115324cf2ff4da26b7b diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua index fff8b2f30..9db42e3c4 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua @@ -17,6 +17,7 @@ m = Map("wireless", "", m:chain("network") m:chain("firewall") +m.redirect = luci.dispatcher.build_url("admin/network/wireless") local ifsection @@ -142,7 +143,7 @@ local found_sta = nil local _, net if wnet:mode() ~= "sta" then for _, net in ipairs(wdev:get_wifinets()) do - if net:mode() == "sta" then + if net:mode() == "sta" and net:get("disabled") ~= "1" then if not found_sta then found_sta = {} found_sta.channel = net:channel() @@ -155,11 +156,12 @@ end if found_sta then ch = s:taboption("general", DummyValue, "choice", translate("Channel")) - ch.value = translatef("Locked to channel %d used by: %s", - found_sta.channel, table.concat(found_sta.names, ", ")) + ch.value = translatef("Locked to channel %s used by: %s", + found_sta.channel or "(auto)", table.concat(found_sta.names, ", ")) else ch = s:taboption("general", Value, "_mode_freq", '
'..translate("Operating frequency")) - ch.hwmodes = iw.hwmodelist + ch.hwmodes = hw_modes + ch.htmodes = iw.htmodelist ch.freqlist = iw.freqlist ch.template = "cbi/wireless_modefreq" @@ -173,7 +175,7 @@ else function ch.formvalue(self, section) return { - m:formvalue(self:cbid(section) .. ".band") or (iw.hwmodelist.g and "11g" or "11a"), + m:formvalue(self:cbid(section) .. ".band") or (hw_modes.g and "11g" or "11a"), m:formvalue(self:cbid(section) .. ".channel") or "auto", m:formvalue(self:cbid(section) .. ".htmode") or "" } @@ -360,7 +362,8 @@ s:tab("encryption", translate("Wireless Security")) s:tab("macfilter", translate("MAC-Filter")) s:tab("advanced", translate("Advanced Settings")) -s:taboption("general", Value, "ssid", translate("ESSID")) +ssid = s:taboption("general", Value, "ssid", translate("ESSID")) +ssid.datatype = "maxlength(32)" mode = s:taboption("general", ListValue, "mode", translate("Mode")) mode.override_values = true @@ -747,7 +750,7 @@ auth_server:depends({mode="ap", encryption="wpa2"}) auth_server:depends({mode="ap-wds", encryption="wpa"}) auth_server:depends({mode="ap-wds", encryption="wpa2"}) auth_server.rmempty = true -auth_server.datatype = "host" +auth_server.datatype = "host(0)" auth_port = s:taboption("encryption", Value, "auth_port", translate("Radius-Authentication-Port"), translatef("Default %d", 1812)) auth_port:depends({mode="ap", encryption="wpa"}) @@ -771,7 +774,7 @@ acct_server:depends({mode="ap", encryption="wpa2"}) acct_server:depends({mode="ap-wds", encryption="wpa"}) acct_server:depends({mode="ap-wds", encryption="wpa2"}) acct_server.rmempty = true -acct_server.datatype = "host" +acct_server.datatype = "host(0)" acct_port = s:taboption("encryption", Value, "acct_port", translate("Radius-Accounting-Port"), translatef("Default %d", 1813)) acct_port:depends({mode="ap", encryption="wpa"}) @@ -862,6 +865,7 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then eaptype:value("tls", "TLS") eaptype:value("ttls", "TTLS") eaptype:value("peap", "PEAP") + eaptype:value("fast", "FAST") eaptype:depends({mode="sta", encryption="wpa"}) eaptype:depends({mode="sta", encryption="wpa2"}) eaptype:depends({mode="sta-wds", encryption="wpa"}) @@ -872,12 +876,13 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then cacert:depends({mode="sta", encryption="wpa2"}) cacert:depends({mode="sta-wds", encryption="wpa"}) cacert:depends({mode="sta-wds", encryption="wpa2"}) + cacert.rmempty = true clientcert = s:taboption("encryption", FileUpload, "client_cert", translate("Path to Client-Certificate")) - clientcert:depends({mode="sta", encryption="wpa"}) - clientcert:depends({mode="sta", encryption="wpa2"}) - clientcert:depends({mode="sta-wds", encryption="wpa"}) - clientcert:depends({mode="sta-wds", encryption="wpa2"}) + clientcert:depends({mode="sta", eap_type="tls", encryption="wpa"}) + clientcert:depends({mode="sta", eap_type="tls", encryption="wpa2"}) + clientcert:depends({mode="sta-wds", eap_type="tls", encryption="wpa"}) + clientcert:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"}) privkey = s:taboption("encryption", FileUpload, "priv_key", translate("Path to Private Key")) privkey:depends({mode="sta", eap_type="tls", encryption="wpa2"}) @@ -890,42 +895,90 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then privkeypwd:depends({mode="sta", eap_type="tls", encryption="wpa"}) privkeypwd:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"}) privkeypwd:depends({mode="sta-wds", eap_type="tls", encryption="wpa"}) - - - auth = s:taboption("encryption", Value, "auth", translate("Authentication")) - auth:value("PAP") - auth:value("CHAP") - auth:value("MSCHAP") - auth:value("MSCHAPV2") + privkeypwd.rmempty = true + privkeypwd.password = true + + auth = s:taboption("encryption", ListValue, "auth", translate("Authentication")) + auth:value("PAP", "PAP", {eap_type="ttls"}) + auth:value("CHAP", "CHAP", {eap_type="ttls"}) + auth:value("MSCHAP", "MSCHAP", {eap_type="ttls"}) + auth:value("MSCHAPV2", "MSCHAPv2", {eap_type="ttls"}) + auth:value("EAP-GTC") + auth:value("EAP-MD5") + auth:value("EAP-MSCHAPV2") + auth:value("EAP-TLS") + auth:depends({mode="sta", eap_type="fast", encryption="wpa2"}) + auth:depends({mode="sta", eap_type="fast", encryption="wpa"}) auth:depends({mode="sta", eap_type="peap", encryption="wpa2"}) auth:depends({mode="sta", eap_type="peap", encryption="wpa"}) auth:depends({mode="sta", eap_type="ttls", encryption="wpa2"}) auth:depends({mode="sta", eap_type="ttls", encryption="wpa"}) + auth:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"}) + auth:depends({mode="sta-wds", eap_type="fast", encryption="wpa"}) auth:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"}) auth:depends({mode="sta-wds", eap_type="peap", encryption="wpa"}) auth:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"}) auth:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"}) + cacert2 = s:taboption("encryption", FileUpload, "ca_cert2", translate("Path to inner CA-Certificate")) + cacert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"}) + cacert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"}) + cacert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"}) + cacert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"}) + + clientcert2 = s:taboption("encryption", FileUpload, "client_cert2", translate("Path to inner Client-Certificate")) + clientcert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"}) + clientcert2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"}) + clientcert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"}) + clientcert2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"}) + + privkey2 = s:taboption("encryption", FileUpload, "priv_key2", translate("Path to inner Private Key")) + privkey2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"}) + privkey2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"}) + privkey2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"}) + privkey2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"}) + + privkeypwd2 = s:taboption("encryption", Value, "priv_key2_pwd", translate("Password of inner Private Key")) + privkeypwd2:depends({mode="sta", auth="EAP-TLS", encryption="wpa"}) + privkeypwd2:depends({mode="sta", auth="EAP-TLS", encryption="wpa2"}) + privkeypwd2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa"}) + privkeypwd2:depends({mode="sta-wds", auth="EAP-TLS", encryption="wpa2"}) + privkeypwd2.rmempty = true + privkeypwd2.password = true identity = s:taboption("encryption", Value, "identity", translate("Identity")) + identity:depends({mode="sta", eap_type="fast", encryption="wpa2"}) + identity:depends({mode="sta", eap_type="fast", encryption="wpa"}) identity:depends({mode="sta", eap_type="peap", encryption="wpa2"}) identity:depends({mode="sta", eap_type="peap", encryption="wpa"}) identity:depends({mode="sta", eap_type="ttls", encryption="wpa2"}) identity:depends({mode="sta", eap_type="ttls", encryption="wpa"}) + identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"}) + identity:depends({mode="sta-wds", eap_type="fast", encryption="wpa"}) identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"}) identity:depends({mode="sta-wds", eap_type="peap", encryption="wpa"}) identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"}) identity:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"}) + identity:depends({mode="sta", eap_type="tls", encryption="wpa2"}) + identity:depends({mode="sta", eap_type="tls", encryption="wpa"}) + identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa2"}) + identity:depends({mode="sta-wds", eap_type="tls", encryption="wpa"}) password = s:taboption("encryption", Value, "password", translate("Password")) + password:depends({mode="sta", eap_type="fast", encryption="wpa2"}) + password:depends({mode="sta", eap_type="fast", encryption="wpa"}) password:depends({mode="sta", eap_type="peap", encryption="wpa2"}) password:depends({mode="sta", eap_type="peap", encryption="wpa"}) password:depends({mode="sta", eap_type="ttls", encryption="wpa2"}) password:depends({mode="sta", eap_type="ttls", encryption="wpa"}) + password:depends({mode="sta-wds", eap_type="fast", encryption="wpa2"}) + password:depends({mode="sta-wds", eap_type="fast", encryption="wpa"}) password:depends({mode="sta-wds", eap_type="peap", encryption="wpa2"}) password:depends({mode="sta-wds", eap_type="peap", encryption="wpa"}) password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa2"}) password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"}) + password.rmempty = true + password.password = true end if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then