From 0ec3f91a0c7a8c71980f5e70f3322397e496a8d6 Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Mon, 14 Dec 2015 22:51:29 -0500 Subject: validation: Add option ipv4only option to host and hostport datatypes Some applications only support ipv4 so add ipv4only option to host and hostport datatypes so that for thos applications that when an IP address is specified only and ipv4 ip address gets accepted. --- modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua | 2 +- modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/wifi.lua | 4 ++-- modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/luci-mod-admin-full/luasrc/model') diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua index 4dc52ada0..572446fef 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua @@ -135,7 +135,7 @@ rd = s:taboption("general", DynamicList, "rebind_domain", translate("List of domains to allow RFC1918 responses for")) rd:depends("rebind_protection", "1") -rd.datatype = "host" +rd.datatype = "host(1)" rd.placeholder = "ihost.netflix.com" 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 b91c29b08..44528927e 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 @@ -749,7 +749,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"}) @@ -773,7 +773,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"}) diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua index 94ba8053a..2874b5607 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/system.lua @@ -204,7 +204,7 @@ if has_ntpd then o = s:option(DynamicList, "server", translate("NTP server candidates")) - o.datatype = "host" + o.datatype = "host(0)" o:depends("enable", "1") -- retain server list even if disabled -- cgit v1.2.3