www.usr.com/support/gpl/USR9113_release1.0.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>Add Dynamic DNS</title>
8
9         <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
10         <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>
11         <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>
12
13         <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
14         <script type="text/javascript">
15 <!-- hide
16
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("Add Dynamic DNS");
186 </script>
187
188
189 <form>
190         <p>This page allows you to add a Dynamic DNS address from
191         selected dynamic DNS servers.</p>
192
193 <p><label for="">Dynamic DNS provider:</label>
194         <select name="ddnsMode" id="ddnsMode" onChange='ddnsChange()'>
195                 <option value="dyndns">DynDNS.org</option>
196                 <option value="dtdns">DtDNS.net</option>
197                 <option value="noip">No-IP.com</option>
198                 <option value="tzo">TZO</option>
199         </select>
200 </p>
201
202         <div id="ddnsInfo">
203          <table border="0">
204            <tr>
205              <td><label for="ddnsHostname">Host name:</label></td>
206              <td><input type="text" name="ddnsHostname" id="ddnsHostname"></td>
207            </tr>
208            <tr>
209              <td><label for="">Interface:</label></td>
210              <td><select name="ddnsInterface" id="ddnsInterface">
211                 <script type="text/javascript">
212 <!-- hide
213 {
214    var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
215    var interfaces = interfaceInfo.split("|");
216  
217    for (var i = 0; i < interfaces.length; i++)
218    {
219       var names = interfaces[i].split("/");
220       document.write("<option value=\"" + names[1] + "\">");
221       document.writeln(interfaces[i]);
222       document.writeln("</option>");
223    }
224    document.writeln("  <option value=\"br0\">LAN/br0</option>");
225 }
226 // done hiding -->
227 </script>
228         </select></td>
229       </tr>
230     </table>
231   </div>
232
233   <div id="dyndnsInfo">
234     <h3>Dynamic DNS Settings</h3>
235     <table border="0">
236       <tr>
237         <td><label for="dyndnsUsername">User name:</label></td>
238         <td><input type="text" length="50" name="dyndnsUsername" size="20" maxlen="64"></td>
239       </tr>
240       <tr>
241         <td><label for="dyndnsPassword">Password:</label></td>
242         <td><input type="text" length="50" name="dyndnsPassword" id="dyndnsPassword"></td>
243       </tr>
244     </table>
245   </div>
246
247   <div id="tzoInfo">
248     <h3>TZO Settings</h3>
249     <table border="0">
250       <tr>
251         <td><label for="tzoEmail">E-mail:</label></td>
252         <td><input type="text" size="50" maxlength="200" name="tzoEmail" id="tzoEmail"></td>
253       </tr>
254       <tr>
255         <td><label for="tzoKey">Key:</label></td>
256         <td><input type="text" size="50" maxlength="100" name="tzoKey" id="tzoKey"></td>
257       </tr>
258     </table>
259   </div>
260
261         <p><input type="button" value=" Add " onClick="btnApply('ddnsmngr.cmd');"></p>
262
263 </form>
264
265 <script type="text/javascript">
266         writeFooter();
267 </script>
268
269 </body>
270 </html>