1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
8 Copyright (C) 2011 Augusto Bott
9 http://code.google.com/p/tomato-sdhc-vlan/
11 For use with Tomato Firmware only.
12 No part of this file may be used without permission.
16 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
17 <meta name='robots' content='noindex,nofollow'
>
18 <title>[<%
ident(); %>] Basic: Wireless Filter
</title>
19 <link rel='stylesheet' type='text/css' href='tomato.css'
>
21 <script type='text/javascript' src='tomato.js'
></script>
25 <style type='text/css'
>
37 <script type='text/javascript' src='debug.js'
></script>
39 <script type='text/javascript' src='wireless.jsx?_http_id=<%
nv(http_id
); %>'
></script>
40 <script type='text/javascript'
>
42 // <% nvram("wl_macmode,wl_maclist,macnames"); %>
44 var smg
= new TomatoGrid();
46 smg
.verifyFields = function(row
, quiet
) {
48 f
= fields
.getAll(row
);
50 return v_mac(f
[0], quiet
) && v_nodelim(f
[1], quiet
, 'Description', 1);
53 smg
.resetNewEditor = function() {
56 f
= fields
.getAll(this.newEditor
);
59 if ((c
= cookie
.get('addmac')) != null) {
60 cookie
.set('addmac', '', 0);
69 f
[0].value
= '00:00:00:00:00:00';
73 smg
.setup = function() {
77 this.init('sm-grid', 'sort', 250, [
78 { type
: 'text', maxlen
: 17 },
79 { type
: 'text', maxlen
: 48 }
81 this.headerSet(['MAC Address', 'Description']);
82 macs
= nvram
.wl_maclist
.split(/\s+/);
83 names
= nvram
.macnames
.split('>');
84 for (i
= 0; i
< macs
.length
; ++i
) {
86 if ((m
) && (!isMAC0(m
))) {
87 s
= m
.replace(/:/g
, '');
89 for (j
= 0; j
< names
.length
; ++j
) {
90 n
= names
[j
].split('<');
91 if ((n
.length
== 2) && (n
[0] == s
)) {
96 this.insertData(-1, [m
, t
]);
100 this.showNewEditor();
101 this.resetNewEditor();
107 var d
, i
, macs
, names
, ma
, na
;
110 if (smg
.isEditing()) return;
116 d
= smg
.getAllData();
117 for (i
= 0; i
< d
.length
; ++i
) {
119 na
= d
[i
][1].replace(/[<>|]/g, '');
123 names
.push(ma
.replace(/:/g
, '') + '<' + na
);
126 fom
.wl_maclist
.value
= macs
.join(' ');
127 fom
.wl_macmode
.value
= E('_f_disable').checked
? 'disabled' : (E('_f_deny').checked
? 'deny' : 'allow');
128 fom
.macnames
.value
= names
.join('>');
130 for (i
= 0; i
< wl_ifaces
.length
; ++i
) {
132 E('_wl'+u
+'_macmode').value
= fom
.wl_macmode
.value
;
133 E('_wl'+u
+'_maclist').value
= fom
.wl_maclist
.value
;
142 if (nvram
.wl_macmode
== 'allow') E('_f_allow').checked
= 1;
143 else if (nvram
.wl_macmode
== 'deny') E('_f_deny').checked
= 1;
144 else E('_f_disable').checked
= 1;
153 <body onload='init()'
>
154 <form id='_fom' method='post' action='tomato.cgi'
>
155 <table id='container' cellspacing=
0>
156 <tr><td colspan=
2 id='header'
>
157 <div class='title'
>Tomato
</div>
158 <div class='version'
>Version <%
version(); %></div>
160 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
162 <div id='ident'
><%
ident(); %></div>
166 <input type='hidden' name='_nextpage' value='basic-wfilter.asp'
>
167 <input type='hidden' name='_nextwait' value='
10'
>
168 <input type='hidden' name='_service' value='*'
>
170 <input type='hidden' name='wl_macmode'
>
171 <input type='hidden' name='wl_maclist'
>
172 <input type='hidden' name='macnames'
>
174 <script type='text/javascript'
>
175 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
176 var u
= wl_fface(uidx
);
177 W('<input type=\'hidden\' id=\'_wl'+u
+'_macmode\' name=\'wl'+u
+'_macmode\'>');
178 W('<input type=\'hidden\' id=\'_wl'+u
+'_maclist\' name=\'wl'+u
+'_maclist\'>');
182 <div class='section-title'
>Wireless Client Filter
</div>
183 <div class='section'
>
184 <input type='radio' name='f_type' id='_f_disable' value='disabled'
> <label for='_f_disable'
>Disable filter
</label><br>
185 <input type='radio' name='f_type' id='_f_allow' value='allow'
> <label for='_f_allow'
>Permit only the following clients
</label><br>
186 <input type='radio' name='f_type' id='_f_deny' value='deny'
> <label for='_f_deny'
>Block the following clients
</label><br>
188 <table id='sm-grid' class='tomato-grid'
></table>
195 <tr><td id='footer' colspan=
2>
196 <span id='footer-msg'
></span>
197 <input type='button' value='Save' id='save-button' onclick='save()'
>
198 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'
>
202 <script type='text/javascript'
>earlyInit()</script>