971fabea4a0c03c16c9cc623f3da6edfe963d39e
[bcm963xx.git] / userapps / broadcom / cfm / html / tr69cfg.html
1 <html>
2    <head>
3       <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4       <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
5       <link rel="stylesheet" href='stylemain.css' type='text/css'>
6          <link rel="stylesheet" href='colors.css' type='text/css'>
7             <script language="javascript" src="util.js"></script>
8             <script language="javascript" src="encoder.js"></script>
9             <script language="javascript">
10 <!-- hide
11 parent.helpframe.location.href="hlptr069.html";
12 var randomNum = '<%ejGet(CheckNum)%>';
13
14 var state = '<%ejGet(lanRefresh)%>';
15 if ( state == '1' ) {
16         var code = 'window.location.href="/tr69cRefresh.cgi?lanRefresh=0&checkNum=<%ejGet(CheckNum)%>"';
17         eval(code);
18 }
19
20 var tr69AcsUrl = '<%ejGet(tr69cAcsURL)%>';
21 var tr69cAcsPwd = '<%ejGet(tr69cAcsPwd)%>';
22 var tr69cConnReqPwd = '<%ejGet(tr69cConnReqPwd)%>';
23 var tr69cAcsUser = '<%ejGet(tr69cAcsUser)%>';
24 var tr69cConnReqUser = '<%ejGet(tr69cConnReqUser)%>';
25 var tr69cInformEnable = '<%ejGet(tr69cInformEnable)%>';
26 var tr69cInformInterval = '<%ejGet(tr69cInformInterval)%>';
27
28 var tr69cIface='<%ejGet(tr69cIfName)%>';
29 var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
30
31 function viewCA(){\r
32   window.open("viewTrustCA.html","","width=750, height=600, scrollbars=yes");\r
33 }
34
35 function sntpcfg(){
36         var loc = 'sntpcfg.html';\r
37         var code = 'window.location.href="/'; // for Mac safari browser compatibility\r
38         code += loc + '"';\r
39         eval(code);
40 }
41
42 function setIfc() {
43 var selectlen;
44         with ( document.forms[0] ) {
45                 selectlen=ifName.length;
46                 for(i=0 ; i<selectlen ; i++) {   //delete old options
47                         ifName.selectedIndex=0;
48                         ifName.remove(ifName.selectedIndex);
49                 }
50         var interfaces = interfaceInfo.split('|');
51         for ( i = 0; i < interfaces.length; i++ ) {
52                 var names = interfaces[i].split('/');
53                 if(names[0].indexOf("br") == -1 && names[0] != '') {
54                         objOption= new Option(names[0],names[1],false,false);
55                         document.getElementById("ifName").options[document.getElementById("ifName").length] = objOption;
56                 }
57                 }
58     }
59 }
60
61 function getifcIndex() {
62         var ret=0;
63         with ( document.forms[0] ) {
64                 for ( i = 0; i < document.getElementById("ifName").length; i++) {
65                         if( tr69cIface ==  document.getElementById("ifName").options[i].value ) {
66                                 document.getElementById("ifName").options[i].selected=true;
67                                 ret = i;
68                                 break;
69                         }
70                 }
71         }
72         return ret;
73 }
74
75 function frmLoad() {
76         //setIfc();
77    with ( document.forms[0] ) {
78         //ifName.selectedIndex = getifcIndex();
79         if(tr69AcsUrl.indexOf("https://") == 0){
80                 withSSL[1].checked = true;
81                 chgURL(1);
82         }else{
83                 withSSL[0].checked = true;
84                 chgURL(0);
85         }
86       
87       acsUser.value = tr69cAcsUser;
88       acsPwd.value = base64Decode(tr69cAcsPwd);
89       connReqUser.value = tr69cConnReqUser;
90       connReqPwd.value = base64Decode(tr69cConnReqPwd);
91       enblInform = tr69cInformEnable;
92       if ( enblInform == '1' ){
93          inform[1].checked = true;
94          showInterval(1);
95       }else{
96          inform[0].checked = true;
97          showInterval(0);
98       }
99           
100    }
101         if (<%ejGet(changeset)%> == 1){
102                 parent.footerfrm.location.href="footer.html";
103         }
104 }
105
106 function btnGet() {\r
107         var loc = 'tr69get.cgi?';
108         loc += 'checkNum=' + randomNum;\r
109    \r
110         var code = 'window.location.href="/';
111         code += loc + '"';
112         eval(code);     \r
113 }\r
114
115 function btnApply() {
116    var loc = 'tr69cfg.cgi?';
117    loc += 'checkNum=' + randomNum + '&';
118    with ( document.forms[0] ) {
119                 //loc +='tr69cIfName='+ifName.options[ifName.selectedIndex].value;
120         
121       if (acsURL.value == '') {
122         if(withSSL[1].checked == true){
123          alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 248 characters.');
124          return;
125         }else{
126          alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 249 characters.');
127          return;
128         }
129       }
130       
131       //if(acsUser.value == tr69cAcsUser && acsPwd.value == base64Decode(tr69cAcsPwd) && connReqUser.value == tr69cConnReqUser
132         //&& connReqPwd.value == base64Decode(tr69cConnReqPwd) && ((tr69cInformEnable == '1' && inform[1].checked == true) || (tr69cInformEnable == '0' && inform[0].checked == true))){
133                 //}
134       
135       if ( inform[1].checked == true ){
136          loc += 'tr69cInformEnable=1';
137          if(isNaN(informInterval.value)){
138                 alert("Periodic Transmision Interval of Inform Request is invalid. The valid range is from 1 to 4294967295.");
139                 return;
140          }
141          if(parseInt(informInterval.value) < 1 || parseInt(informInterval.value) > 4294967295){
142                 alert("Periodic Transmision Interval of Inform Request is invalid. The valid range is from 1 to 4294967295.");
143                 return;
144          }
145          loc += '&tr69cInformInterval=' + informInterval.value;
146           }else
147          loc += 'tr69cInformEnable=0';
148
149       if(withSSL[1].checked == true){
150                 if (acsURL.value.length + "https://".length > 256) {
151          alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 248 characters.');
152          return;
153         }
154
155         var tmpUrl = 'https://' + acsURL.value;
156         loc += '&tr69cAcsURL=' + base64Encode(tmpUrl);
157                 
158       }else{
159         if (acsURL.value.length + "http://".length > 256) {
160          alert('Inputted ACS URL address is invalid. Valid length of ACS URL address is from 1 to 249 characters.');
161          return;
162         }
163         
164         var tmpUrl = 'http://' + acsURL.value;
165         loc += '&tr69cAcsURL=' + base64Encode(tmpUrl);
166         
167       }
168       
169       if (acsUser.value.length > 256) {
170          alert('Inputted ACS user name is invalid. Valid length of ACS user name is from 0 to 256 characters.');
171          return;
172       }
173       loc += '&tr69cAcsUser=' + base64Encode(acsUser.value);
174                 if(urlError1==1)
175                 return;
176                       
177       if (acsPwd.value.length > 256) {
178          alert('Inputted ACS password is invalid. Valid length of ACS password is from 0 to 256 characters.');
179          return;
180       }
181       loc += '&tr69cAcsPwd=' + base64Encode(acsPwd.value);
182         if(urlError1==1)
183                 return;
184                       
185       if (connReqUser.value.length > 256) {
186          alert('Inputted Connection Request user name is invalid. Valid length of Connection Request user name is from 0 to 256 characters.');
187          return;
188       }
189       loc += '&tr69cConnReqUser=' + base64Encode(connReqUser.value);
190         if(urlError1==1)
191                 return;
192                       
193       if (connReqPwd.value.length > 256) {
194          alert('Inputted Connection Request password is invalid. Valid length of Connection Request password is from 0 to 256 characters.');
195          return;
196       }
197       loc += '&tr69cConnReqPwd=' + base64Encode(connReqPwd.value);
198         if(urlError1==1)
199                 return;
200    }
201    
202         var code = 'window.location.href="/';
203         code += loc + '"';
204         eval(code);
205 }
206
207 function chgURL(ssl){
208   with ( document.forms[0] ) {
209         if(ssl == 1){
210                 document.getElementById('acs').innerHTML =
211                         '<table border="0" cellpadding="0" cellspacing="5">'+
212                         '<tr>'+
213                         '<td width="186">ACS URL Address:</td>'+
214                         '<td width="36">https://</td>'+
215                         '<td colspan="2"><input type="text" name="acsURL" size="60" maxlength="248"></td>'+
216                         '</tr>'+
217                         '<table>';
218                 
219                 document.getElementById('trustCA').innerHTML = 
220                         '<table border="0" cellpadding="0" cellspacing="5" width="600">'+
221                         '<tr>'+
222                         '<td><strong>Identify the Validation of Certificate from ACS:</strong></td>'+
223                         '</tr>'+
224                         '<tr>'+
225                                 '<td style="padding-top: 5px">'+
226                                         'Trusted CA (Certificate Authority) Certificate and correct current time are used to identify the validation of the Certificate which is sent from ACS during SSL connection. You can import the Trusted CA Certificates through the <a title="Link" href="javascript:viewCA()" style="color: #0099cc">Trusted CA Certificates</a> window and enable the Internet time function from the <a title="Link" href="sntpcfg.html" style="color: #0099cc">Advanced...|Internet Time</a> menu.'+                                       
227                                 '</td>'+
228                         '</tr>'+
229                         '<table>';
230         }else{
231                 document.getElementById('acs').innerHTML =
232                         '<table border="0" cellpadding="0" cellspacing="5">'+
233                         '<tr>'+
234                         '<td width="186">ACS URL Address:</td>'+
235                         '<td width="36">http://</td>'+
236                         '<td colspan="2"><input type="text" name="acsURL" size="60" maxlength="249"></td>'+
237                         '</tr>'+
238                         '<table>';
239                         
240                 document.getElementById('trustCA').innerHTML = '';
241         }
242         
243         if(tr69AcsUrl.indexOf("https://") == 0){
244                 acsURL.value = tr69AcsUrl.substr("https://".length, tr69AcsUrl.length - "https://".length);
245         }else{
246                 acsURL.value = tr69AcsUrl.substr("http://".length, tr69AcsUrl.length - "http://".length);
247         }
248         
249   }     
250 }
251
252 function showInterval(enbl){
253   with ( document.forms[0] ) {
254         if(enbl == 1){
255                 document.getElementById('interval').innerHTML =
256                         '<table border="0" cellpadding="0" cellspacing="5">'+
257                         '<tr>'+                 
258                         '<td>Transmission Interval of Inform Request: <input type="text" name="informInterval" size="10" maxlength="10"> seconds</td>'+
259                         '</tr>'+
260                         '<table>';
261                         
262                 informInterval.value = tr69cInformInterval;
263         }else{
264                 document.getElementById('interval').innerHTML = '';
265         }
266         
267   }
268 }
269
270 function btnCancel() {
271         var loc = 'tr69cfg.html';
272         var code = 'window.location.href="/';
273         code += loc + '"';
274         eval(code);
275 }
276
277 // done hiding -->
278 </script>
279    </head>
280    <body onLoad='frmLoad()'>      
281          <form class="formpadding">
282 <table border="0" cellpadding="0" cellspacing="3" width="98%">
283 <tr>
284   <td><b><font class="netgear">TR-069 Client Configuration</font></b></td>
285 </tr>
286 <tr><td>&nbsp;</td></tr>
287 <tr>\r
288   <td background="liteblue.gif" height="12">&nbsp;</td>\r
289 </tr>
290 </table>
291            
292             <table border="0" cellpadding="0" cellspacing="0">
293             <tr>\r
294             <td width="592">
295             TR-069, a CPE WAN Management Protocol, allows the Auto-Configuration Server (ACS) to perform the auto-provisioning of settings, firmware updates, status and performance monitoring, and diagnostics to a collection of ADSL routers.
296             </td>\r
297             </tr></table>            
298             <br><br>
299 <!--<table border="0" cellpadding="0" cellspacing="5">               
300                <tr>
301                   <td width="184">Internet Connection:</td>
302                   <td><select name="ifName" id="ifName" size="1">
303                                 <option value="0">LAN</option>
304                                 </select></td>
305                   <td></td>
306                </tr>
307             </table>-->
308             <table border="0" cellpadding="0" cellspacing="5">               
309                <tr>
310                   <td width="180">Connect to ACS:</td>
311                   <td><input name='withSSL' type='radio' onClick="chgURL(0)">without SSL</td>
312                   <td><input name='withSSL' type='radio' onClick="chgURL(1)">with SSL</td>
313                   <td></td>
314                </tr>
315             </table>
316             <div id="acs">
317             </div>
318             <table border="0" cellpadding="0" cellspacing="5">               
319                <tr>
320                   <td>ACS User Name:</td>
321                   <td colspan="2"><input type='text' name='acsUser' size="30" maxlength="256"></td>
322                   <td rowspan="2" width="200" class="grey_comment">Used to authenticate this device when making a connection to ACS</td>
323                </tr>
324                <tr>
325                   <td>ACS Password:</td>
326                   <td colspan="2"><input type='password' name='acsPwd' size="30" maxlength="256"></td>
327                </tr>
328                <tr>
329                   <td>Connection Request User Name:</td>
330                   <td colspan="2"><input type='text' name='connReqUser' size="30" maxlength="256"></td>
331                   <td rowspan="2" width="200" class="grey_comment">Used to authenticate an ACS making a Connection Request to this device</td>
332                </tr>
333                <tr>
334                   <td>Connection Request Password:</td>
335                   <td colspan="2"><input type='password' name='connReqPwd' size="30" maxlength="256"></td>
336                </tr>               
337             </table>
338             <table border="0" cellpadding="0" cellspacing="5">
339                <tr>
340                   <td>Periodic Transmission of Inform Request:</td>
341                   <td><input name='inform' type='radio' onClick="showInterval(0)">Disabled</td>
342                   <td><input name='inform' type='radio' onClick="showInterval(1)">Enabled</td>                  
343                </tr>
344             </table>
345             <div id="interval">            
346             </div>
347             <br>
348             <div id="trustCA">            
349             </div>
350 <table border="0" cellpadding="0" cellspacing="3" width="98%">
351 <tr>\r
352   <td background="liteblue.gif" height="12">&nbsp;</td>\r
353 </tr>
354 </table>            
355             <table border="0" cellpadding="0" cellspacing="0">
356             <tr>\r
357             <td width="220" align="left">
358                <input type='button' onClick='btnApply()' value='Apply'>
359                <input type='button' onClick='btnCancel()' value='Cancel'>
360             </td>
361             <td align="left">
362                <input type='button' onClick='btnGet()' value='GetRPCMethods'>
363             </td>\r
364             </tr></table>
365          </form>
366          </P>
367    </body>
368 </html>