Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.25 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title></title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <link href="css/login.css?201403250129071175553184798" media="all" rel="stylesheet" />
  6. <link href="css/style.css?201403250129071175553184798" type='text/css' rel="stylesheet">
  7. <style type="text/css">
  8. #first{
  9. background-color:white;
  10. height:25px;
  11. text-align: center;
  12. color: red;
  13. position:absolute;
  14. width: 380px;
  15. top: 312px;
  16. }
  17. </style>
  18. <script language="JavaScript" src="js/md5.js?201403250129071175553184798"></script>
  19. <script language="JavaScript" src="js/sha256.js?201403250129071175553184798"></script>
  20. <script language="JavaScript" src="js/lib/jquery.min.js?201403250129071175553184798"></script>
  21. <script language="JavaScript" type="text/javascript">
  22. function GetRandCnt() { return '56626ff45dd863da4148044fe8f8dd45'; }
  23. function MD5(str) { return hex_md5(str); }
  24.  
  25. var CfgMode ='COMMON';
  26. var LoginTimes = 0;
  27. var ProductName = 'HG8247H';
  28. var Var_DefaultLang = 'english';
  29. var Var_LastLoginLang = '';
  30. var Language = '';
  31.  
  32. /* 有登录历史痕迹的,Language取历史痕迹的语言 */
  33. if(Var_LastLoginLang == '')
  34. {
  35. Language = Var_DefaultLang;
  36. }
  37. else
  38. {
  39. Language = Var_LastLoginLang;
  40. }
  41. var IsDefaultPwd = '1';
  42.  
  43. document.title = ProductName;
  44.  
  45. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  46. var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  47. -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  48. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1,
  49. -1, -1, -1, -1);
  50.  
  51. function base64encode(str) {
  52. var out, i, len;
  53. var c1, c2, c3;
  54.  
  55. len = str.length;
  56. i = 0;
  57. out = "";
  58. while (i < len) {
  59. c1 = str.charCodeAt(i++) & 0xff;
  60. if (i == len) {
  61. out += base64EncodeChars.charAt(c1 >> 2);
  62. out += base64EncodeChars.charAt((c1 & 0x3) << 4);
  63. out += "==";
  64. break;
  65. }
  66. c2 = str.charCodeAt(i++);
  67. if (i == len) {
  68. out += base64EncodeChars.charAt(c1 >> 2);
  69. out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  70. out += base64EncodeChars.charAt((c2 & 0xF) << 2);
  71. out += "=";
  72. break;
  73. }
  74. c3 = str.charCodeAt(i++);
  75. out += base64EncodeChars.charAt(c1 >> 2);
  76. out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  77. out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  78. out += base64EncodeChars.charAt(c3 & 0x3F);
  79. }
  80. return out;
  81. }
  82.  
  83. function isValidAscii(val)
  84. {
  85. for ( var i = 0 ; i < val.length ; i++ )
  86. {
  87. var ch = val.charAt(i);
  88. if ( ch < ' ' || ch > '~' )
  89. {
  90. return false;
  91. }
  92. }
  93. return true;
  94. }
  95.  
  96. function SetDivValue(Id, Value)
  97. {
  98. try
  99. {
  100. var Div = document.getElementById(Id);
  101. Div.innerHTML = Value;
  102. }
  103. catch(ex)
  104. {
  105.  
  106. }
  107. }
  108.  
  109. function setErrorStatus()
  110. {
  111. if (Language == 'english') {
  112. if ((LoginTimes > 0) && (LoginTimes < 3))
  113. {
  114. SetDivValue("DivErrPage", "Incorrect account/password combination. Please try again.");
  115. }
  116. else if (LoginTimes >= 3)
  117. {
  118. SetDivValue("DivErrPage", "Three failed login attempts. Please try again after 1 minute.");
  119. }
  120. }
  121. else {
  122. if (LoginTimes > 0 && LoginTimes < 3)
  123. {
  124. SetDivValue("DivErrPage", "用户名或密码错误,请重新登录。");
  125. }
  126. else if (LoginTimes >= 3)
  127. {
  128. SetDivValue("DivErrPage", "您已经登陆失败三次, 请一分钟后再试。");
  129. }
  130. }
  131. }
  132.  
  133. function base64decode(str) {
  134. var c1, c2, c3, c4;
  135. var i, len, out;
  136.  
  137. len = str.length;
  138. i = 0;
  139. out = "";
  140. while (i < len) {
  141. /* c1 */
  142. do {
  143. c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
  144. } while (i < len && c1 == -1);
  145. if (c1 == -1)
  146. break;
  147.  
  148. /* c2 */
  149. do {
  150. c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
  151. } while (i < len && c2 == -1);
  152. if (c2 == -1)
  153. break;
  154.  
  155. out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
  156.  
  157. /* c3 */
  158. do {
  159. c3 = str.charCodeAt(i++) & 0xff;
  160. if (c3 == 61)
  161. return out;
  162. c3 = base64DecodeChars[c3];
  163. } while (i < len && c3 == -1);
  164. if (c3 == -1)
  165. break;
  166.  
  167. out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
  168.  
  169. /* c4 */
  170. do {
  171. c4 = str.charCodeAt(i++) & 0xff;
  172. if (c4 == 61)
  173. return out;
  174. c4 = base64DecodeChars[c4];
  175. } while (i < len && c4 == -1);
  176. if (c4 == -1)
  177. break;
  178. out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
  179. }
  180. return out;
  181. }
  182.  
  183. function SubmitForm() {
  184. var Username = document.getElementById('txt_Username');
  185. var Password = document.getElementById('txt_Password');
  186. var appName = navigator.appName;
  187. var version = navigator.appVersion;
  188.  
  189. if (Language == "chinese") {
  190. if (appName == "Microsoft Internet Explorer")
  191. {
  192. var versionNumber = version.split(" ")[3];
  193. if (parseInt(versionNumber.split(";")[0]) < 6)
  194. {
  195. alert("不支持IE6.0以下版本。");
  196. return false;
  197. }
  198. }
  199.  
  200. if (Username.value == "") {
  201. alert("用户名不能为空。");
  202. Username.focus();
  203. return false;
  204. }
  205.  
  206. if (!isValidAscii(Username.value))
  207. {
  208. alert("用户名包含非ASCII字符。");
  209. Username.focus();
  210. return false;
  211. }
  212.  
  213. if (Password.value == "") {
  214. alert("密码不能为空。");
  215. Password.focus();
  216. return false;
  217. }
  218.  
  219. if (!isValidAscii(Password.value))
  220. {
  221. alert("密码包含非ASCII字符。");
  222. Password.focus();
  223. return false;
  224. }
  225.  
  226. }
  227. else
  228. {
  229. if (appName == "Microsoft Internet Explorer")
  230. {
  231. var versionNumber = version.split(" ")[3];
  232. if (parseInt(versionNumber.split(";")[0]) < 6)
  233. {
  234. alert("We cannot support the IE version which is lower than 6.0.");
  235. return false;
  236. }
  237. }
  238.  
  239. if (Username.value == "") {
  240. alert("Account is a required field.");
  241. Username.focus();
  242. return false;
  243. }
  244.  
  245. if (!isValidAscii(Username.value))
  246. {
  247. alert("Account is invalid.");
  248. Username.focus();
  249. return false;
  250. }
  251.  
  252. if (Password.value == "") {
  253. alert("Password is a required field.");
  254. Password.focus();
  255. return false;
  256. }
  257.  
  258. if (!isValidAscii(Username.value))
  259. {
  260. alert("Password is invalid.");
  261. Password.focus();
  262. return false;
  263. }
  264.  
  265. }
  266. /*让浏览器中已存在的COOKIE立即实效*/
  267. var cookie = document.cookie;
  268. if ("" != cookie)
  269. {
  270. var date=new Date();
  271. date.setTime(date.getTime()-10000);
  272. var cookie22 = cookie + ";expires=" + date.toGMTString();
  273. document.cookie=cookie22;
  274. }
  275. var cnt = GetRandCnt();
  276. var cookie2 = "Cookie=" + "rid=" + SHA256("" + cnt) + SHA256(Username.value + cnt ) + SHA256(SHA256(MD5(Password.value)) + cnt) + ":" + "Language:" + Language + ":" +"id=-1;path=/";
  277. document.cookie = cookie2;
  278.  
  279. Username.disabled = true;
  280. Password.disabled = true;
  281.  
  282. window.location.replace('/login.cgi');
  283. return true;
  284. }
  285.  
  286. function setPromptInfo()
  287. {
  288. if (Language == 'english')
  289. {
  290. SetDivValue("DivErrPage", "The administrator uses the initial password. If you want to change this password, please contact the telecom carrier. For details about how to change the password, see the Security Maintenance from http://support.huawei.com.");
  291. }
  292. else if(Language == 'portuguese')
  293. {
  294. SetDivValue("DivErrPage", "The administrator uses the initial password. If you want to change this password, please contact the telecom carrier. For details about how to change the password, see the Security Maintenance from http://support.huawei.com.");
  295. }
  296. else if(Language == 'japanese')
  297. {
  298. SetDivValue("DivErrPage", "The administrator uses the initial password. If you want to change this password, please contact the telecom carrier. For details about how to change the password, see the Security Maintenance from http://support.huawei.com.");
  299. }
  300. else
  301. {
  302. SetDivValue("DivErrPage", "The administrator uses the initial password. If you want to change this password, please contact the telecom carrier. For details about how to change the password, see the Security Maintenance from http://support.huawei.com.");
  303. }
  304. }
  305.  
  306. function LoadFrame() {
  307. document.getElementById('txt_Username').focus();
  308. /*让浏览器中已存在的COOKIE立即实效*/
  309. var cookie = document.cookie;
  310. if ("" != cookie)
  311. {
  312. var date=new Date();
  313. date.setTime(date.getTime()-10000);
  314. var cookie22 = cookie + ";expires=" + date.toGMTString();
  315. document.cookie=cookie22;
  316. }
  317. var UserLeveladmin = '1';
  318.  
  319. if (Language == "chinese") {
  320. document.getElementById('Chinese').style.color = '#9b0000';
  321. document.getElementById('English').style.color = '#434343';
  322. document.getElementById('account').innerHTML = '用户名';
  323. document.getElementById('Password').innerHTML = '密 码';
  324. document.getElementById('button').innerHTML = '登录';
  325. document.getElementById('footer').innerHTML = '版权所有 © 华为技术有限公司 2009-2014。保留一切权利。';
  326. } else {
  327. document.getElementById('Chinese').style.color = '#434343';
  328. document.getElementById('English').style.color = '#9b0000';
  329. document.getElementById('account').innerHTML = 'Account';
  330. document.getElementById('Password').innerHTML = 'Password';
  331. document.getElementById('button').innerHTML = 'Login';
  332. document.getElementById('footer').innerHTML = 'Copyright © Huawei Technologies Co., Ltd 2009-2014. All rights reserved';
  333. }
  334.  
  335. if (1 == IsDefaultPwd)
  336. {
  337. document.getElementById('loginfail').style.display = '';
  338. setPromptInfo();
  339. }
  340.  
  341. if ((LoginTimes != null) && (LoginTimes != '') && (LoginTimes > 0)) {
  342. document.getElementById('loginfail').style.display = '';
  343. setErrorStatus();
  344. }
  345. init();
  346.  
  347. if((UserLeveladmin == '0'))
  348. {
  349. alert("The current user is not allowed to login.");
  350. return false;
  351. }
  352. }
  353.  
  354. function init() {
  355. if (document.addEventListener) {
  356. document.addEventListener("keypress", onHandleKeyDown, false);
  357. } else {
  358. document.onkeypress = onHandleKeyDown;
  359. }
  360. }
  361. function onHandleKeyDown(event) {
  362. var e = event || window.event;
  363. var code = e.charCode || e.keyCode;
  364.  
  365. if (code == 13) {
  366. SubmitForm();
  367. }
  368. }
  369. function onChangeLanguage(language) {
  370. Language = language;
  371. if (language == "chinese") {
  372. document.getElementById('Chinese').style.color = '#9b0000';
  373. document.getElementById('English').style.color = '#434343';
  374. document.getElementById('account').innerHTML = '用户名';
  375. document.getElementById('Password').innerHTML = '密 码';
  376. document.getElementById('button').innerHTML = '登录';
  377. document.getElementById('footer').innerHTML = '版权所有 © 华为技术有限公司 2009-2014。保留一切权利。';
  378. } else {
  379. document.getElementById('Chinese').style.color = '#434343';
  380. document.getElementById('English').style.color = '#9b0000';
  381. document.getElementById('account').innerHTML = 'Account';
  382. document.getElementById('Password').innerHTML = 'Password';
  383. document.getElementById('button').innerHTML = 'Login';
  384. document.getElementById('footer').innerHTML = 'Copyright © Huawei Technologies Co., Ltd 2009-2014. All rights reserved.';
  385. }
  386.  
  387. if (1 == IsDefaultPwd)
  388. {
  389. document.getElementById('loginfail').style.display = '';
  390. setPromptInfo();
  391. }
  392.  
  393. if ((LoginTimes != null) && (LoginTimes != '') && (LoginTimes > 0))
  394. {
  395. document.getElementById('loginfail').style.display = '';
  396. setErrorStatus();
  397. }
  398. }
  399. </script>
  400. </head>
  401. <body onLoad="LoadFrame();">
  402. <div id="main_wrapper">
  403. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  404. <tr>
  405. <td align="center" height="210" valign="bottom"> <table border="0" cellpadding="0" cellspacing="0" width="36%">
  406. <tr>
  407. <td align="center" width="29%">
  408.  
  409. <script language="JavaScript" type="text/javascript">
  410. if ( 'STC' == CfgMode.toUpperCase())
  411. {
  412. document.write('<img height="76" src="images/logo_stc.gif" width="188" alt="">');
  413. }
  414. else
  415. {
  416. document.write('<img height="75" src="images/logo.gif" width="70" alt="">');
  417. }
  418. </script>
  419. </td>
  420. <td class="hg_logo" width="21%" id="hg_logo" nowrap> <script language="JavaScript" type="text/javascript">
  421. document.write(ProductName);
  422. </script> </td>
  423. <td valign="bottom" width="50%"> <table border="0" cellpadding="0" cellspacing="0" class="text_copyright" width="100%">
  424. <tr>
  425. <td width="47%" nowrap> <a id="English" href="#" name="English" title="English" style="font-size:12px;font-family:Arial;"></a> </td>
  426. <td width="53%" nowrap> <a id="Chinese" href="#" name="Chinese" title="Chinese" style="font-size:12px;font-family:Arial;"></a> </td>
  427. </tr>
  428. </table></td>
  429. </tr>
  430. </table></td>
  431. </tr>
  432. <tr>
  433. <td align="center" height="65"> <table border="0" cellpadding="0" cellspacing="0" class="tblcalss" height="65" width="40%">
  434. <tr>
  435. <td class="whitebold" height="37" align="right" width="20%" id="account">Account</td>
  436. <td class="whitebold" height="37" align="center" width="2%">:</td>
  437. <td width="78%"> <input style="font-size:12px;font-family:Tahoma,Arial;" id="txt_Username" class="input_login" name="txt_Username" type="text" maxlength="31"> </td>
  438. </tr>
  439. <tr>
  440. <td class="whitebold" height="28" align="right" id="Password">Password</td>
  441. <td class="whitebold" height="28" align="center" >:</td>
  442. <td> <input style="font-size:12px;font-family:Tahoma,Arial;" id="txt_Password" class="input_login" name="txt_Password" type="password" maxlength="127">
  443. &nbsp;
  444. <button style="font-size:12px;font-family:Tahoma,Arial;" id="button" class="submit" name="Submit" onClick="SubmitForm();" type="button">Login</button></td>
  445. </tr>
  446. </table></td>
  447. </tr>
  448. <tr>
  449. <td class="info_text" height="25" id="footer">Copyright © Huawei Technologies Co., Ltd 2009-2014. All rights reserved. </td>
  450. </tr>
  451. <tr>
  452. <td align="center"> <table border="0" cellpadding="0" cellspacing="0" height="300" width="490" style="background: url('images/pic.jpg') no-repeat center;">
  453. <tr>
  454. <td valign="top" style="padding-top: 20px;"> <div id="loginfail" style="display: none">
  455. <table border="0" cellpadding="0" cellspacing="5" height="33" width="99%">
  456. <tr>
  457. <td align="center" bgcolor="#FFFFFF" height="21"> <span style="color:red;font-size:12px;font-family:Arial;">
  458. <div id="DivErrPage"></div>
  459. </span> </td>
  460. </tr>
  461. </table>
  462. </div></td>
  463. </tr>
  464. </table></td>
  465. </tr>
  466. </table>
  467. </div>
  468. </body>
  469. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement