www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / index-wireless.html
index d4bc38c..ec7277b 100755 (executable)
@@ -1,40 +1,84 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <!--
-       (c) 2005 U.S. Robotics Corporation
+       (c) 2005-2006 U.S. Robotics Corporation
 -->
 <html>
 <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Setup &raquo; Security</title>
        <link href="usr_main.css" rel="stylesheet" type="text/css">
-       <script src="usr_menus.js" type="text/javascript"></script>
+       <link href="usr_menus.css" rel="stylesheet" type="text/css"><script src="usr_menus.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
        <script src="usr_common.js" type="text/javascript"></script>
+       <script src="util.js" type="text/javascript"></script>
 <script type="text/javascript">
 
-setPageTitle("<%ejGetWl(wlInterface)%>");
+setPageTitle("<%ejGetWlJS(wlInterface)%>");
 
+<!-- This is similar to the setup_sec.html page -->
 function validatePage()
 {
-       if (document.idForm.chkEncrypt.checked)
+       if (document.idForm.cbSecurity.value == "WPA_WPA2")
        {
                if (!minLength("Pass phrase", document.idForm.wlWpaPsk, 8))
                        return false;
+
+               document.idForm.wlAuthMode.value = "psk2mix";
+       }
+       else if (document.idForm.cbSecurity.value.substr(0, 3) == "WEP")
+       {
+               if (!minLength("WEP key", document.idForm.idKeyValue1, document.idForm.idKeyValue1.maxLength))
+                       return false;
+
+               if (!isValidKey(document.idForm.idKeyValue1, document.idForm.idKeyValue1.maxLength))
+               {
+                       alert("Please enter a valid " + document.idForm.idKeyValue1.maxLength + "-character WEP key.");
+                       return false;
+               }
+
+               if (document.idForm.cbSecurity.value == "WEPopen")
+                       document.idForm.wlAuthMode.value = "open";
+               else
+                       document.idForm.wlAuthMode.value = "shared";
+
+               if (document.idForm.cbWEPkeytype.value.substr(0, 7) == "type128")
+                       document.idForm.wlKeyBit.value = 0;     // 128-bit
+               else
+                       document.idForm.wlKeyBit.value = 1;     // 64-bit
        }
        else
+       {
+               document.idForm.wlAuthMode.value = "none";
                document.idForm.wlWpaPsk.value = "";
+       }
        
        return true;
 }
+
+function updateFields()
+{
+       setVisibility("idEncryptNo", (document.idForm.cbSecurity.value == "none"));
+
+       setVisibility("idWPA", (document.idForm.cbSecurity.value == "WPA_WPA2"));
+       setVisibility("idEncryptWPA", (document.idForm.cbSecurity.value == "WPA_WPA2"));
+
+       setVisibility("idWEPkeytype", (document.idForm.cbSecurity.value.substr(0, 3) == "WEP"));
+       setVisibility("idKey1", (document.idForm.cbSecurity.value.substr(0, 3) == "WEP"));
+
+       setMaxLength(false, document.idForm.cbWEPkeytype.value, document.idForm.wlKey1);
+}
 </script>
 </head>
-<body>
+<body onload="updateFields();">
 
 <script type="text/javascript">
        writeHeaderInfo("Secure Your Router");
 </script>
 
 <form name="idForm" action="setup_finish.wl" method="post">
-       <input type="hidden" id="wlAuthMode" name="wlAuthMode" value="psk2mix">
+       <!-- wlAuthMode is deprecated -->
+       <input type="hidden" id="wlAuthMode" value="psk2mix">
+       <input type="hidden" id="wlKeyIndex" name="wlKeyIndex" value="1">
+       <input type="hidden" id="wlKeyBit" name="wlKeyBit" value="0">
 
 <h3>Network Name (SSID)</h3>
 
@@ -42,7 +86,7 @@ function validatePage()
 network name (also known as an SSID) of your router in order to communicate with it.</p>
 
 <p id="lblSSID"><label for="wlSsid">Network name:</label>
-       <input type="text" size="30" maxlength="30" name="wlSsid" id="wlSsid" class="clsTextfield" value="<%ejGetWl(wlSsid)%>"></p>
+       <input type="text" size="30" maxlength="30" name="wlSsid" id="wlSsid" class="clsTextfield" value="<%ejGetWlHTML(wlSsid)%>"></p>
 
 <p>U.S.&nbsp;Robotics recommends that you change the <b>network name</b>
 and treat it like a password. Use a combination of more than eight alphanumeric
@@ -55,38 +99,60 @@ or &ldquo;Fish81Tree&rdquo;).</p>
 
 <p>U.S.&nbsp;Robotics recommends securing your router from unauthorized
 wireless devices by using WPA encryption.
-If you want to use a different method, you can change it on the
+If you have older wireless devices that don&rsquo;t support WPA,
+you can select WEP.
+If you want to use a different method later, you can change it on the
 router&rsquo;s <b>Security</b> page after the setup is complete.
 </p>
 
-<p><input type="checkbox" name="chkEncrypt" id="chkEncrypt" checked
-       onclick="toggleVisibility('idEncrypt'); toggleVisibility('idEncryptNo');">
-        <label for="chkEncrypt">Secure the router against unauthorized access (recommended)</label></p>
-
-<div id="idEncrypt">
-
 <table border="0">
        <tr>
                <td id="lblMethod" valign="top"><label>Method:</label></td>
                <td>
-                       <span class="clsStatic">WPA2 and WPA (PSK)</span>
+                       <select name="cbSecurity" id="cbSecurity" onchange="updateFields();">
+                               <option value="WPA_WPA2" selected>WPA2 and WPA (PSK) (recommended)</option>
+                               <option value="WEPopen">WEP open</option>
+                               <option value="WEPshared">WEP shared</option>
+                               <option value="none">None</option>
+                       </select>
                </td>
        </tr>
 
-       <tr>
+       <!-- WPA -->
+       <tr id="idWPA">
                <td valign="top"><label for="wlWpaPsk">Pass&nbsp;phrase:</label></td>
                <!-- either 32 hex digits or ASCII that WPA hashes to a 256-bit key -->
-               <td><input type="text" size="40" maxlength="63" name="wlWpaPsk" id="wlWpaPsk" class="clsTextfield" value="<%ejGetWl(wlWpaPsk)%>"><br/>
+               <td><input type="text" size="40" maxlength="63" name="wlWpaPsk" id="wlWpaPsk" class="clsTextfield" value="<%ejGetWlHTML(wlWpaPsk)%>"><br/>
                        <span class="clsNote">(The pass phrase must be between eight and sixty-three characters long.)</span>
                        </td>
        </tr>
+
+       <!-- WEP -->
+       <tr id="idWEPkeytype">
+               <td><label>Key type:</label></td>
+               <td>
+                       <select id="cbWEPkeytype" onchange="setMaxLength(true, this.value, wlKey1);">
+                               <option value="type128ASCII" selected>128-bit ASCII</option>
+                               <option value="type128hex">128-bit hex</option>
+                               <option value="type64ASCII">64-bit ASCII</option>
+                               <option value="type64hex">64-bit hex</option>
+                       </select>
+               </td>
+       </tr>
+
+       <tr id="idKey1" valign="top">
+               <td><label for="idKeyValue1">Key:</label></td>
+               <td><input type="text" size="40" maxlength="58" name="wlKey1" id="idKeyValue1" class="clsTextfield" value="<%ejGetWlHTML(wlKey1)%>"><br/>
+                       <span class="clsNote">(The key must be <span id="idKeyNumChars"></span>&nbsp;characters long.)</span>
+               </td>
+       </tr>
 </table>
 
-<p>U.S.&nbsp;Robotics recommends that you treat your <b>WPA pass phrase</b> like
+<p id="idEncryptWPA">
+U.S.&nbsp;Robotics recommends that you treat your <b>WPA pass phrase</b> like
 a password and use a combination of alphanumeric characters that is not
-easy to guess (such as &ldquo;5Rock2Fish9Sand&rdquo; or &ldquo;20Dogs933Trot&rdquo;).</p>
-
-</div>
+easy to guess (such as &ldquo;5Rock2Fish9Sand&rdquo; or &ldquo;20Dogs933Trot&rdquo;).
+</p>
 <div id="idEncryptNo" style="display: none;" class="clsNotice">
        <p>Please note that you have disabled encryption on the router and your
        wireless network will be insecure. Unauthorized wireless devices may be
@@ -96,7 +162,11 @@ easy to guess (such as &ldquo;5Rock2Fish9Sand&rdquo; or &ldquo;20Dogs933Trot&rdq
 </div>
 
 
-<p class="clsSave">You will need to enter these values when you configure a wireless client.</p>
+<p class="clsSave">You will need to enter these values when you configure a wireless client.
+After setup is complete, these values will be displayed on the
+router&rsquo;s <b>Status</b> page,
+and you can write them down or print them.
+</p>
 
 <p>When you&rsquo;re finished and ready to apply your changes, press <b>Apply</b>.</p>
 <p><input type="submit" class="clsBtnSave" name="btnSubmit" value="Apply" onclick="if (!validatePage()) return false;"></p>