Advertisement
Guest User

D-Link Modem Gateway Source code

a guest
Jan 18th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.71 KB | None | 0 0
  1.  
  2.  
  3.  
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <title>ADSL Router --Dlink</title>
  9. <style type="text/css">
  10. <!--
  11. body { margin:0px auto; padding:3px; font:12px Tahoma,Helvetica,Geneva,Arial,sans-serif; background:#757575;}
  12. .Content { margin:0px auto; padding:0px 1px; width:840px; height:460px; background:white;}
  13. .title { padding:5px 6px 3px; height:20px; background:#404343; color:white;}
  14. .product { float:left; }
  15. .firmware { float:right;}
  16. .logo { margin:6px 0 40px 0; background:#F36D23;}
  17. .login_bk { margin:0 auto; padding:5px; width:600px; height:208px; background:#F1F1F1;}
  18. .login { height:206px; border:1px solid #F36D23; background:#DFDFDF; text-align:center;}
  19. .login_title { padding:5px 10px; height:15px; font-weight:bold; background:#F36D23; text-align:left;}
  20. p#lang_tips { text-align:left; margin:10px 10px 25px;}
  21. .div_left { padding:0px 2px 0px; float:left; width:250px; text-align:right; font-weight:bold; height:25px}
  22. .div_right { padding:0px 2px 0px; float:right; width:337px; text-align:left; font-weight:bold; height:25px}
  23. .do { margin-top:10px;}
  24. .div_button { margin-top:20px;}
  25. .footer { margin-top:43px; background:#404343;}
  26. p#copyright { color:#F1F1F1; text-align:center; font-size:11px; margin:10px;}
  27. -->
  28. </style>
  29. </head>
  30. <script type="text/javascript" src="/html/languages/en_us/main.js"></script>
  31. <script type="text/javascript" src="/html/languages/en_us/error.js"></script>
  32. <script type="text/javascript" src="/html/js/boot.js"></script>
  33. <script type="text/javascript">
  34. <!--
  35. /*---- Global variable define -----*/
  36. var G_Error = "1";
  37. var G_Status = "0";
  38. var G_Error_Msg = "result=12119007";
  39.  
  40. //support language
  41. var G_SupportLang = "en_us";
  42. //default language
  43. var G_DefaultLang = "en_us";
  44.  
  45. //Init
  46. //get user info
  47. var G_UserInfo = new Array();
  48. var m = 0;
  49. G_UserInfo[m] = new Array();
  50. G_UserInfo[m][0] = "admin"; //UserName
  51. G_UserInfo[m][2] = "1"; //Level
  52. G_UserInfo[m][3] = "1"; //Index
  53. m++;
  54.  
  55.  
  56. //加载语言列表
  57. function createLangsOptions(){
  58. var _text = [], _value = [];
  59. var split_lang = G_SupportLang.split(";");
  60. for(var i = 0; i < split_lang.length; i++){
  61. if(split_lang[i] == 'en_us'){
  62. _text.push('English');
  63. } else if(split_lang[i] == 'zh_cn'){
  64. _text.push('简体中文');
  65. }
  66. _value.push(split_lang[i]);
  67. }
  68.  
  69. $S('SELECT_Language', _text, _value);
  70. }
  71.  
  72. function uiOnload(){
  73. if(top.location!=self.location){
  74. top.location=self.location;
  75. return false;
  76. }
  77. //search language
  78. Cookie.Set('language',G_DefaultLang);
  79. chg_language(data_language);
  80. //create user option
  81. createUserOpt();
  82. //$('SELECT_UserName').value = 'admin';
  83. var Psd = Cookie.Get('TBSPASSWORD');
  84.  
  85. if(Psd){
  86. Form.Checkbox('INPUT_Remember', '1');
  87. $('INPUT_Psd').value = Psd;
  88. }
  89. $('INPUT_Psd').focus();
  90.  
  91. dealWithError();
  92. }
  93.  
  94. function createUserOpt(){
  95. var _text = [], _value = [];
  96. var formIp = '192.168.1.12';
  97.  
  98. if(formIp.indexOf('192.168') > -1){
  99. _text = [G_UserInfo[0][0]], _value = [G_UserInfo[0][0]];
  100. } else {
  101. _text = [G_UserInfo[0][0]], _value = [G_UserInfo[0][0]];
  102. }
  103. $S('SELECT_UserName', _text, _value);
  104. }
  105.  
  106. function uipostLogin(){
  107. if($('INPUT_Psd').value == ''){
  108. alert("Password can not be empty!");
  109. return false;
  110. }
  111. //record password
  112. recordPsd();
  113. //record level
  114. Cookie.Set('sys_UserName', $('SELECT_UserName').value);
  115. Cookie.Set('sessionid', '41726706');
  116. $H({
  117. 'getpage' :'html/index.html',
  118. 'errorpage' :'html/main.html',
  119. 'var:menu' :'setup',
  120. 'var:page' :'wizard',
  121. 'obj-action':'auth',
  122. ':username' :$('SELECT_UserName').value,
  123. ':password' :$("INPUT_Psd").value,
  124. ':action' :'login',
  125. ':sessionid':'41726706'
  126. },true);
  127. $('uiPostForm').submit();
  128. }
  129.  
  130. function recordPsd(){
  131. if(Form.Checkbox('INPUT_Remember')){ //checked = true;
  132. Cookie.Set('TBSPASSWORD', $('INPUT_Psd').value, 720);
  133. } else if(!Form.Checkbox('INPUT_Remember')){ //checked = false;
  134. Cookie.Delete('TBSPASSWORD');
  135. }
  136. }
  137.  
  138. /* 更换main.html语言 */
  139. function onChgLang(){
  140. setCookie('language', $('SELECT_Language').value);
  141. document.location.href = '/cgi-bin/webproc';
  142. }
  143.  
  144. /*
  145. 对错误码的处理
  146. 错误码的格式:节点名=错误码
  147. */
  148. function dealErrorMsg(arrayNode, errorMsg){
  149. if (typeof errorMsg != 'string')
  150. return;
  151.  
  152. //将错误信息一分为二:前段寻找错误码对应的节点;后段寻找错误码对应的提示;
  153. var errorFragment = errorMsg.split('=');
  154. var errorCode, errorString, leafNode;
  155.  
  156. //寻找错误码对应的节点;
  157. if (errorFragment != null && errorFragment.length > 0){
  158. var _fragment = errorFragment[0].split('.');
  159. leafNode = _fragment[_fragment.length - 1];
  160. leafNode = arrayNode[leafNode];
  161. }
  162.  
  163. //在获取错误码后,立即寻找相应的错误码。
  164. if (errorFragment[1] != null){
  165. errorCode = errorFragment[1].match(/^[0-9]{4}/)[0];
  166. } else {
  167. if (errorMsg.match(/^[0-9]{4}/) == null){
  168. leafNode = arrayNode["result"];
  169.  
  170. if($(leafNode)){
  171. $(leafNode).innerHTML = errorMsg;
  172. }
  173. return false;
  174. }
  175. errorCode = errorMsg.match(/^[0-9]{4}/)[0];
  176. }
  177.  
  178. if(UEcode[errorCode] !== undefined){
  179. errorString = UEcode[errorCode];
  180. } else if (SEcode[errorCode] !== undefined ) {
  181. errorString = SEcode[errorCode];
  182. } else {
  183. errorString = SEcode[1000];
  184. }
  185.  
  186. //选择两种不同的错误提示方式:1、将错误准确打印在对应的输入框之后;2、对于未知错误,以告警框来提示;
  187. if (leafNode != undefined){
  188. $(leafNode).innerHTML = errorString;
  189. } else {
  190. alert(errorString + "!");
  191. }
  192. }
  193.  
  194. function dealWithError(){
  195. if(G_Error != 1){
  196. return false;
  197. }
  198.  
  199. var arrayHint = [];
  200.  
  201. dealErrorMsg(arrayHint, G_Error_Msg);
  202. }
  203.  
  204. window.onload = uiOnload;
  205. -->
  206. </script>
  207. <body>
  208. <!-- content -->
  209. <div class="Content">
  210. <!-- title -->
  211. <div class="title">
  212. <div class="product"><span id = "lang_product_main">Product Page</span>: DSL-2750U</div><div class="firmware"><span id = "lang_firmware_main">Firmware Version</span>:OM_1.01</div>
  213. </div>
  214. <!-- logo -->
  215. <div class="logo"><img src="/html/skin/logo.gif" alt="logo"/><img src="/html/skin/omantel.GIF" alt="logo" height="86" align="right"/></div>
  216. <!-- login background -->
  217. <div class="login_bk">
  218. <!-- login -->
  219. <div class="login">
  220. <!-- login title -->
  221. <div class="login_title" id = "lang_title">LOGIN</div>
  222. <!-- tips-->
  223. <p id="lang_tips">Input username and password</p>
  224. <!-- username/password -->
  225. <div class="div_left" id="lang_username">Username :</div><div class="div_right"> <select id="SELECT_UserName"><option> </option></select></div>
  226. <p>
  227. <p>
  228. <div class="div_left" id="lang_password">Password :</div><div class="div_right"> <input type="password" id="INPUT_Psd" value="" onKeyDown='if(event.keyCode==13)uipostLogin()' /></div>
  229. <!-- remember me -->
  230. <p>
  231. <p>
  232. <div><input type="checkbox" id="INPUT_Remember" /> <label for="INPUT_Remember" id = "lang_login">Remember my login info. on this computer</label></div>
  233. <!-- submit -->
  234. <div class="div_button"><input type="button" name="uipostSubmit" id="uipostSubmit" value="Login" onClick="uipostLogin()"/></div>
  235. </div>
  236. <!-- login failed -->
  237. </div>
  238. <!-- footer -->
  239. <div class="footer"><img src="/html/skin/broadband.gif" /></div>
  240. </div>
  241. <!-- copyright-->
  242. <p id="copyright">Copyright © 2013-2015 D-Link Systems, Inc.</p>
  243. <!-- form -->
  244. <form name="uiPostForm" id="uiPostForm" method="post" action="webproc"></form>
  245. </body>
  246. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement