1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
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.
12 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
13 <meta name='robots' content='noindex,nofollow'
>
14 <title>[<%
ident(); %>] Basic: Wireless Filter
</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>
21 <style type='text/css'
>
33 <script type='text/javascript' src='debug.js'
></script>
35 <script type='text/javascript' src='wireless.jsx?_http_id=<%
nv(http_id
); %>'
></script>
36 <script type='text/javascript'
>
38 // <% nvram("wl_macmode,wl_maclist,macnames"); %>
40 var smg
= new TomatoGrid();
42 smg
.verifyFields = function(row
, quiet
) {
44 f
= fields
.getAll(row
);
46 return v_mac(f
[0], quiet
) && v_nodelim(f
[1], quiet
, 'Description', 1);
49 smg
.resetNewEditor = function() {
52 f
= fields
.getAll(this.newEditor
);
55 if ((c
= cookie
.get('addmac')) != null) {
56 cookie
.set('addmac', '', 0);
65 f
[0].value
= '00:00:00:00:00:00';
69 smg
.setup = function() {
73 this.init('sm-grid', 'sort', 250, [
74 { type
: 'text', maxlen
: 17 },
75 { type
: 'text', maxlen
: 48 }
77 this.headerSet(['MAC Address', 'Description']);
78 macs
= nvram
.wl_maclist
.split(/\s+/);
79 names
= nvram
.macnames
.split('>');
80 for (i
= 0; i
< macs
.length
; ++i
) {
82 if ((m
) && (!isMAC0(m
))) {
83 s
= m
.replace(/:/g
, '');
85 for (j
= 0; j
< names
.length
; ++j
) {
86 n
= names
[j
].split('<');
87 if ((n
.length
== 2) && (n
[0] == s
)) {
92 this.insertData(-1, [m
, t
]);
97 this.resetNewEditor();
103 var d
, i
, macs
, names
, ma
, na
;
106 if (smg
.isEditing()) return;
112 d
= smg
.getAllData();
113 for (i
= 0; i
< d
.length
; ++i
) {
115 na
= d
[i
][1].replace(/[<>|]/g, '');
119 names
.push(ma
.replace(/:/g
, '') + '<' + na
);
122 fom
.wl_maclist
.value
= macs
.join(' ');
123 fom
.wl_macmode
.value
= E('_f_disable').checked
? 'disabled' : (E('_f_deny').checked
? 'deny' : 'allow');
124 fom
.macnames
.value
= names
.join('>');
126 for (i
= 0; i
< wl_ifaces
.length
; ++i
) {
128 E('_wl'+u
+'_macmode').value
= fom
.wl_macmode
.value
;
129 E('_wl'+u
+'_maclist').value
= fom
.wl_maclist
.value
;
138 if (nvram
.wl_macmode
== 'allow') E('_f_allow').checked
= 1;
139 else if (nvram
.wl_macmode
== 'deny') E('_f_deny').checked
= 1;
140 else E('_f_disable').checked
= 1;
149 <body onload='init()'
>
150 <form id='_fom' method='post' action='tomato.cgi'
>
151 <table id='container' cellspacing=
0>
152 <tr><td colspan=
2 id='header'
>
153 <div class='title'
>Tomato
</div>
154 <div class='version'
>Version <%
version(); %></div>
156 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
158 <div id='ident'
><%
ident(); %></div>
162 <input type='hidden' name='_nextpage' value='basic-wfilter.asp'
>
163 <input type='hidden' name='_nextwait' value='
10'
>
164 <input type='hidden' name='_service' value='*'
>
166 <input type='hidden' name='wl_macmode'
>
167 <input type='hidden' name='wl_maclist'
>
168 <input type='hidden' name='macnames'
>
170 <script type='text/javascript'
>
171 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
172 var u
= wl_unit(uidx
);
173 W('<input type=\'hidden\' id=\'_wl'+u
+'_macmode\' name=\'wl'+u
+'_macmode\'>');
174 W('<input type=\'hidden\' id=\'_wl'+u
+'_maclist\' name=\'wl'+u
+'_maclist\'>');
178 <div class='section-title'
>Wireless Client Filter
</div>
179 <div class='section'
>
180 <input type='radio' name='f_type' id='_f_disable' value='disabled'
> <label for='_f_disable'
>Disable filter
</label><br>
181 <input type='radio' name='f_type' id='_f_allow' value='allow'
> <label for='_f_allow'
>Permit only the following clients
</label><br>
182 <input type='radio' name='f_type' id='_f_deny' value='deny'
> <label for='_f_deny'
>Block the following clients
</label><br>
184 <table id='sm-grid' class='tomato-grid'
></table>
191 <tr><td id='footer' colspan=
2>
192 <span id='footer-msg'
></span>
193 <input type='button' value='Save' id='save-button' onclick='save()'
>
194 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'
>
198 <script type='text/javascript'
>earlyInit()</script>