www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / html / ddnsadd.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--
3         (c) 2005 U.S. Robotics Corporation
4 -->
5 <html>
6 <head>
7         <title>DNS Add</title>
8
9         <link href="usr_main.css" rel="stylesheet" type="text/css">
10         <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>
11         <script src="usr_common.js" type="text/javascript"></script>
12
13         <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14         <script type="text/javascript">
15 <!-- hide
16 setPageTitle("<%ejGetWlJS(wlInterface)%>");
17
18 function ddnsChange() {
19   with ( document.forms[0] ) {
20     var ddns = ddnsMode[ddnsMode.selectedIndex].value;
21
22     switch( ddns ) {
23     case "dyndns":
24     case "dtdns":
25     case "noip":
26       hideDDNSInfo( 0 );
27       hideTZOInfo( 1 );
28       hideDynDNSInfo( 0 );
29       break;
30     case "tzo":
31       hideDDNSInfo( 0 );
32       hideTZOInfo( 0 );
33       hideDynDNSInfo( 1 );
34       break;
35     }
36   }
37 }
38
39 function hideDDNSInfo(hide) {
40   var status = 'visible';
41   if ( hide == 1 )
42     status = 'hidden';
43   if (document.getElementById) // DOM3 = IE5, NS6
44     document.getElementById('ddnsInfo').style.visibility = status;
45   else {
46     if (document.layers) { // NS4
47       with ( document.forms[0] ) {
48         if ( hide == 1 ) {
49           ddnsHostname.value = '';
50         } else {
51           ddnsHostname.value = 'Host name';
52         }
53       }
54     } else {
55       document.all.ddnsInfo.style.visibility = status;
56     }
57   }
58 }
59
60 function hideDynDNSInfo(hide) {
61   var status = 'visible';
62   if ( hide == 1 )
63     status = 'hidden';
64   if (document.getElementById) // DOM3 = IE5, NS6
65     document.getElementById('dyndnsInfo').style.visibility = status;
66   else {
67     if (document.layers) { // NS4
68       with ( document.forms[0] ) {
69         if ( hide == 1 ) {
70           dyndnsHostname.value = '';
71         } else {
72           dyndnsHostname.value = 'Host name';
73         }
74       }
75     } else {
76       document.all.ddnsInfo.style.visibility = status;
77     }
78   }
79 }
80
81 function hideTZOInfo(hide) {
82   var status = 'visible';
83   if ( hide == 1 )
84     status = 'hidden';
85   if (document.getElementById) // DOM3 = IE5, NS6
86     document.getElementById('tzoInfo').style.visibility = status;
87   else {
88     if (document.layers) { // NS4
89       with ( document.forms[0] ) {
90         if ( hide == 1 ) {
91           tzoEmail.value = '';
92           tzoKey.value = '';
93         } else {
94           tzoEmail.value = 'Name';
95           tzoKey.value = 'Password';
96         }
97       }
98     } else {
99       document.all.ddnsInfo.style.visibility = status;
100     }
101   }
102 }
103
104 function frmLoad() {
105   with (document.forms[0]) {
106     ddnsMode.selectedIndex = 0;
107   }
108
109   ddnsChange();
110 }
111
112 function btnApply(place) {
113   var loc = place + '?action=add&service=';
114
115   if ( place == "ddnsmngr.cmd" ) {
116     with ( document.forms[0] ) {
117       switch( ddnsMode[ddnsMode.selectedIndex].value ) {
118       case 'noip':
119         loc += '3';
120         break;
121       case 'dtdns':
122         loc += '2';
123         break;
124       case 'dyndns':
125         loc += '1';
126         break;
127       case 'tzo':
128         loc += '0';
129         break;
130       }
131
132       switch( ddnsMode[ddnsMode.selectedIndex].value ) {
133       case "dyndns":
134       case "dtdns":
135       case "noip":
136         update_username = dyndnsUsername.value;
137         update_password = dyndnsPassword.value;
138         break;
139       case "tzo":
140         update_username = tzoEmail.value;
141         update_password = tzoKey.value;
142         break;
143       }
144
145       if ( update_username.length == 0 ) {
146         if ( ddnsMode[ddnsMode.selectedIndex].value == 'dyndns' ||
147              ddnsMode[ddnsMode.selectedIndex].value == 'dtdns' ||
148              ddnsMode[ddnsMode.selectedIndex].value == 'noip' )
149           alert('Empty username.' );
150         else
151           alert('Invalid Email address.' );
152         return;
153       }
154       loc += '&username=' + update_username;
155
156       if ( update_password.length == 0 ) {
157         if ( ddnsMode[ddnsMode.selectedIndex].value == 'dyndns' ||
158              ddnsMode[ddnsMode.selectedIndex].value == 'dtdns' ||
159              ddnsMode[ddnsMode.selectedIndex].value == 'noip' )
160           alert('Empty password.' );
161         else
162           alert('Invalid key.' );
163         return;
164       }
165       loc += '&password=' + update_password;
166
167       if ( ddnsHostname.value.length == 0 ) {
168         alert('Please enter a host name.');
169         return;
170       }
171       loc += '&hostname=' + ddnsHostname.value;
172
173       loc += '&iface=' + ddnsInterface[ddnsInterface.selectedIndex].value;
174     }
175     var code = 'location = "' + loc + '"';
176     eval(code);
177   }
178 }
179 // done hiding -->
180         </script>
181 </head>
182 <body onload="initMenu(); frmLoad();">
183
184 <script type="text/javascript">
185         writeHeader("Dynamic DNS", "<%ejGetJS(curUserName)%>", "<%ejGetOther(sysInfo, adslStd)%>", "<%ejGetOther(sysInfo, noBrPrtcl)%>", <%ejGetOther(sysInfo, pppIpExtension)%>, <%ejGetOther(sysInfo, enblFirewall)%>, <%ejGetOther(sysInfo, enblNat)%>, "<%ejGetWlJS(wlInterface)%>", <%ejGetJS(enblQos)%>);
186 </script>
187
188
189 <form>
190         <h3>Add Dynamic DDNS</h3>
191
192         <p>This page allows you to add a Dynamic DNS address from
193         selected dynamic DNS servers.</p>
194
195 <p><label for="">Dynamic DNS provider:</label>
196         <select name="ddnsMode" id="ddnsMode" onChange='ddnsChange()'>
197                 <option value="dyndns">DynDNS.org</option>
198                 <option value="dtdns">DtDNS.net</option>
199                 <option value="noip">No-IP.com</option>
200                 <option value="tzo">TZO</option>
201         </select>
202 </p>
203
204         <div id="ddnsInfo">
205          <table border="0">
206            <tr>
207              <td><label for="ddnsHostname">Host name:</label></td>
208              <td><input type="text" name="ddnsHostname" id="ddnsHostname"></td>
209            </tr>
210            <tr>
211              <td><label for="">Interface:</label></td>
212              <td><select name="ddnsInterface" id="ddnsInterface">
213                 <script type="text/javascript">
214 <!-- hide
215 {
216    var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
217    var interfaces = interfaceInfo.split("|");
218  
219    for (var i = 0; i < interfaces.length; i++)
220    {
221       var names = interfaces[i].split("/");
222       document.write("<option value=\"" + names[1] + "\">");
223       document.writeln(interfaces[i]);
224       document.writeln("</option>");
225    }
226    document.writeln("  <option value=\"br0\">LAN/br0</option>");
227 }
228 // done hiding -->
229 </script>
230         </select></td>
231       </tr>
232     </table>
233   </div>
234
235   <div id="dyndnsInfo">
236     <h3>Dynamic DNS Settings</h3>
237     <table border="0">
238       <tr>
239         <td><label for="dyndnsUsername">User name:</label></td>
240         <td><input type="text" length="50" name="dyndnsUsername" size="20" maxlen="64"></td>
241       </tr>
242       <tr>
243         <td><label for="dyndnsPassword">Password:</label></td>
244         <td><input type="text" length="50" name="dyndnsPassword" id="dyndnsPassword"></td>
245       </tr>
246     </table>
247   </div>
248
249   <div id="tzoInfo">
250     <h3>TZO Settings</h3>
251     <table border="0">
252       <tr>
253         <td><label for="tzoEmail">E-mail:</label></td>
254         <td><input type="text" size="50" maxlength="200" name="tzoEmail" id="tzoEmail"></td>
255       </tr>
256       <tr>
257         <td><label for="tzoKey">Key:</label></td>
258         <td><input type="text" size="50" maxlength="100" name="tzoKey" id="tzoKey"></td>
259       </tr>
260     </table>
261   </div>
262
263         <p><input type="button" value=" Add " onClick="btnApply('ddnsmngr.cmd');"></p>
264
265 </form>
266
267 <script type="text/javascript">
268         writeFooter();
269 </script>
270
271 </body>
272 </html>