http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / tr69cfg.html
index 96354e0..971fabe 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
+parent.helpframe.location.href="hlptr069.html";
+var randomNum = '<%ejGet(CheckNum)%>';
+
+var state = '<%ejGet(lanRefresh)%>';
+if ( state == '1' ) {
+       var code = 'window.location.href="/tr69cRefresh.cgi?lanRefresh=0&checkNum=<%ejGet(CheckNum)%>"';
+       eval(code);
+}
+
+var tr69AcsUrl = '<%ejGet(tr69cAcsURL)%>';
+var tr69cAcsPwd = '<%ejGet(tr69cAcsPwd)%>';
+var tr69cConnReqPwd = '<%ejGet(tr69cConnReqPwd)%>';
+var tr69cAcsUser = '<%ejGet(tr69cAcsUser)%>';
+var tr69cConnReqUser = '<%ejGet(tr69cConnReqUser)%>';
+var tr69cInformEnable = '<%ejGet(tr69cInformEnable)%>';
+var tr69cInformInterval = '<%ejGet(tr69cInformInterval)%>';
+
+var tr69cIface='<%ejGet(tr69cIfName)%>';
+var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
+
+function viewCA(){\r
+  window.open("viewTrustCA.html","","width=750, height=600, scrollbars=yes");\r
+}
+
+function sntpcfg(){
+       var loc = 'sntpcfg.html';\r
+       var code = 'window.location.href="/'; // for Mac safari browser compatibility\r
+       code += loc + '"';\r
+       eval(code);
+}
+
+function setIfc() {
+var selectlen;
+       with ( document.forms[0] ) {
+               selectlen=ifName.length;
+               for(i=0 ; i<selectlen ; i++) {   //delete old options
+                       ifName.selectedIndex=0;
+                       ifName.remove(ifName.selectedIndex);
+               }
+       var interfaces = interfaceInfo.split('|');
+       for ( i = 0; i < interfaces.length; i++ ) {
+               var names = interfaces[i].split('/');
+               if(names[0].indexOf("br") == -1 && names[0] != '') {
+                       objOption= new Option(names[0],names[1],false,false);
+                       document.getElementById("ifName").options[document.getElementById("ifName").length] = objOption;
+               }
+               }
+    }
+}
+
+function getifcIndex() {
+       var ret=0;
+       with ( document.forms[0] ) {
+               for ( i = 0; i < document.getElementById("ifName").length; i++) {
+                       if( tr69cIface ==  document.getElementById("ifName").options[i].value ) {
+                               document.getElementById("ifName").options[i].selected=true;
+                               ret = i;
+                               break;
+                       }
+               }
+       }
+       return ret;
+}
 
 function frmLoad() {
+       //setIfc();
    with ( document.forms[0] ) {
-      acsURL.value = '<%ejGet(tr69cAcsURL)%>';
-      acsUser.value = '<%ejGet(tr69cAcsUser)%>';
-      acsPwd.value = '<%ejGet(tr69cAcsPwd)%>';
-      connReqUser.value = '<%ejGet(tr69cConnReqUser)%>';
-      connReqPwd.value = '<%ejGet(tr69cConnReqPwd)%>';
-      enblInform = '<%ejGet(tr69cInformEnable)%>';
-      if ( enblInform == '1' )
+       //ifName.selectedIndex = getifcIndex();
+       if(tr69AcsUrl.indexOf("https://") == 0){
+               withSSL[1].checked = true;
+               chgURL(1);
+       }else{
+               withSSL[0].checked = true;
+               chgURL(0);
+       }
+      
+      acsUser.value = tr69cAcsUser;
+      acsPwd.value = base64Decode(tr69cAcsPwd);
+      connReqUser.value = tr69cConnReqUser;
+      connReqPwd.value = base64Decode(tr69cConnReqPwd);
+      enblInform = tr69cInformEnable;
+      if ( enblInform == '1' ){
          inform[1].checked = true;
-      else
+         showInterval(1);
+      }else{
          inform[0].checked = true;
-      informInterval.value = '<%ejGet(tr69cInformInterval)%>';
+         showInterval(0);
+      }
          
    }
+       if (<%ejGet(changeset)%> == 1){
+               parent.footerfrm.location.href="footer.html";
+       }
 }
 
+function btnGet() {\r
+       var loc = 'tr69get.cgi?';
+       loc += 'checkNum=' + randomNum;\r
+   \r
+       var code = 'window.location.href="/';
+       code += loc + '"';
+       eval(code);     \r
+}\r
+
 function btnApply() {
    var loc = 'tr69cfg.cgi?';
+   loc += 'checkNum=' + randomNum + '&';
    with ( document.forms[0] ) {
+               //loc +='tr69cIfName='+ifName.options[ifName.selectedIndex].value;
+       
       if (acsURL.value == '') {
-         alert('ACS URL is required.');
+       if(withSSL[1].checked == true){
+         alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 248 characters.');
          return;
+        }else{
+         alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 249 characters.');
+         return;
+        }
       }
-      if ( inform[1].checked == true ) 
+      
+      //if(acsUser.value == tr69cAcsUser && acsPwd.value == base64Decode(tr69cAcsPwd) && connReqUser.value == tr69cConnReqUser
+       //&& connReqPwd.value == base64Decode(tr69cConnReqPwd) && ((tr69cInformEnable == '1' && inform[1].checked == true) || (tr69cInformEnable == '0' && inform[0].checked == true))){
+               //}
+      
+      if ( inform[1].checked == true ){
          loc += 'tr69cInformEnable=1';
-         else
+         if(isNaN(informInterval.value)){
+               alert("Periodic Transmision Interval of Inform Request is invalid. The valid range is from 1 to 4294967295.");
+               return;
+         }
+         if(parseInt(informInterval.value) < 1 || parseInt(informInterval.value) > 4294967295){
+               alert("Periodic Transmision Interval of Inform Request is invalid. The valid range is from 1 to 4294967295.");
+               return;
+         }
+         loc += '&tr69cInformInterval=' + informInterval.value;
+         }else
          loc += 'tr69cInformEnable=0';
 
-      loc += '&tr69cInformInterval=' + informInterval.value;
+      if(withSSL[1].checked == true){
+               if (acsURL.value.length + "https://".length > 256) {
+         alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 248 characters.');
+         return;
+       }
 
-      if (acsURL.value.length > 256) {
-         alert('The length of ACS URL (' + acsURL.value.length + ') is too long [1-256].');
+       var tmpUrl = 'https://' + acsURL.value;
+       loc += '&tr69cAcsURL=' + base64Encode(tmpUrl);
+               
+      }else{
+       if (acsURL.value.length + "http://".length > 256) {
+         alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 249 characters.');
          return;
+       }
+       
+       var tmpUrl = 'http://' + acsURL.value;
+       loc += '&tr69cAcsURL=' + base64Encode(tmpUrl);
+       
       }
-      loc += '&tr69cAcsURL=' + encodeUrl(acsURL.value);
       
       if (acsUser.value.length > 256) {
-         alert('The length of ACS user name (' + acsUser.value.length + ') is too long [0-256].');
+         alert('Inputted ACS user name is invalid. Valid length of ACS user name is from 0 to 256 characters.');
          return;
       }
-      loc += '&tr69cAcsUser=' + encodeUrl(acsUser.value);
-      
+      loc += '&tr69cAcsUser=' + base64Encode(acsUser.value);
+               if(urlError1==1)
+               return;
+                     
       if (acsPwd.value.length > 256) {
-         alert('The length of sysName (' + acsPwd.value.length + ') is too long [0-256].');
+         alert('Inputted ACS password is invalid. Valid length of ACS password is from 0 to 256 characters.');
          return;
       }
-      loc += '&tr69cAcsPwd=' + encodeUrl(acsPwd.value);
-      
+      loc += '&tr69cAcsPwd=' + base64Encode(acsPwd.value);
+       if(urlError1==1)
+               return;
+                     
       if (connReqUser.value.length > 256) {
-         alert('The length of connection request user name (' + connReqUser.value.length + ') is too long [0-256].');
+         alert('Inputted Connection Request user name is invalid. Valid length of Connection Request user name is from 0 to 256 characters.');
          return;
       }
-      loc += '&tr69cConnReqUser=' + encodeUrl(connReqUser.value);
-      
+      loc += '&tr69cConnReqUser=' + base64Encode(connReqUser.value);
+       if(urlError1==1)
+               return;
+                     
       if (connReqPwd.value.length > 256) {
-         alert('The length of connection request password (' + connReqPwd.value.length + ') is too long [0-256].');
+         alert('Inputted Connection Request password is invalid. Valid length of Connection Request password is from 0 to 256 characters.');
          return;
       }
-      loc += '&tr69cConnReqPwd=' + encodeUrl(connReqPwd.value);
+      loc += '&tr69cConnReqPwd=' + base64Encode(connReqPwd.value);
+       if(urlError1==1)
+               return;
    }
    
-   var code = 'location="' + loc + '"';
-   eval(code);
+       var code = 'window.location.href="/';
+       code += loc + '"';
+       eval(code);
 }
 
-function btnGet() {
-   var loc = 'tr69get.cgi';
-   
-   var code = 'location="' + loc + '"';
-   eval(code);
+function chgURL(ssl){
+  with ( document.forms[0] ) {
+       if(ssl == 1){
+               document.getElementById('acs').innerHTML =
+                       '<table border="0" cellpadding="0" cellspacing="5">'+
+                       '<tr>'+
+                       '<td width="186">ACS URL Address:</td>'+
+                       '<td width="36">https://</td>'+
+                       '<td colspan="2"><input type="text" name="acsURL" size="60" maxlength="248"></td>'+
+                       '</tr>'+
+                       '<table>';
+               
+               document.getElementById('trustCA').innerHTML = 
+                       '<table border="0" cellpadding="0" cellspacing="5" width="600">'+
+                       '<tr>'+
+                       '<td><strong>Identify the Validation of Certificate from ACS:</strong></td>'+
+                       '</tr>'+
+                       '<tr>'+
+                               '<td style="padding-top: 5px">'+
+                                       'Trusted CA (Certificate Authority) Certificate and correct current time are used to identify the validation of the Certificate which is sent from ACS during SSL connection. You can import the Trusted CA Certificates through the <a title="Link" href="javascript:viewCA()" style="color: #0099cc">Trusted CA Certificates</a> window and enable the Internet time function from the <a title="Link" href="sntpcfg.html" style="color: #0099cc">Advanced...|Internet Time</a> menu.'+                                       
+                               '</td>'+
+                       '</tr>'+
+                       '<table>';
+       }else{
+               document.getElementById('acs').innerHTML =
+                       '<table border="0" cellpadding="0" cellspacing="5">'+
+                       '<tr>'+
+                       '<td width="186">ACS URL Address:</td>'+
+                       '<td width="36">http://</td>'+
+                       '<td colspan="2"><input type="text" name="acsURL" size="60" maxlength="249"></td>'+
+                       '</tr>'+
+                       '<table>';
+                       
+               document.getElementById('trustCA').innerHTML = '';
+       }
+       
+       if(tr69AcsUrl.indexOf("https://") == 0){
+               acsURL.value = tr69AcsUrl.substr("https://".length, tr69AcsUrl.length - "https://".length);
+       }else{
+               acsURL.value = tr69AcsUrl.substr("http://".length, tr69AcsUrl.length - "http://".length);
+       }
+       
+  }    
 }
 
-function btnGet() {
-   var loc = 'tr69get.cgi';
-   
-   var code = 'location="' + loc + '"';
-   eval(code);
+function showInterval(enbl){
+  with ( document.forms[0] ) {
+       if(enbl == 1){
+               document.getElementById('interval').innerHTML =
+                       '<table border="0" cellpadding="0" cellspacing="5">'+
+                       '<tr>'+                 
+                       '<td>Transmission Interval of Inform Request: <input type="text" name="informInterval" size="10" maxlength="10"> seconds</td>'+
+                       '</tr>'+
+                       '<table>';
+                       
+               informInterval.value = tr69cInformInterval;
+       }else{
+               document.getElementById('interval').innerHTML = '';
+       }
+       
+  }
+}
+
+function btnCancel() {
+       var loc = 'tr69cfg.html';
+       var code = 'window.location.href="/';
+       code += loc + '"';
+       eval(code);
 }
 
 // done hiding -->
 </script>
    </head>
-   <body onLoad='frmLoad()'>
-      <blockquote>
-         <form>
-            <b>TR-069 client - Configuration<br>
-            </b>
-            <br>
-            WAN Management Protocol (TR-069) allows a Auto-Configuration Server (ACS) to 
-            perform auto-configuration, provision, collection, and diagnostics to this device.<br>
-            <br>
-            Select the desired values and click "Apply" to configure the TR-069 client options.<br>
-            <br>
+   <body onLoad='frmLoad()'>      
+         <form class="formpadding">
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>
+  <td><b><font class="netgear">TR-069 Client Configuration</font></b></td>
+</tr>
+<tr><td>&nbsp;</td></tr>
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>
+           
             <table border="0" cellpadding="0" cellspacing="0">
+            <tr>\r
+            <td width="592">
+            TR-069, a CPE WAN Management Protocol, allows the Auto-Configuration Server (ACS) to perform the auto-provisioning of settings, firmware updates, status and performance monitoring, and diagnostics to a collection of ADSL routers.
+            </td>\r
+            </tr></table>            
+            <br><br>
+<!--<table border="0" cellpadding="0" cellspacing="5">               
                <tr>
-                  <td width="80">Inform</td>
-                  <td><input name='inform' type='radio'>Disable</td>
-                  <td><input name='inform' type='radio'>Enable</td>
+                  <td width="184">Internet Connection:</td>
+                  <td><select name="ifName" id="ifName" size="1">
+                               <option value="0">LAN</option>
+                               </select></td>
+                  <td></td>
                </tr>
-            </table>
-            <br>
-            <table border="0" cellpadding="0" cellspacing="0">
+            </table>-->
+            <table border="0" cellpadding="0" cellspacing="5">               
                <tr>
-                  <td width="200">Inform Interval:</td>
-                  <td><input type='text' name='informInterval' size="20" maxlength="256"></td>
-               </tr>
-               <tr>
-                  <td>ACS URL:</td>
-                  <td><input type='text' name='acsURL' size="20" maxlength="256"></td>
+                  <td width="180">Connect to ACS:</td>
+                  <td><input name='withSSL' type='radio' onClick="chgURL(0)">without SSL</td>
+                  <td><input name='withSSL' type='radio' onClick="chgURL(1)">with SSL</td>
+                  <td></td>
                </tr>
+            </table>
+            <div id="acs">
+            </div>
+            <table border="0" cellpadding="0" cellspacing="5">               
                <tr>
                   <td>ACS User Name:</td>
-                  <td><input type='text' name='acsUser' size="20" maxlength="256"></td>
+                  <td colspan="2"><input type='text' name='acsUser' size="30" maxlength="256"></td>
+                  <td rowspan="2" width="200" class="grey_comment">Used to authenticate this device when making a connection to ACS</td>
                </tr>
                <tr>
                   <td>ACS Password:</td>
-                  <td><input type='password' name='acsPwd' size="20" maxlength="256"></td>
+                  <td colspan="2"><input type='password' name='acsPwd' size="30" maxlength="256"></td>
                </tr>
                <tr>
                   <td>Connection Request User Name:</td>
-                  <td><input type='text' name='connReqUser' size="20" maxlength="256"></td>
+                  <td colspan="2"><input type='text' name='connReqUser' size="30" maxlength="256"></td>
+                  <td rowspan="2" width="200" class="grey_comment">Used to authenticate an ACS making a Connection Request to this device</td>
                </tr>
                <tr>
                   <td>Connection Request Password:</td>
-                  <td><input type='password' name='connReqPwd' size="20" maxlength="256"></td>
+                  <td colspan="2"><input type='password' name='connReqPwd' size="30" maxlength="256"></td>
+               </tr>               
+            </table>
+            <table border="0" cellpadding="0" cellspacing="5">
+               <tr>
+                  <td>Periodic Transmission of Inform Request:</td>
+                  <td><input name='inform' type='radio' onClick="showInterval(0)">Disabled</td>
+                  <td><input name='inform' type='radio' onClick="showInterval(1)">Enabled</td>                  
                </tr>
             </table>
-            <p align="center">
-               <input type='button' onClick='btnApply()' value='Save/Apply'>
+            <div id="interval">            
+            </div>
+            <br>
+            <div id="trustCA">            
+            </div>
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>            
+            <table border="0" cellpadding="0" cellspacing="0">
+            <tr>\r
+            <td width="220" align="left">
+               <input type='button' onClick='btnApply()' value='Apply'>
+               <input type='button' onClick='btnCancel()' value='Cancel'>
+            </td>
+            <td align="left">
                <input type='button' onClick='btnGet()' value='GetRPCMethods'>
+            </td>\r
+            </tr></table>
          </form>
-         </P> </blockquote>
+         </P>
    </body>
 </html>