http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / html / dnscfg.html
index ea62f74..0997491 100755 (executable)
@@ -1,28 +1,18 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!--
-       (c) 2005 U.S. Robotics Corporation
--->
 <html>
    <head>
-       <title>DNS Server &laquo; Internet</title>
-
-       <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
-       <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css"><script src="usr_menus_dropdown.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
-       <link href="usr_device.css" type="text/css" rel="stylesheet" /><script src="usr_device.js" type="text/javascript"></script><link href="usr_91xx.css" type="text/css" rel="stylesheet" /><script src="usr_91xx.js" type="text/javascript"></script><script src="usr_resources.js" type="text/javascript"></script>
-
       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
-
-   <script type="text/javascript" src="util.js"></script>
-   <script type="text/javascript">
+      <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 = '<%ejGetJS(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';
@@ -45,118 +35,134 @@ function dnsClick(cb) {
       hideDnsInfo(0);
 }
 
-function btnApply() {
-   var loc = 'dnscfg.cgi?';
-
-   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);
+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';//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 = '';
-
-      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);
-      }
+      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();
+          }
+        }
    }
 }
 
-function btnReset() {
-   var loc = 'rebootinfo.cgi';
 
-   var code = 'location = "' + loc + '"';
-   eval(code);
+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="initMenu(); frmLoad();">
-
-<script type="text/javascript">
-       writeHeader("Internet");
-</script>
-
-
-<h3>DNS Server</h3>
-
-<p>If the <b>Automatically-assigned DNS</b> check box 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
-cleared, enter the primary and optional secondary DNS server IP addresses.
-Press <b>Apply</b> to save it.
-</P>
-
-<P><b>Note:</b> If you select the <b>Automatically-assigned DNS</b> check box,
-you must restart the router to get the automatically-assigned DNS addresses.</P>
-
-<form>
-   <p><input type='checkbox' name='enableAuto' id='enableAuto' onclick='dnsClick(this)'> <label for="enableAuto">Automatically-assigned DNS</label></p>
-
-   <div id='dnsInfo'>
-      <table border="0">
-         <tr>
-            <td><label for="dnsPrimary">Primary DNS server:</label></td>
-            <td><input type='text' name='dnsPrimary' id='dnsPrimary'></td>
-         </tr>
-         <tr>
-            <td><label for="dnsSecondary">Secondary DNS server:</label></td>
-            <td><input type='text' name='dnsSecondary' id='dnsSecondary'></td>
-         </tr>
-      </table>
-   </div>
-
-   <p><input type='button' onClick='btnApply()' value='Apply'>
-       <input type='button' onClick='btnReset()' value='Restart'>
-   </p>
-</form>
-
-
-<script type="text/javascript">
-       writeFooter();
-</script>
-
-</body>
+   <body onLoad='frmLoad()'>
+
+         <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 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>
+            <div id='dnsInfo'>
+               <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                     <td>Primary DNS server:
+                     </td>
+                     <td><input type='text' name='dnsPrimary'></td>
+                  </tr>
+                  <tr>
+                     <td>Secondary DNS server:
+                     </td>
+                     <td><input type='text' name='dnsSecondary'></td>
+                  </tr>
+               </table>
+            </div>
+<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>
+
+   </body>
 </html>