source: src/router/kromo/dd-wrt/AOSS.asp @ 14013

Last change on this file since 14013 was 14013, checked in by BrainSlayer, 3 years ago

fix for options

File size: 8.4 KB
Line 
1<% do_pagehead("aoss.titl"); %>
2                <script type="text/javascript">
3                //<![CDATA[
4
5function SelMode(varname,num,F) {
6        F.change_action.value="gozila_cgi";
7        F.submit_type.value = "security";
8        F.security_varname.value = varname;
9        F.submit();
10}
11
12function keyMode(F) {
13        F.change_action.value="gozila_cgi";
14        F.submit_type.value = "keysize";
15        F.submit();
16}
17
18function generateKey(F,PREFIX) {
19        F.change_action.value="gozila_cgi";
20        F.security_varname.value = PREFIX;
21        F.submit_type.value = "wep_key_generate";
22        F.submit();
23}
24
25function to_submit(F) {
26        F.change_action.value="gozila_cgi";
27        F.submit_type.value = "save";
28        F.save_button.value = sbutton.saving;
29  apply(F);
30}
31function to_apply(F) {
32        F.change_action.value="gozila_cgi";
33        F.submit_type.value = "save";
34        F.save_button.value = sbutton.saving;
35  applytake(F);
36}
37
38function valid_radius(F) {
39        if(F.security_mode.value == "radius" || F.security_mode.value == "wpa" || F.security_mode.value == "wpa2" || F.security_mode.value == "wpa wpa2"){
40                if(F.wl_radius_key.value == "") {
41                        alert(errmsg.err38);
42                        F.wl_radius_key.focus();
43                        return false;
44                }
45        }
46
47        return true;
48}
49
50function valid_wpa_psk(F) {
51        if(F.security_mode.value == "psk" || F.security_mode.value == "psk2" || F.security_mode.value == "psk psk2"){
52                if(F.wl_wpa_psk.value.length == 64){
53                        if(!isxdigit(F.wl_wpa_psk, F.wl_wpa_psk.value)) {
54                                return false;
55                        }
56                } else if(F.wl_wpa_psk.value.length >=8 && F.wl_wpa_psk.value.length <= 63 ){
57                        if(!isascii(F.wl_wpa_psk,F.wl_wpa_psk.value)) {
58                                return false;
59                        }
60                } else{
61                        alert(errmsg.err39);
62                        return false;
63                }
64        }
65
66        return true;
67}
68
69function valid_wep(F) {
70        if(F.security_mode.value == "psk" || F.security_mode.value == "wpa" || F.security_mode.value == "psk2" || F.security_mode.value == "wpa2" || F.security_mode.value == "psk psk2" || F.security_mode.value == "wpa wpa2")
71                return true;
72
73        if (ValidateKey(F.wl_key1, F.wl_wep_bit.options[F.wl_wep_bit.selectedIndex].value,1) == false)
74                return false;
75
76        if (ValidateKey(F.wl_key2, F.wl_wep_bit.options[F.wl_wep_bit.selectedIndex].value,2) == false)
77                return false;
78
79        if (ValidateKey(F.wl_key3, F.wl_wep_bit.options[F.wl_wep_bit.selectedIndex].value,3) == false)
80                return false;
81
82        if (ValidateKey(F.wl_key4, F.wl_wep_bit.options[F.wl_wep_bit.selectedIndex].value,4) == false)
83                return false;
84
85        for (var i=1; i <= 4; i++) {
86                if(F.wl_key[i-1].checked) {
87                        aaa = eval("F.wl_key"+i).value;
88                        if(aaa == "") {
89                                alert(errmsg.err40 + i);
90                                return false;
91                        }
92                        break;
93                }
94        }
95
96  return true;
97}
98
99function ValidateKey(key, bit, index) {
100        if(bit == 64) {
101                switch(key.value.length) {
102                        case 0:
103                                break;
104                        case 10:
105                                if(!isxdigit(key,key.value)) {
106                                        return false;
107                                }
108                                break;
109                        default:
110                                alert(errmsg.err41 + key.value);
111                                return false;
112                }
113        } else {
114                switch(key.value.length) {
115                        case 0:
116                                break;
117                        case 26:
118                                if(!isxdigit(key,key.value)) {
119                                        return false;
120                                }
121                                break;
122                        default:
123                                alert(errmsg.err41 + key.value);
124                                return false;
125                }
126        }
127
128        return true;
129}
130function enable_idttls(ifname) {
131        show_layer_ext(this, 'idttls' + ifname, true)
132        show_layer_ext(this, 'idtls'  + ifname, false)
133        show_layer_ext(this, 'idpeap' + ifname, false)
134        show_layer_ext(this, 'idleap' + ifname, false)
135}
136
137function enable_idpeap(ifname) {
138        show_layer_ext(this, 'idttls' + ifname, false)
139        show_layer_ext(this, 'idtls' + ifname, false)
140        show_layer_ext(this, 'idpeap' + ifname, true)
141        show_layer_ext(this, 'idleap' + ifname, false)
142}
143function enable_idleap(ifname) {
144        show_layer_ext(this, 'idttls' + ifname, false)
145        show_layer_ext(this, 'idtls' + ifname, false)
146        show_layer_ext(this, 'idpeap' + ifname, false)
147        show_layer_ext(this, 'idleap' + ifname, true)
148}
149
150function enable_idtls(ifname) {
151        show_layer_ext(this, 'idttls' + ifname, false)
152        show_layer_ext(this, 'idtls' + ifname, true)
153        show_layer_ext(this, 'idpeap' + ifname, false)
154        show_layer_ext(this, 'idleap' + ifname, false)
155}
156
157var update;
158
159addEvent(window, "load", function() {
160
161       
162        var F = document.forms[0];
163        if(F.security_mode && F.wl_wep_bit)
164                if(F.security_mode.value == "wep" || F.security_mode.value == "radius") {
165                        keyMode(F.wl_wep_bit.value, F);
166                }
167               
168        update = new StatusbarUpdate();
169        update.start();
170
171});
172
173addEvent(window, "unload", function() {
174        update.stop();
175
176});
177
178                //]]>
179                </script>
180        </head>
181
182        <body class="gui">
183        <% showad(); %>
184                <div id="wrapper">
185                <div id="content">
186                <div id="header">
187                        <div id="logo"><h1><% show_control(); %></h1></div>
188                        <% do_menu("Wireless_Basic.asp","AOSS.asp"); %>
189                </div>
190                <div id="main">
191                        <div id="contents">
192                        <form name="wpa" action="apply.cgi" method="post">
193                                <input type="hidden" name="submit_button" value="WL_AOSS" />
194                                <input type="hidden" name="action" value="Apply" />
195                                <input type="hidden" name="change_action" value="gozila_cgi" />
196                                <input type="hidden" name="submit_type" value="save" />
197                               
198                                <input type="hidden" name="security_varname" />
199                                <input type="hidden" name="security_mode_last" />
200                                <input type="hidden" name="wl_wep_last" />
201                                <input type="hidden" name="filter_mac_value" />
202                               
203<!-- AOSS start -->
204<h2><% tran("aoss.aoss"); %></h2>
205
206<fieldset>
207<legend><% tran("aoss.service"); %></legend>
208<div class="setting">
209<div class="label"><% tran("aoss.enable"); %></div>
210<input class="spaceradio" type="radio" value="1" name="aoss_enable" <% nvram_checked("aoss_enable", "1"); %> /><% tran("share.enable"); %>&nbsp;
211<input class="spaceradio" type="radio" value="0" name="aoss_enable" <% nvram_checked("aoss_enable", "0"); %> /><% tran("share.disable"); %>
212</div>
213<div class="setting">
214<div class="label"><% tran("aoss.start"); %></div>
215<input type="button" class="aoss_enable" value="" onclick="<!-- to be defined -->">
216</div>
217</fieldset>
218
219<br />
220
221<fieldset>
222<legend><% tran("aoss.securitymodes"); %></legend>
223<div class="setting">
224<div class="label"><% tran("aoss.wpaaes"); %></div>
225<input type="checkbox" name="aoss_aes" value="0" checked></input>
226</div>
227<div class="setting">
228<div class="label"><% tran("aoss.wpatkip"); %></div>
229<input type="checkbox" name="aoss_tkip" value="0"></input>
230</div>
231<div class="setting">
232<div class="label"><% tran("aoss.wep"); %></div>
233<input type="checkbox" name="aoss_wep" value="0"></input>
234</div>
235</fieldset>
236
237<br />
238
239<fieldset>
240<legend><% tran("aoss.clients"); %></legend>
241<table class="center table" cellspacing="5">
242<tr>
243<th width="25%"><% tran("aoss.client_name"); %></th>
244<th width="20%"><% tran("share.mac"); %></th>
245<th width="20%"><% tran("aoss.security"); %></th>
246<th width="20%"><% tran("wl_basic.label"); %></th>
247<th width="15%"><% tran("aoss.connectivity"); %></th>
248</tr>
249
250<script type="text/javascript">
251//<![CDATA[
252
253var table = new Array(
254 "Nintendo DS","00:1c:4a:01:5f:63","WPA-PSK-TKIP","802.11b/g"
255,"Sony PS3","00:1c:4a:42:19:3d","WPA-PSK-AES","802.11b/g"
256
257);
258
259if (table.length == 0) {
260document.write("<tr><td colspan=\"11\" align=\"center\">" + share.none + "</td></tr>");
261}
262else {
263for (var i = 0; i < table.length; i = i + 4) {
264document.write("<tr>");
265document.write("<td>"+table[i]+"</td>");
266document.write("<td align=\"left\">"+table[i+1]+"</td>");
267document.write("<td align=\"right\">"+table[i+2]+"</td>");
268document.write("<td align=\"right\">"+table[i+3]+"</td>");
269document.write("<td align=\"left\"><select name=\"\"><option value=\"allow\">Allow</option><option value=\"deny\">Deny</option><option value=\"delete\">Delete</option></select></td>");
270document.write("<\/tr>");
271}
272}
273
274//]]>
275</script>
276
277</table>
278</fieldset>
279<!-- AOSS end -->
280<br />
281                               
282                                <div class="submitFooter">
283                                        <script type="text/javascript">
284                                                                        //<![CDATA[
285                                                                        submitFooterButton(1);
286                                                                        //]]>
287                                                                        </script>
288                                                                </div>
289                                                        </form>
290                                        </div>
291                                </div>
292                                <div id="helpContainer">
293                        <div id="help">
294                           <div><h2><% tran("share.help"); %></h2></div>
295                           <dl>
296                                 <dt class="term"><% tran("wpa.secmode"); %>:</dt>
297                                 <dd class="definition"><% tran("hwpa.right2"); %></dd>
298                           </dl><br />
299                           <a href="javascript:openHelpWindow<% ifdef("EXTHELP","Ext"); %>('HWPA.asp')"><% tran("share.more"); %></a>
300                        </div>
301                        </div>
302                        <div id="floatKiller"></div>
303                        <div id="statusInfo">
304                                <div class="info"><% tran("share.firmware"); %>:
305                                        <script type="text/javascript">
306                                        //<![CDATA[
307                                        document.write("<a title=\"" + share.about + "\" href=\"javascript:openAboutWindow()\"><% get_firmware_version(); %></a>");
308                                        //]]>
309                                        </script>
310                                </div>
311                                <div class="info"><% tran("share.time"); %>:  <span id="uptime"><% get_uptime(); %></span></div>
312                                <div class="info">WAN<span id="ipinfo"><% show_wanipinfo(); %></span></div>
313                                </div>
314                        </div>
315                </div>
316        </body>
317</html>
Note: See TracBrowser for help on using the repository browser.