+-- IPv4/IPv6 - bind_network -- #################################################
+if has_ssl or ( ( m:get(section, "bind_network") or "" ) ~= "" ) then
+ bnet = ns:taboption("advanced", ListValue, "bind_network",
+ translate("Bind Network") )
+ bnet:depends("ipv4_source", "web")
+ bnet:depends("ipv6_source", "web")
+ bnet.rmempty = true
+ bnet.default = ""
+ bnet:value("", translate("-- default --"))
+ WADM.cbi_add_networks(bnet)
+ function bnet.cfgvalue(self, section)
+ local value = AbstractValue.cfgvalue(self, section)
+ if not has_ssl and value ~= "" then
+ self.description = bold_on .. font_red ..
+ translate("Binding to a specific network not supported") .. font_off .. "<br />" ..
+ translate("please set to 'default'") .. " !" .. bold_off
+ else
+ self.description = translate("OPTIONAL: Network to use for communication") ..
+ "<br />" .. translate("Casual users should not change this setting")
+ end
+ return value
+ end
+ function bnet.validate(self, value)
+ if (value ~= "" and has_ssl ) or value == "" then return value end
+ return nil, err_tab_adv(self) .. translate("Binding to a specific network not supported") .. " !"
+ end
+end
+