+ elseif string.match(s.encryption, '^wpa') then
+ encr = m:field(ListValue, "encryption", translate("Encryption"))
+ encr:value("wpa", "WPA Enterprise")
+ encr:value("wpa-mixed", "WPA/WPA2 Enterprise mixed")
+ encr:value("wpa2", "WPA2 Enterprise")
+ encr.default = s.encryption
+
+ ciph = m:field(ListValue, "cipher", translate("Cipher"))
+ ciph:value("auto", translate("Automatic"))
+ ciph:value("ccmp", translate("Force CCMP (AES)"))
+ ciph:value("tkip", translate("Force TKIP"))
+ ciph:value("tkip+ccmp", translate("Force TKIP and CCMP (AES)"))
+ ciph.default = s.cipher
+
+ eaptype = m:field(ListValue, "eap_type", translate("EAP-Method"))
+ eaptype:value("tls", "TLS")
+ eaptype:value("ttls", "TTLS")
+ eaptype:value("peap", "PEAP")
+ eaptype:value("fast", "FAST")
+ eaptype.default = s.eap_type or "peap"
+
+ authentication = m:field(ListValue, "auth", translate("Authentication"))
+ authentication:value("PAP")
+ authentication:value("CHAP")
+ authentication:value("MSCHAP")
+ authentication:value("MSCHAPV2")
+ authentication:value("EAP-GTC")
+ authentication:value("EAP-MD5")
+ authentication:value("EAP-MSCHAPV2")
+ authentication:value("EAP-TLS")
+ authentication:value("auth=PAP")
+ authentication:value("auth=MSCHAPV2")
+ authentication.default = s.auth or "EAP-MSCHAPV2"
+
+ ident = m:field(Value, "identity", translate("Identity"))
+ ident.default = s.identity or ""
+
+ wkey = m:field(Value, "password", translate("Passphrase"))
+ wkey.datatype = "wpakey"
+
+ cacert = m:field(Value, "ca_cert", translate("Path to CA-Certificate"))
+ cacert.rmempty = true
+ cacert.default = s.ca_cert or ""
+
+ clientcert = m:field(Value, "client_cert", translate("Path to Client-Certificate"))
+ clientcert:depends("eap_type","tls")
+ clientcert.rmempty = true
+ clientcert.default = s.client_cert or ""
+
+ privkey = m:field(Value, "priv_key", translate("Path to Private Key"))
+ privkey:depends("eap_type","tls")
+ privkey.rmempty = true
+ privkey.default = s.priv_key or ""
+
+ privkeypwd = m:field(Value, "priv_key_pwd", translate("Password of Private Key"))
+ privkeypwd:depends("eap_type","tls")
+ privkeypwd.datatype = "wpakey"
+ privkeypwd.password = true
+ privkeypwd.rmempty = true
+ privkeypwd.default = s.priv_key_pwd or ""