http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / dnscfg.html
index 51c9421..0997491 100755 (executable)
@@ -1,16 +1,18 @@
 <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">
 <!-- hide
-var state = '<%ejGet(dnsRefresh)%>';
-if ( state == '1' ) {
-   var code = 'location="dnscfg.cgi?dnsRefresh=0"';
-   eval(code);
-}
+parent.helpframe.location.href="hlpdnscfg.html";
+var randomNum = '<%ejGet(CheckNum)%>';
+var old_enableAuto;
+var auto = '<%ejGetOther(sysInfo, dnsAuto)%>';
+var dns1Ip = '<%ejGetOther(sysInfo, psidns)%>';
+var dns2Ip = '<%ejGetOther(sysInfo, psidns2)%>';
 
 function hideDnsInfo(hide) {
    var status = 'visible';
@@ -33,88 +35,109 @@ function dnsClick(cb) {
       hideDnsInfo(0);
 }
 
-function btnApply() {
-   var loc = 'dnscfg.cgi?';
+function do_cgi(){
+       var loc = 'dnscfg.cgi?';
+       loc += 'checkNum=' + randomNum + '&';
 
-   with ( document.forms[0] ) {
-      if (enableAuto.checked == false) {
-         if ( isValidIpAddress(dnsPrimary.value) == false ) {
-            alert('Primary DNS "' + dnsPrimary.value + '" has invalid IP address.');
-            return;
-         }
-         loc += 'dnsPrimary=' + dnsPrimary.value;
-         if (dnsSecondary.value != '') {
-            if ( isValidIpAddress(dnsSecondary.value) == false ) {
-               alert('Secondary DNS "' + dnsSecondary.value + '" has invalid IP address.');
-               return;
-            }
-            loc += '&dnsSecondary=' + dnsSecondary.value;
-         }
-         else
-            loc += '&dnsSecondary=' + '0.0.0.0';
-         loc += '&dnsDynamic=0';
-         loc += '&dnsRefresh=1';
-      }
-      else {
-         loc += 'dnsPrimary=' + '0.0.0.0';
-         loc += '&dnsSecondary=' + '0.0.0.0';
-         loc += '&dnsDynamic=1';
-         loc += '&dnsRefresh=0';
-      }
-   }
-   var code = 'location="' + loc + '"';
-   eval(code);
+       with ( document.forms[0] ) {
+       if (enableAuto.checked == false) {
+               if ( isValidIpAddress(dnsPrimary.value) == false ) {
+               alert('Primary DNS "' + dnsPrimary.value + '" has invalid IP address.');
+               return;
+               }
+               loc += 'dnsPrimary=' + dnsPrimary.value;
+               if (dnsSecondary.value != '') {
+               if ( isValidIpAddress(dnsSecondary.value) == false ) {
+                               alert('Secondary DNS "' + dnsSecondary.value + '" has invalid IP address.');
+                               return;
+               }
+               loc += '&dnsSecondary=' + dnsSecondary.value;
+               } else
+               loc += '&dnsSecondary=' + '0.0.0.0';
+               loc += '&dnsDynamic=0';//add by wilson
+       } else {
+               loc += 'dnsPrimary=' + '0.0.0.0';
+               loc += '&dnsSecondary=' + '0.0.0.0';
+               loc += '&dnsDynamic=1';//add by wilson
+       }
+       }
+       var code = 'window.location.href="/'; // for Mac safari browser compatibility
+       code += loc + '"';
+       eval(code);
 }
 
 
-function frmLoad() {
+function btnApply() {
    with ( document.forms[0] ) {
-      var auto = '<%ejGetOther(sysInfo, dnsAuto)%>';
-      var dns1 = '<%ejGetOther(sysInfo, dns)%>';
-      if ( dns1 == '&nbsp' ) dns1 = '';
+      if (enableAuto.checked == true){
+        if (old_enableAuto == enableAuto.checked){
+              var loc = 'dnscfg.html';
+              var code = 'window.location.href="/'; // for Mac safari browser compatibility
+                         code += loc + '"';
+              eval(code);
+           } else {
+              do_cgi();
+           }
+        } else {
+          if ( old_enableAuto == enableAuto.checked && dnsPrimary.value == dns1Ip && dnsSecondary.value == dns2Ip) {
+              var loc = 'dnscfg.html';
+              var code = 'window.location.href="/'; // for Mac safari browser compatibility
+                         code += loc + '"';
+              eval(code);
+          } else {
+            do_cgi();
+          }
+        }
+   }
+}
 
-      var dns2 = '<%ejGetOther(sysInfo, dns2)%>';
-      if ( dns2 == '&nbsp' ) dns2 = '';
 
-      if ( auto == '1' ) {
-         enableAuto.checked = true;
-         dnsPrimary.value = '';
-         dnsSecondary.value = '';
-         hideDnsInfo(1);
-      } else {
-         enableAuto.checked = false;
-         dnsPrimary.value = dns1;
-         dnsSecondary.value = dns2;
-         hideDnsInfo(0);
-      }
-   }
+function frmLoad() {
+       with ( document.forms[0] ) {
+       if ( dns1Ip == '&nbsp' || dns1Ip == '0.0.0.0') dns1Ip = '';
+       if ( dns2Ip == '&nbsp' || dns2Ip == '0.0.0.0') dns2Ip = '';
+       dnsPrimary.value=dns1Ip;
+       dnsSecondary.value=dns2Ip;
+       if ( auto == '1' ) {
+               enableAuto.checked = true;
+               old_enableAuto=true;
+               hideDnsInfo(1);
+       } else {
+               enableAuto.checked = false;
+               old_enableAuto=false;
+               hideDnsInfo(0);
+       }
+       }
+       if (<%ejGet(changeset)%> == 1){
+               parent.footerfrm.location.href="footer.html";
+       }
 }
 
 // done hiding -->
 </script>
    </head>
    <body onLoad='frmLoad()'>
-      <blockquote>
-         <form>
-            <P>
-               <b>DNS Server Configuration</b><br><br>
-               If 'Enable Automatic Assigned DNS' checkbox is selected, this router will accept
-               the first received DNS assignment from one of the PPPoA, PPPoE or MER/DHCP
-               enabled PVC(s) during the connection establishment. If the checkbox is
-               not selected, enter the primary and optional secondary DNS server IP addresses.
-               Click 'Save' button to save the new configuration. You must reboot the
-               router to make the new configuration effective.<br><br>
-            </P>
+
+         <form class="formpadding">
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>
+  <td><b><font class="netgear">DNS Server 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>
-                  <td valign="center" align="middle" colspan="2" width="30" height="30">
+                  <td align="left" width="25" height="30">
                      <input type='checkbox' name='enableAuto' onclick='dnsClick(this)'></td>
                   <td colspan="2">
                      Enable Automatic Assigned DNS</td>
                </tr>
             </table>
             <br>
-            <br>
             <div id='dnsInfo'>
                <table border="0" cellpadding="0" cellspacing="0">
                   <tr>
@@ -128,13 +151,18 @@ function frmLoad() {
                      <td><input type='text' name='dnsSecondary'></td>
                   </tr>
                </table>
-               <br>
             </div>
-            <br>
-            <center>
-               <input type='button' onClick='btnApply()' value='Save'>
-            </center>
+<table border="0" cellpadding="0" cellspacing="3" width="98%">
+<tr>\r
+  <td background="liteblue.gif" height="12">&nbsp;</td>\r
+</tr>
+</table>
+            <table width='520'><tr>
+               <td align='left' width="50" valign="top"><input type='button' onClick='btnApply()' value='Apply'></td>
+               <td align="left" width="60" valign="top"><input type="button" onClick="btnCancel('dnscfg.html')" value="Cancel"></td>
+               <td class="grey_comment" width="410">If changing from unselected Automatic Assigned DNS to selected Automatic Assigned DNS, You must reboot the router to get the automatic assigned DNS addresses.</td>
+            </tr></table>
          </form>
-      </blockquote>
+
    </body>
 </html>