diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-08-13 09:20:43 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-08-13 09:23:26 +0200 |
commit | bf123fb7c4918120f5f9f638866bfae1e5b23a54 (patch) | |
tree | d35b13a406f25b1cad1158bc2bc9a0414abdc4e6 /applications/luci-app-firewall | |
parent | 849d153851db2fc193c1c82648dbe719463d3a38 (diff) |
luci-app-firewall: allow "open ports" when no wan zone exists
Arguably this makes little if no wan zone exists but prefer consistency
over heuristics and always render the "open port" shortcut.
Fixes #2056
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-firewall')
-rw-r--r-- | applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm index 273675cd3..82168712a 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm @@ -1,11 +1,9 @@ <% local fw = require "luci.model.firewall".init() - local wz = fw:get_zone("wan") - local lz = fw:get_zone("lan") local zones = fw:get_zones() %> -<% if wz then %> +<% if #zones > 0 then %> <h4><%:Open ports on router%></h4> <div class="table"> <div class="tr cbi-section-table-titles"> @@ -71,7 +69,7 @@ <input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" /> <% end %> -<% if wz then %> +<% if #zones > 0 then %> <script type="text/javascript">//<![CDATA[ cbi_validate_field('_newopen.extport', true, 'list(neg(portrange))'); cbi_bind(document.getElementById('_newopen.extport'), 'blur', |