add added files
[bcm963xx.git] / userapps / broadcom / cfm / html / pppoe.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         <script src="usr_menus.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 type="text/javascript" src="util.js"></script>
16         <script type="text/javascript">
17 <!-- hide
18 setPageTitle("<%ejGetWl(wlInterface)%>");
19
20 var timeOut = '<%ejGet(pppTimeOut)%>';
21 var onDemand = '<%ejGet(enblOnDemand)%>';
22 var ipExtension = '<%ejGet(pppIpExtension)%>';
23 var authMethod = '<%ejGet(pppAuthMethod)%>';
24 var qs = '<%ejGet(quickSetup)%>';
25 var auto = '<%ejGet(enblAutoScan)%>';
26 var prtcl = '<%ejGetOther(memInfo, ntwkPrtcl)%>';
27
28 function frmLoad() {
29    with ( document.forms[0] ) {
30       if (qs == '1')
31          showPppoe(auto);
32       else
33          showPppoe(0);
34       if ( onDemand == '1' ) {
35          enblOnDemand.checked = true;
36          hideInfo(0);
37       } else {
38          enblOnDemand.checked = false;
39          hideInfo(1);
40       }
41
42       if ( ipExtension == '1' )
43          pppIpExtension.checked = true;
44       else
45          pppIpExtension.checked = false;
46
47       if ( authMethod == '1' )
48          pppAuthMethod.selectedIndex = 1;
49       else if ( authMethod == '2' )
50          pppAuthMethod.selectedIndex = 2;
51       else if ( authMethod == '3' )
52          pppAuthMethod.selectedIndex = 3;
53       else
54          pppAuthMethod.selectedIndex = 0;
55
56       pppUserName.value = '<%ejGet(pppUserName)%>';
57       pppPassword.value = '<%ejGet(pppPassword)%>';
58       pppTimeOut.value = timeOut;
59       if ( prtcl == 'PPPoE' ) {
60          pppServerName.value = '<%ejGet(pppServerName)%>';
61          pppMTU.value = '<%ejGet(pppoeMTU)%>';
62       } else
63          pppMTU.value = '<%ejGet(pppMTU)%>';
64    }
65 }
66
67 function btnNext() {
68    with ( document.forms[0] ) {
69       // USR9108
70       if (!validateUsername(pppUserName))
71           return;
72
73       // validate inactivity timeout
74       if ( enblOnDemand.checked == true ) {
75          if ( isNaN(parseInt(pppTimeOut.value)) )
76          {
77             msg = 'Inactivity timeout "' + pppTimeOut.value + '" must be a number.';
78             alert(msg);
79             return;
80          }
81          timeOutNum = parseInt(pppTimeOut.value);
82          if ( timeOutNum < 1 || timeOutNum > 4320 )
83          {
84             alert('The inactivity timeout "' + pppTimeOut.value + '" must be between 1 and 4,320, inclusive.');
85             return;
86          }
87       }
88       // validate authentication method
89       if ( pppAuthMethod.selectedIndex < 0 ) {
90          msg = 'No selection for authentication method.';
91          alert(msg);
92          return;
93       }
94
95            var loc = 'enblservice.cgi?';
96       if ((qs == '1') && (auto == '1'))
97                         loc = 'pppauthinfo.cgi?';
98
99       loc += 'pppUserName=' + encodeUrl(pppUserName.value);
100       loc += '&pppPassword=' + encodeUrl(pppPassword.value);
101       loc += '&pppMTU=' + pppMTU.value;
102       if ( enblOnDemand.checked == true ) {
103          loc += '&enblOnDemand=1';
104          loc += '&pppTimeOut=' + timeOutNum;
105       } else {
106          loc += '&enblOnDemand=0';
107          loc += '&pppTimeOut=' + timeOut;
108       }
109       if ( pppIpExtension.checked == true )
110          loc += '&pppIpExtension=1&enblNat=0&enblFirewall=0';
111       else
112          loc += '&pppIpExtension=0&enblFirewall=1&enblNat=1';
113
114       var idx = pppAuthMethod.selectedIndex;
115       loc += '&pppAuthMethod=' + pppAuthMethod.options[idx].value;
116       if ( prtcl == 'PPPoE' )
117          loc += '&pppServerName=' + encodeUrl(pppServerName.value);
118    }
119
120    var code = 'location.assign("' + loc + '")';
121    eval(code);
122 }
123
124 function btnBack() {
125    var loc = 'ntwkprtcl.html';
126    if ( qs == '1' && auto == '1' )
127       loc = 'vpivci.html';
128
129    var code = 'location.assign("' + loc + '")';
130    eval(code);
131 }
132
133
134 function showPppoe(show) {
135    var status = 'visible';
136    if ( show == 0 )
137       status = 'hidden';
138    if (document.getElementById)  // DOM3 = IE5, NS6
139       document.getElementById('pppoeSN').style.visibility = status;
140    else
141       document.all.pppoeSN.style.visibility = status;
142 }
143
144 function hideInfo(hide) {
145    var status = 'visible';
146    if ( hide == 1 )
147       status = 'hidden';
148    if (document.getElementById)  // DOM3 = IE5, NS6
149       document.getElementById('pppInfo').style.visibility = status;
150    else {
151       if (document.layers) { // Netscape 4
152          if ( hide == 1 )
153             document.forms[0].pppTimeOut.value = '';
154          else
155             document.forms[0].pppTimeOut.value = '<%ejGet(pppTimeOut)%>';
156       } else  // IE 4
157          document.all.pppInfo.style.visibility = status;
158    }
159 }
160
161 function cbClick(cb) {
162    if (cb.checked)
163       hideInfo(0);
164    else
165       hideInfo(1);
166 }
167
168 // done hiding -->
169 </script>
170 </head>
171 <body onload="initMenu('idMenu'); frmLoad();">
172
173 <script type="text/javascript">
174         writeHeader("PPP User Name and Password", "<%ejGet(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWl(wlInterface)%>", <%ejGet(enblQos)%>);
175 </script>
176
177 <p>PPP usually requires that you have a user name and password to establish your
178 Internet connection. Please enter the user name and password your ISP provided.</p>
179
180 <form>
181    <div id='pppoeSN'>
182       <table border="0" cellpadding="0" cellspacing="0">
183          <tr>
184             <td><label for="">PPPoE service name:</td>
185             <td>
186                <b><%ejGetOther(memInfo, pppoeServiceName)%></b>
187             </td>
188          </tr>
189          <br>
190       </table>
191    </div>
192    <table border="0" cellpadding="0" cellspacing="0">
193       <tr>
194          <td><label for="pppUserName">User name:</label></td>
195          <td><input type='text' name='pppUserName' id='pppUserName' maxlength="256"></td>
196       </tr>
197       <tr>
198          <td><label for="pppPassword">Password:</label></td>
199          <td><input type='text' name='pppPassword' id='pppPassword' maxlength="32"></td>
200       </tr>
201 <script type="text/javascript">
202 <!-- hide
203 if ( prtcl == 'PPPoE' ) {
204    document.writeln("               <tr>");
205    document.writeln("                 <td><label for='pppServerName'>PPPoE service name:</label></td>");
206    document.writeln("                 <td><input type='text' name='pppServerName' id='pppServerName' maxlength=\"32\"></td>");
207    document.writeln("               </tr>");
208 }
209 // done hiding -->
210 </script>
211         <tr>
212         <td><label for="">Authentication method:</label></td>
213         <td><select name='pppAuthMethod' id='pppAuthMethod'>
214               <option value="0">Automatic</option>
215               <option value="1">PAP</option>
216               <option value="2">CHAP</option>
217               <option value="3">MSCHAP</option>
218            </select></td>
219         </tr>
220 </table>
221
222         <p><label for="pppMTU">MTU:</label> <input type='text' name='pppMTU' id='pppMTU' maxlength='4' size='10'> bytes (PPPoE: 1-1492, PPPoA: 1-1500)</p>
223
224         <p>
225                 <input type='checkbox' name='enblOnDemand' id='enblOnDemand' onClick='cbClick(this)'>
226                         <label for="enblOnDemand">Dial on demand (with idle timeout timer)</label>
227
228                 <div id='pppInfo'>
229                         <label for="pppTimeOut">Inactivity timeout:</label> <input type='text' name='pppTimeOut' id='pppTimeOut'> minutes (1-4320)
230                 </div>
231         </p>
232
233         <p><input type='checkbox' name='pppIpExtension' id='pppIpExtension'> <label for="pppIpExtension">PPP IP extension</label></p>
234
235         <p><input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'></p>
236 </form>
237
238 <script type="text/javascript">
239         writeFooter();
240 </script>
241
242 </body>
243 </html>