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'
>
37 // <% nvram("wl_macmode,wl_maclist,macnames"); %>
39 var smg
= new TomatoGrid();
41 smg
.verifyFields = function(row
, quiet
) {
42 return v_mac(fields
.getAll(row
)[0], quiet
);
45 smg
.resetNewEditor = function() {
48 f
= fields
.getAll(this.newEditor
);
51 if ((c
= cookie
.get('addmac')) != null) {
52 cookie
.set('addmac', '', 0);
61 f
[0].value
= '00:00:00:00:00:00';
65 smg
.setup = function() {
69 this.init('sm-grid', 'sort', 200, [
70 { type
: 'text', maxlen
: 17 },
71 { type
: 'text', maxlen
: 48 }
73 this.headerSet(['MAC Address', 'Description']);
74 macs
= nvram
.wl_maclist
.split(/\s+/);
75 names
= nvram
.macnames
.split('>');
76 for (i
= 0; i
< macs
.length
; ++i
) {
78 if ((m
) && (!isMAC0(m
))) {
79 s
= m
.replace(/:/g
, '');
81 for (j
= 0; j
< names
.length
; ++j
) {
82 n
= names
[j
].split('<');
83 if ((n
.length
== 2) && (n
[0] == s
)) {
88 this.insertData(-1, [m
, t
]);
93 this.resetNewEditor();
99 var d
, i
, macs
, names
, ma
, na
;
101 if (smg
.isEditing()) return;
107 d
= smg
.getAllData();
108 for (i
= 0; i
< d
.length
; ++i
) {
110 na
= d
[i
][1].replace(/[<>|]/g, '');
114 names
.push(ma
.replace(/:/g
, '') + '<' + na
);
117 fom
.wl_maclist
.value
= macs
.join(' ');
118 fom
.wl_macmode
.value
= E('_f_disable').checked
? 'disabled' : (E('_f_deny').checked
? 'deny' : 'allow');
119 fom
.macnames
.value
= names
.join('>');
126 if (nvram
.wl_macmode
== 'allow') E('_f_allow').checked
= 1;
127 else if (nvram
.wl_macmode
== 'deny') E('_f_deny').checked
= 1;
128 else E('_f_disable').checked
= 1;
137 <body onload='init()'
>
138 <form id='_fom' method='post' action='tomato.cgi'
>
139 <table id='container' cellspacing=
0>
140 <tr><td colspan=
2 id='header'
>
141 <div class='title'
>Tomato
</div>
142 <div class='version'
>Version <%
version(); %></div>
144 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
146 <div id='ident'
><%
ident(); %></div>
150 <input type='hidden' name='_nextpage' value='basic-wfilter.asp'
>
151 <input type='hidden' name='_nextwait' value='
10'
>
152 <input type='hidden' name='_service' value='*'
>
154 <input type='hidden' name='wl_macmode'
>
155 <input type='hidden' name='wl_maclist'
>
156 <input type='hidden' name='macnames'
>
159 <div class='section-title'
>Wireless Client Filter
</div>
160 <div class='section'
>
161 <input type='radio' name='f_type' id='_f_disable' value='disabled'
> <label for='_f_disable'
>Disable filter
</label><br>
162 <input type='radio' name='f_type' id='_f_allow' value='allow'
> <label for='_f_allow'
>Permit only the following clients
</label><br>
163 <input type='radio' name='f_type' id='_f_deny' value='deny'
> <label for='_f_deny'
>Block the following clients
</label><br>
165 <table id='sm-grid' class='tomato-grid'
></table>
172 <tr><td id='footer' colspan=
2>
173 <span id='footer-msg'
></span>
174 <input type='button' value='Save' id='save-button' onclick='save()'
>
175 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'
>
179 <script type='text/javascript'
>earlyInit()</script>