diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-08 01:24:37 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-08 01:24:37 +0000 |
commit | c7f225b1338762f1bd08aa39f24c7790fa94c754 (patch) | |
tree | 668b967ff73ca60132352f06ecdf5d9b2d70b98b | |
parent | 9fcd1f2f59ba07882e2925f53703e8cfad943800 (diff) |
modules/admin-full: adept ifaces model to changed firewall model interface
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index db4d500f5..3a6538c7b 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -104,22 +104,24 @@ fwzone.rmempty = false function fwzone.cfgvalue(self, section) self.iface = section - local z = fw.get_zones_by_network(section)[1] + local z = fw:get_zones_by_network(section)[1] return z and z:name() end function fwzone.write(self, section, value) - local zone = fw.get_zone(value) + local zone = fw:get_zone(value) - if not zone then + if not zone and value == '-' then value = m:formvalue(self:cbid(section) .. ".newzone") - if value and #value > 0 and value:match("^[a-zA-Z0-9_]+$") then - zone = fw.add_zone(value) + if value and #value > 0 then + zone = fw:add_zone(value) + else + fw:del_network(section) end end if zone then - fw.del_network(section) + fw:del_network(section) zone:add_network(section) end end |