www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / todadd.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation
4 -->
5 <html>
6 <head>
7         <title></title>
8
9         <link href="usr_main.css" rel="stylesheet" type="text/css">
10         <link href="usr_menus.css" rel="stylesheet" type="text/css"><script src="usr_menus.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11         <script src="usr_common.js" type="text/javascript"></script>
12
13         <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14         
15         <script src="util.js" type="text/javascript"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWlJS(wlInterface)%>");
19
20 function btnApply(place)
21 {
22         var macUsed = document.forms[0].cusMac.value;
23    if (document.forms[0].radioMac[0].checked)
24       macUsed = "<%ejGetOther(memInfo, pcMacAddr)%>";
25
26   var loc = place + '?action=add&';
27   
28   if ( place == "todmngr.tod" ) {
29     with ( document.forms[0] ) {
30       if ( username.value == '' ) {
31         alert( 'Please enter a name for the Internet access rule.' );
32       } else if ( isValidName(username.value) == false ) {
33         alert( 'The rule name is invalid. Only alphanumeric characters (a-z, A-Z, and 0-9) are permitted.' );
34       } else if ( macUsed == '' ) {
35         alert( 'Please enter a MAC address.' );
36       } else if ( isValidMacAddress( macUsed ) == false ) {
37         alert( macUsed + " is an invalid MAC address." );
38       } else {
39         loc += "username="+username.value+"&mac="+macUsed;
40
41         days = 0;
42
43         if( monday.checked )
44           days = 1;
45
46         if( tuesday.checked )
47           days |= 2;
48
49         if( wednesday.checked )
50           days |= 4;
51
52         if( thursday.checked )
53           days |= 8;
54
55         if( friday.checked )
56           days |= 16;
57
58         if( saturday.checked )
59           days |= 32;
60
61         if( sunday.checked )
62           days |= 64;
63
64         if( days == 0 ) {
65           alert("No weekdays were specified.");
66           return;
67         }
68
69         loc += "&days=" + days;
70
71         loc += '&start_time=';
72         if( startTime.value.length ) {
73           vals = startTime.value.split( ':' );
74           if ( vals.length == 2 ) {
75             hour = eval( vals[0] );
76             min = eval( vals[1] );
77             if( hour < 0 || hour > 23 ) {
78               alert( startTime.value + " is an invalid time. Please enter an hour between 0 and 23, inclusive." );
79               return;
80             }
81             if( min < 0 || min > 59 ) {
82               alert( startTime.value + " is an invalid time. The seconds must be between 0 and 59, inclusive." );
83             }
84             st_time = hour * 60 + min;
85           } else {
86             alert( startTime.value + " is an invalid time. Please enter a time between 0:00 and 23:59, inclusive." );
87             return;
88           }
89         } else {
90           st_time = 0; // 00:00
91         }
92         loc += st_time;
93
94         loc += '&end_time=';
95         if(endTime.value.length ) {
96           vals = endTime.value.split( ':' );
97           if ( vals.length == 2 ) {
98             hour = eval( vals[0] );
99             min = eval( vals[1] );
100             if( hour < 0 || hour > 23 ) {
101               alert( endTime.value + " is an invalid time. Please enter an hour between 0 and 23, inclusive." );
102               return;
103             }
104             if( min < 0 || min > 59 ) {
105               alert( endTime.value + " is an invalid time. The seconds must be between 0 and 59, inclusive." );
106               return;
107             }
108             en_time = hour* 60 + min;
109           } else {
110             alert( endTime.value + " is an invalid time. Please enter a time between 0:00 and 23:59, inclusive." );
111             return;
112           }
113         } else {
114           en_time = 1439; // 23:59
115         }
116         loc += en_time;
117
118         if( en_time < st_time ) {
119           alert( "The stop time must be after the start time. The times are in 24-hour format (0:00 to 23:59).");
120           return;
121         }
122         var code = 'location = "' + loc + '"';
123         if("<%ejGetSntp(ntp_enabled)%>" != "1")
124           alert("The control will not work correctly without the device's time being set. Please set it on the Time page.");
125         eval(code);
126       }
127     }
128   }
129 }
130         // done hiding -->
131         </script>
132 </head>
133 <body onload="initMenu();">
134
135 <script type="text/javascript">
136         writeHeader("Internet Access Control", "<%ejGetJS(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWlJS(wlInterface)%>", <%ejGetJS(enblQos)%>);
137 </script>
138
139 <form>
140         <p>Use this page to specify when you do not want certain network devices to be
141         able to access the Internet.
142         You can select the days of the week and the times during those days during which
143         the router will <b>prevent</b> certain network devices from accessing the Internet.</p>
144
145         <p><label for="username">Rule name:</label> <input type="text" name="username" id="username" size="18" maxlength="50"></p>
146
147         <h4>Network Device</h4>
148         <p>Specify which network device this rule will apply to.</p>
149         <p>&ldquo;This client device&rdquo; is the network device being used to access the router.
150         To restrict a different network device, select
151         &ldquo;Other network device&rdquo; and enter the MAC address of the other network device.
152         To find out the MAC address on Windows XP or 2000, open a command prompt and
153         type <b>ipconfig /all</b> (on Windows Me or 9x, type <b>winipcfg /all</b>) and press Enter.</p>
154    <table border="0">
155       <tr>
156          <td colspan="2">
157             <input type="radio" name="radioMac" id="radioMac1" checked> <label for="radioMac1">This client device (<%ejGetOther(memInfo, pcMacAddr)%>)</label>
158          </td>
159       </tr>
160       <tr>
161          <td>
162             <input type="radio" name="radioMac" id="radioMac2"> <label for="radioMac2">Other network device:</label>
163                         </td>
164          <td><input type='text' size="20" maxlength="18" name="cusMac" id="cusMac">  (xx:xx:xx:xx:xx:xx)</td>
165       </tr>
166    </table>
167
168         <h4>Weekdays</h4>
169         <p>These are the weekdays when the time range below is effective.</p>
170    <table border="1" cellspacing="0">
171       <thead><tr>
172          <th><label for="monday">Monday</label></th>
173          <th><label for="tuesday">Tuesday</label></th>
174          <th><label for="wednesday">Wednesday</label></th>
175          <th><label for="thursday">Thursday</label></th>
176          <th><label for="friday">Friday</label></th>
177          <th><label for="saturday">Saturday</label></th>
178          <th><label for="sunday">Sunday</label></th>
179       </tr></thead>
180       <tr>
181          <td align="center"><input type="checkbox" name="monday" id="monday"></td>
182          <td align="center"><input type="checkbox" name="tuesday" id="tuesday"></td>
183          <td align="center"><input type="checkbox" name="wednesday" id="wednesday"></td>
184          <td align="center"><input type="checkbox" name="thursday" id="thursday"></td>
185          <td align="center"><input type="checkbox" name="friday" id="friday"></td>
186          <td align="center"><input type="checkbox" name="saturday" id="saturday"></td>
187          <td align="center"><input type="checkbox" name="sunday" id="sunday"></td>
188       </tr>
189    </table>
190
191         <h4>Daily Time Range</h4>
192         <p>This is the time range during which the network device will not be able to access the Internet.
193         Please note that the times are in 24-hour format and must be between 0:00 and 23:59, inclusive.
194         </p>
195    <table border="0">
196       <tr>
197          <td><label for="startTime">Start time:</label></td>
198          <td><input type="text" size="5" name="startTime" id="startTime"> (hh:mm)</td>
199       </tr>
200       <tr>
201          <td><label for="endTime">End time:</label></td>
202          <td><input type="text" size="5" name="endTime" id="endTime"> (hh:mm)</td>
203       </tr>
204    </table>
205
206         <p><input type="button" value="Save" onClick="btnApply('todmngr.tod');"></p>
207 </form>
208
209 <script type="text/javascript">
210         writeFooter();
211 </script>
212
213 </body>
214 </html>