WLAN can now be assigned to any LAN bridge. Changing VLAN/bridge settings no longer...
[tomato.git] / release / src / router / www / forward-dmz.asp
blobe4435f2b87e8bcd8ab34d3d1ca144e724ad56d2f
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] Forwarding: DMZ</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <link rel='stylesheet' type='text/css' href='color.css'>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
21 <script type='text/javascript' src='debug.js'></script>
23 <script type='text/javascript'>
25 // <% nvram("dmz_enable,dmz_ipaddr,dmz_sip"); %>
27 var lipp = '<% lipp(); %>.';
29 function verifyFields(focused, quiet)
31 var sip, dip, off;
33 off = !E('_f_dmz_enable').checked;
35 dip = E('_f_dmz_ipaddr')
36 dip.disabled = off;
38 sip = E('_f_dmz_sip');
39 sip.disabled = off;
41 if (off) {
42 ferror.clearAll(dip, sip);
43 return 1;
46 if (dip.value.indexOf('.') == -1) dip.value = lipp + dip.value;
47 if (!v_ip(dip)) return 0;
49 if ((sip.value.length) && (!v_iptaddr(sip, quiet, 15))) return 0;
50 ferror.clear(sip);
52 return 1;
55 function save()
57 var fom;
58 var en;
59 var s;
61 if (!verifyFields(null, false)) return;
63 fom = E('_fom');
64 en = fom.f_dmz_enable.checked;
65 fom.dmz_enable.value = en ? 1 : 0;
66 if (en) {
67 // shorten it if possible to be more compatible with original
68 s = fom.f_dmz_ipaddr.value;
69 fom.dmz_ipaddr.value = (s.indexOf(lipp) == 0) ? s.replace(lipp, '') : s;
71 fom.dmz_sip.value = fom.f_dmz_sip.value.split(/\s*,\s*/).join(',');
72 form.submit(fom, 0);
74 </script>
76 </head>
77 <body>
78 <form id='_fom' method='post' action='tomato.cgi'>
79 <table id='container' cellspacing=0>
80 <tr><td colspan=2 id='header'>
81 <div class='title'>Tomato</div>
82 <div class='version'>Version <% version(); %></div>
83 </td></tr>
84 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
85 <td id='content'>
86 <div id='ident'><% ident(); %></div>
88 <!-- / / / -->
90 <input type='hidden' name='_nextpage' value='forward-dmz.asp'>
91 <input type='hidden' name='_service' value='firewall-restart'>
93 <input type='hidden' name='dmz_enable'>
94 <input type='hidden' name='dmz_ipaddr'>
95 <input type='hidden' name='dmz_sip'>
97 <div class='section-title'>DMZ</div>
98 <div class='section'>
99 <script type='text/javascript'>
100 createFieldTable('', [
101 { title: 'Enable DMZ', name: 'f_dmz_enable', type: 'checkbox', value: (nvram.dmz_enable == '1') },
102 { title: 'Destination Address', indent: 2, name: 'f_dmz_ipaddr', type: 'text', maxlen: 15, size: 17,
103 value: (nvram.dmz_ipaddr.indexOf('.') != -1) ? nvram.dmz_ipaddr : (lipp + nvram.dmz_ipaddr) },
104 { title: 'Source Address<br>Restriction', indent: 2, name: 'f_dmz_sip', type: 'text', maxlen: 512, size: 64,
105 value: nvram.dmz_sip, suffix: '<br><small>(optional; ex: "1.1.1.1", "1.1.1.0/24", "1.1.1.1 - 2.2.2.2" or "me.example.com")</small>' }
107 </script>
108 </div>
110 <br>
111 <script type='text/javascript'>if (nvram.dmz_enable == '1') show_notice1('<% notice("iptables"); %>');</script>
113 <!-- / / / -->
115 </td></tr>
116 <tr><td id='footer' colspan=2>
117 <span id='footer-msg'></span>
118 <input type='button' value='Save' id='save-button' onclick='save()'>
119 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
120 </td></tr>
121 </table>
122 </form>
123 <script type='text/javascript'>verifyFields(null, 1);</script>
124 </body>
125 </html>