http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / pppoe.html
index c44b629..6dff9b6 100755 (executable)
 <html>
    <head>
       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
+      <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
       <link rel="stylesheet" href='stylemain.css' type='text/css'>
          <link rel="stylesheet" href='colors.css' type='text/css'>
             <script language="javascript" src="util.js"></script>
+            <script language="javascript" src="encoder.js"></script>
             <script language="javascript">
-<!-- hide
+<!-- hide\r
+parent.helpframe.location.href="hlppppaccount.html";
+var randomNum = '<%ejGet(CheckNum)%>';
 var timeOut = '<%ejGet(pppTimeOut)%>';
 var onDemand = '<%ejGet(enblOnDemand)%>';
 var ipExtension = '<%ejGet(pppIpExtension)%>';
-var authMethod = '<%ejGet(pppAuthMethod)%>';
 var qs = '<%ejGet(quickSetup)%>';
-var auto = '<%ejGet(enblAutoScan)%>';
 var prtcl = '<%ejGetOther(memInfo, ntwkPrtcl)%>';
-var enblIpAddr = '<%ejGet(useStaticIpAddress)%>';
-var localIpAddr = '<%ejGet(pppLocalIpAddress)%>';
-var pppDebug = '<%ejGet(enblPppDebug)%>';
-
-function frmLoad() {
-   with ( document.forms[0] ) {
-      if (qs == '1')
-         showPppoe(auto);
-      else
-         showPppoe(0);
-      if ( onDemand == '1' ) {
-         enblOnDemand.checked = true;
-         hideOnDemandInfo(0);
-      } else {
-         enblOnDemand.checked = false;
-         hideOnDemandInfo(1);
-      }
-      if ( enblIpAddr == '1' ) {
-         enblPppIpAddress.checked = true;
-         hidePppIpAddressInfo(0);
-      } else {
-         enblPppIpAddress.checked = false;
-         hidePppIpAddressInfo(1);
-      }
-      
-      if ( ipExtension == '1' )
-         pppIpExtension.checked = true;
-      else
-         pppIpExtension.checked = false;
-      
-      if ( authMethod == '1' )
-         pppAuthMethod.selectedIndex = 2;
-      else if ( authMethod == '2' )
-         pppAuthMethod.selectedIndex = 3;
-      else if ( authMethod == '3' )
-         pppAuthMethod.selectedIndex = 4;
-      else
-         pppAuthMethod.selectedIndex = 1;
-
-      pppUserName.value = '<%ejGet(pppUserName)%>';
-      pppPassword.value = '<%ejGet(pppPassword)%>';
-      pppTimeOut.value = timeOut;
-      pppLocalIpAddress.value = localIpAddr;
-      if ( prtcl == 'PPPoE' && !(auto == '1' && qs == '1') )
-         pppServerName.value = '<%ejGet(pppServerName)%>';
-
-      if ( pppDebug == '1' )
-         enblPppDebug.checked = true;
-      else
-         enblPppDebug.checked = false;
-   }
-}
-
-function btnNext() {
-   var loc = 'enblservice.cgi?';
-
-   with ( document.forms[0] ) {
-      // validate user name
-      var len = pppUserName.value.length;
-      if ( len > 256 ) {
-         msg = 'The length of user name (' + len + ') is too long [0-256].';
-         alert(msg);
-         return;
-      }
-      // validate password
-      len = pppPassword.value.length;
-      if ( len > 32 ) {
-         msg = 'The length of password (' + len + ') is too long [0-32].';
-         alert(msg);
-         return;
-      }
-      // validate inactivity timeout
-      if ( enblOnDemand.checked == true ) {
-         if ( isNaN(parseInt(pppTimeOut.value)) == true ) {
-            msg = 'Inactivity Timeout "' + pppTimeOut.value + '" is invalid.';
-            alert(msg);
-            return;
-         }
-         timeOutNum = parseInt(pppTimeOut.value);
-         if ( timeOutNum < 1 || timeOutNum > 4320 ) {
-            msg = 'Inactivity Timeout "' + pppTimeOut.value + '" is out of range [1-4320].';
-            alert(msg);
-            return;
-         }
-      }
-      // validate ppp IP address
-      if ( enblPppIpAddress.checked == true ) {
-         if ( isValidIpAddress(pppLocalIpAddress.value) == false ) {
-            alert('Address "' + pppLocalIpAddress.value + '" is invalid IP address.');
-            return;
-         }
-      }
-      // validate authentication method
-      if ( pppAuthMethod.selectedIndex == 0 ) {
-         msg = 'No selection for authentication method.';
-         alert(msg);
-         return;
-      }
-      // validate server name
-      if ( prtcl == 'PPPoE' && !(auto == '1' && qs == '1') ) {
-         len = pppServerName.value.length;
-         if ( len > 32 ) {
-            msg = 'The length of PPP service (' + len + ') is too long [0-32].';
-            alert(msg);
-            return;
-         }
-      }
-
-      if ( qs == '1' ) {
-         if ( auto == '1' )
-            loc = 'pppauthinfo.cgi?';
-      } else
-         loc = 'enblservice.cgi?';
-
-      loc += 'pppUserName=' + encodeUrl(pppUserName.value);
-      loc += '&pppPassword=' + encodeUrl(pppPassword.value);
-      if ( enblOnDemand.checked == true ) {
-         loc += '&enblOnDemand=1';
-         loc += '&pppTimeOut=' + timeOutNum;
-      } else {
-         loc += '&enblOnDemand=0';
-         loc += '&pppTimeOut=' + timeOut;
-      }
-      if ( enblPppIpAddress.checked == true ) {
-         loc += '&useStaticIpAddress=1';
-         loc += '&pppLocalIpAddress=' + pppLocalIpAddress.value;
-      } else {
-         loc += '&useStaticIpAddress=0';
-         loc += '&pppLocalIpAddress=' + localIpAddr;
-      }
-      if ( pppIpExtension.checked == true )
-         loc += '&pppIpExtension=1&enblNat=0&enblFirewall=0';
-      else
-         loc += '&pppIpExtension=0&enblFirewall=1&enblNat=1';
-
-      var idx = pppAuthMethod.selectedIndex;
-      loc += '&pppAuthMethod=' + pppAuthMethod.options[idx].value;
-      if ( prtcl == 'PPPoE' && !(auto == '1' && qs == '1') )
-         loc += '&pppServerName=' + encodeUrl(pppServerName.value);
-
-      if ( enblPppDebug.checked == true )
-         loc += '&enblPppDebug=1';
-      else
-         loc += '&enblPppDebug=0';
-   }
-   var code = 'location="' + loc + '"';
-   eval(code);
-}
-
-function btnBack() {
-   var loc = 'ntwkprtcl.html';
-   if ( qs == '1' && auto == '1' )
-      loc = 'vpivci.html';
-
-   var code = 'location="' + loc + '"';
-   eval(code);
-}
-
-
-function showPppoe(show) {
-   var status = 'visible';
-   if ( show == 0 )
-      status = 'hidden';
-   if (document.getElementById)  // DOM3 = IE5, NS6
-      document.getElementById('pppoeSN').style.visibility = status;
-   else
-      document.all.pppoeSN.style.visibility = status;
-}
-
-function hideOnDemandInfo(hide) {
-   var status = 'visible';
-   if ( hide == 1 )
-      status = 'hidden';
-   if (document.getElementById)  // DOM3 = IE5, NS6
-      document.getElementById('pppInfo').style.visibility = status;
-   else {
-      if (document.layers) { // Netscape 4
-         if ( hide == 1 )
-            document.forms[0].pppTimeOut.value = '';
-         else
-            document.forms[0].pppTimeOut.value = '<%ejGet(pppTimeOut)%>';
-      } else  // IE 4
-         document.all.pppInfo.style.visibility = status;
-   }
-}
-
-function dialOnDemandClick(cb) {
-   if ( cb.checked == true )
-      hideOnDemandInfo(0);
-   else
-      hideOnDemandInfo(1);
-}
-
-function hidePppIpAddressInfo(hide) {
-   var status = 'visible';
-   if ( hide == 1 )
-      status = 'hidden';
-   if (document.getElementById)  // DOM3 = IE5, NS6
-      document.getElementById('pppIpAddressInfo').style.visibility = status;
-   else {
-      if (document.layers) { // Netscape 4
-         if ( hide == 1 )
-            document.forms[0].pppLocalIpAddress.value = '';
-         else
-            document.forms[0].pppLocalIpAddress.value = '<%ejGet(pppLocalIpAddress)%>';
-      } else  // IE 4
-         document.all.pppIpAddressInfo.style.visibility = status;
-   }
-}
-
-function pppIpAddressClick(cb) {
-   if ( cb.checked == true )
-      hidePppIpAddressInfo(0);
-   else
-      hidePppIpAddressInfo(1);
-}
-
-// done hiding -->
-</script>
-   </head>
-   <body onLoad='frmLoad()'>
-      <blockquote>
-         <form>
-            <b>PPP Username and Password</b><br>
-            <br>
-            PPP usually requires that you have a user name and password to establish your 
-            connection. In the boxes below, enter the user name and password that your ISP 
-            has provided to you.<br>
-            <br>
-            <div id='pppoeSN'>
-               <table border="0" cellpadding="0" cellspacing="0">
-                  <tr>
-                     <td width="150">PPPoE Service Name:</td>
-                     <td>
-                        <b><%ejGetOther(memInfo, pppoeServiceName)%></b>
-                     </td>
-                  </tr>
-                  <br>
-               </table>
-            </div>
-            <table border="0" cellpadding="0" cellspacing="0">
-               <tr>
-                  <td>PPP Username:&nbsp;&nbsp;</td>
-                  <td><input type='text' name='pppUserName'></td>
-               </tr>
-               <tr>
-                  <td>PPP Password:&nbsp;&nbsp;</td>
-                  <td><input type='password' name='pppPassword'></td>
-               </tr>
-<script language="javascript">
-<!-- hide
-if ( prtcl == 'PPPoE' && !(auto == '1' && qs == '1') ) {
-   document.writeln("               </tr>");
-   document.writeln("                  <td>PPPoE Service Name:&nbsp;&nbsp;</td>");
-   document.writeln("                  <td><input type='text' name='pppServerName'></td>");
-   document.writeln("               </tr>");
-}
-// done hiding -->
-</script>
-               <tr>
-                  <td>Authentication Method:&nbsp;&nbsp;</td>
-                  <td><select name='pppAuthMethod' size="1">
-                        <option value="-1">
-                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
-                        <option value="0">AUTO
-                        <option value="1">PAP
-                        <option value="2">CHAP
-                        <option value="3">MSCHAP
-                     </select></td>
-               </tr>
-            </table>
-              <br>
-              <table border="0" cellpadding="0" cellspacing="0">
-                <tr>
-                  <td width='30' height="30"><input type='checkbox' name='enblOnDemand' onClick='dialOnDemandClick(this)'></td>
-                  <td>Dial on demand (with idle timeout timer)</td>
-                </tr>
-              </table>
-            <div id='pppInfo'>
-            <table border="0" cellpadding="0" cellspacing="0">
-              <tr>
-                <td>Inactivity Timeout (minutes) [1-4320]:&nbsp;&nbsp;</td>
-                <td><input type='text' name='pppTimeOut'></td>
-              </tr>
-            </table>
-            <br>
-            </div>
-            <table border="0" cellpadding="0" cellspacing="0">
-              <tr>
-                <td width='30' height="30"><input type='checkbox' name='pppIpExtension'></td>
-                <td>PPP IP extension</td>
-              </tr>
-              </table>
-              <table border="0" cellpadding="0" cellspacing="0">
-              <tr>
-                <td width='30' height="30"><input type='checkbox' name='enblPppIpAddress' onClick='pppIpAddressClick(this)'></td>
-                <td>Use Static IP Address</td>
-              </tr>
-            </table>
-            <div id='pppIpAddressInfo'>
-              <table border="0" cellpadding="0" cellspacing="0"">
-              <tr>
-                <td width="140">IP Address:&nbsp;&nbsp;</td>
-                <td><input type='text' name='pppLocalIpAddress'></td>
-              </tr>
-            </table>
-            <br>
-            </div>
-            <table border="0" cellpadding="0" cellspacing="0">
-              <tr>
-                <td width='30' height="30"><input type='checkbox' name='enblPppDebug'></td>
-                <td>Enable PPP Debug Mode</td>
-              </tr>
-            </table>
-            <br>
-            <br>
-            <center>
-               <input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'>
-            </center>
-         </form>
-      </blockquote>
-   </body>
-</html>
+var service = '<%ejGet(serviceName)%>';
+var vpi = '<%ejGet(atmVpi)%>';
+var vci = '<%ejGet(atmVci)%>';
+var buildPppSuffix = '<%ejGet(buildPppSuffix)%>';
+
+function frmLoad() {\r
+       with ( document.forms[0] ) {\r
+       if (ipExtension == '1'){\r
+               radio1[0].checked=true;\r
+               timeout.disabled=true;\r
+               timeout2.disabled=true;\r
+               radio1[1].disabled=true;\r
+               radio1[2].disabled=true;\r
+       } else {\r
+               if ( onDemand == '2' ) {\r
+                       radio1[2].checked=true;\r
+                       timeout.disabled=true;\r
+               } else if ( onDemand == '1' ) {\r
+                       radio1[1].checked=true;\r
+                       timeout2.disabled=true;\r
+               } else {\r
+                       radio1[0].checked=true;\r
+                       timeout.disabled=true;\r
+                       timeout2.disabled=true;\r
+               }\r
+       }\r
+\r
+       pppUserName.value = '<%ejGet(pppUserName)%>';
+               pppPassword.value = base64Decode('<%ejGet(pppPassword)%>');\r
+       timeout.value = timeOut;\r
+       timeout2.value = timeOut;\r
+\r
+       if ( service == '' ) {\r
+               switch ( prtcl ) {\r
+                       case 'PPPoE':\r
+                       service = 'pppoe_' + vpi + '_' + vci;\r
+               break;\r
+                       case 'PPPoA':\r
+                       service = 'pppoa_' + vpi + '_' + vci;\r
+               break;\r
+                       case 'MER':\r
+                       service = 'mer_' + vpi + '_' + vci;\r
+               break;\r
+                       case 'IPoA':\r
+                       service = 'ipoa_' + vpi + '_' + vci;\r
+               break;\r
+                       case 'Bridge':\r
+                       service = 'br_' + vpi + '_' + vci;\r
+               break;\r
+               }\r
+       }\r
+   }\r
+\r
+}\r
+function chradio(){\r
+   with ( document.forms[0] ) {\r
+     if(radio1[0].checked==true || radio1[2].checked==true)\r
+       timeout.disabled=true;\r
+     else\r
+       timeout.disabled=false;\r
+\r
+     if(radio1[0].checked==true || radio1[1].checked==true)\r
+       timeout2.disabled=true;\r
+     else\r
+       timeout2.disabled=false;\r
+  }\r
+}\r
+\r
+function btnNext() {\r
+   var loc = 'lancfg.cgi?';\r
+   loc += 'checkNum=' + randomNum + '&';\r
+\r
+   with ( document.forms[0] ) {\r
+      if ( qs == '0' )\r
+        loc = 'ntwksum2.cgi?';  // for advance setup\r
+\r
+      loc += 'checkNum=' + randomNum + '&';\r
+      //loc += 'pppUserName=' + encodeUrl(pppUserName.value);\r
+      loc += 'pppUserName=' + base64Encode(pppUserName.value);\r
+      if(urlError1==1) return;\r
+      //loc += '&pppPassword=' + encodeUrl(pppPassword.value);\r
+      loc += '&pppPassword=' + base64Encode(pppPassword.value);\r
+      if(urlError1==1) return;\r
+\r
+      if ( radio1[2].checked == true ) {\r
+         loc += '&enblOnDemand=2';\r
+         if ( isNaN(parseInt(timeout2.value))== true || parseInt(timeout2.value)<0 ) {\r
+            alert("PPP TimeOut is invalid.");\r
+            return;\r
+         }\r
+         loc += '&pppTimeOut=' + timeout2.value;\r
+      } else if ( radio1[1].checked == true ) {\r
+         loc += '&enblOnDemand=1';\r
+         if ( isNaN(parseInt(timeout.value))== true || parseInt(timeout.value)<0 ) {\r
+            alert("PPP TimeOut is invalid.");\r
+            return;\r
+         }\r
+         loc += '&pppTimeOut=' + timeout.value;\r
+      } else {\r
+         loc += '&enblOnDemand=0';\r
+      }\r
+\r
+      // Firewall are always enabled for PPPoE and PPPoA\r
+      loc += '&enblAuto=1';\r
+      loc += '&enblFirewall=1';      \r
+      loc += '&serviceName=' + encodeUrl(service);\r
+      if(urlError==1) return;\r
+   }\r
+       var code = 'window.location.href="/'; // for Mac safari browser compatibility\r
+       code += loc + '"';\r
+       eval(code);\r
+}\r
+\r
+function btnBack() {\r
+       var loc = 'unnumppp.html';\r
+       var code = 'window.location.href="/'; // for Mac safari browser compatibility\r
+       code += loc + '"';\r
+       eval(code);\r
+}\r
+\r
+// done hiding -->\r
+      </script>\r
+   </head>\r
+   <body onLoad='frmLoad()'>\r
+\r
+         <form class="formpadding">\r
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>
+  <td><b><font class="netgear">Configure Internet Connection - PPP User Name and Password</font></b></td>
+</tr>
+<tr><td>&nbsp;</td></tr>
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>
+            \r
+            <table border="0" cellpadding="0" cellspacing="0"><tr>\r
+\r
+            <td width="592">\r
+            In order to establish the Internet connection, please enter PPP user name and password that your ISP has provided.\r
+            </td>\r
+            </tr></table>\r
+            <br><br>\r
+            <table border="0" cellpadding="0" cellspacing="0">\r
+               <tr>\r
+                  <td width="150">PPP User Name :\r
+                  </td>\r
+                  <td nowrap><input type='text' name='pppUserName' size='40' maxlength="64"></td>\r
+\r
+               </tr>\r
+               <tr>\r
+                  <td>PPP Password:\r
+                  </td>\r
+                  <td>\r
+<script language="javascript">\r
+<!--\r
+if("<%ejGet(pppPassword)%>" == "")\r
+       document.writeln('<input type="text" name="pppPassword" size="40" maxlength="64">');\r
+else\r
+       document.writeln('<input type="password" name="pppPassword" size="40" maxlength="64">');\r
+-->\r
+</script>\r
+                  </td>\r
+               </tr>\r
+            </table>\r
+\r
+            <br>\r
+            <table border="0" cellpadding="0" cellspacing="0" width="510">\r
+                <tr>\r
+                   <td width="150" rowspan="5" valign="top">Session established by:</td>\r
+                   <td width="30"><input type='radio' name='radio1' onClick="chradio()"></td>\r
+                   <td width="322">Always On</td>\r
+                </tr>\r
+                <tr>\r
+\r
+                   <td rowspan="2" valign="top" width="30"><input type='radio' name='radio1' onClick="chradio()"></td>\r
+                   <td width="322" >Dial on Demand</td>\r
+                </tr>\r
+                <tr>\r
+                   <td width="322">Disconnect if no activity for \r
+                   <input type='text' name='timeout' size="11"> minutes</td>\r
+                </tr>\r
+                <tr>\r
+\r
+                   <td rowspan="2" valign="top" width="30"><input type='radio' name='radio1' onClick="chradio()"></td>\r
+                   <td width="322" >Manually Connect</td>\r
+                </tr>\r
+                <tr>\r
+                   <td width="322">Disconnect if no activity for \r
+                   <input type='text' name='timeout2' size="11"> minutes</td>\r
+                </tr>\r
+            </table>  \r
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>\r
+            <table width="520"><tr>\r
+               <td align="right"><input type='button' onClick='btnBack()' value='< Back'>&nbsp;<input type='button' onClick='btnNext()' value='Next >'></td>\r
+            </tr></table>\r
+         </form>\r
+\r
+   </body>\r
+</html>
\ No newline at end of file