Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / package / luci / applications / luci-app-firewall / luasrc / model / cbi / firewall / zone-details.lua
index 7553504572bbf4cbe577e19e6960269586472464..e168c3c6054341273b7207662aba2c82acc4f234 100644 (file)
@@ -68,12 +68,6 @@ function name.write(self, section, value)
                out.exclude = value
                inp.exclude = value
        end
-
-       m.redirect = ds.build_url("admin/network/firewall/zones", value)
-       m.title = "%s - %s" %{
-               translate("Firewall - Zone Settings"),
-               translatef("Zone %q", value or "?")
-       }
 end
 
 p = {
@@ -107,9 +101,12 @@ end
 function net.write(self, section, value)
        zone:clear_networks()
 
-       local n
-       for n in ut.imatch(value) do
-               zone:add_network(n)
+       local net
+       for net in ut.imatch(value) do
+               local n = nw:get_network(net) or nw:add_network(net, { proto = "none" })
+               if n then
+                       zone:add_network(n:name())
+               end
        end
 end