Advertisement
Guest User

Untitled

a guest
Apr 30th, 2014
994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.01 KB | None | 0 0
  1. Em.I18n.addTranslations({
  2. "deviceinfo.title": "System Information",
  3. "deviceinfo.description": "View detailed information about the HG659.",
  4. "deviceinfo.product_type": "Product type",
  5. "deviceinfo.device_id": "Device ID",
  6. "deviceinfo.hardware": "Hardware version",
  7. "deviceinfo.software": "Software version",
  8. "deviceinfo.uptime": "System up time",
  9. "deviceinfo.temp.title": "Device Temperature",
  10. "deviceinfo.device.name": "Device name",
  11. "deviceinfo.device.temp": "Device temperature",
  12. "deviceinfo.internetstatus.title": "Internet Status",
  13. "deviceinfo.internetstatus": "Internet status",
  14. "deviceinfo.basicinfo": "Basic Information",
  15. "deviceinfo.internettype": "Internet access type",
  16. "deviceinfo.internetonline": "Internet up time",
  17. "deviceinfo.ip": "IP Address",
  18. "deviceinfo.mac": "MAC Address",
  19. "wlan.info.title": "WLAN Information"
  20. });
  21. Em.I18n.addTranslations({
  22. "UserLogin.UserName": "Username",
  23. "UserLogin.Password": "Password",
  24. "UserLogin.LoginLabel": "Log in",
  25. "UserLogin.CancelLabel": "Cancel",
  26. "UserLogin.user_pass_blank": "Username or password is empty. Please fill in these entries. ",
  27. "UserLogin.GateWay_info": "Status Information",
  28. "UserLogin.user_pass_err": "Username or password error. You have failed {{arg1}} times.",
  29. "UserLogin.user_pass_err.one": "Username or password error. You have failed {{arg1}} time.",
  30. "UserLogin.Resolve": "How to get your username and password?",
  31. "UserLogin.forgetps": "Forget password?",
  32. "UserLogin.Login_Invalid_IP": "Login from invalid IP.",
  33. "UserLogin.Three_time_err": "You have failed {{arg1}} times. Please try again in a minute.",
  34. "UserLogin.Too_Many_user": "Too many users login!",
  35. "UserLogin.Duplicate_login": "You are already logged in.",
  36. "UserLogin.username_password": "Find your default login password",
  37. "UserLogin.defaultup": "The default password can be found on the rating plate of your device.",
  38. "UserLogin.defaultup_guide": "The default password can be found in the user guide.",
  39. "UserLogin.restore_username_password": "Restore the default login password",
  40. "UserLogin.restore_attention": "Attention:All settings you have made will be lost you restore the device to factory settings.",
  41. "UserLogin.restoredefaultop": "If you have modified the login password and forget it, you can press the 'Reset' button for 10 seconds to restore the factory settings,so that the default login password can be used.The default login password can be found on the rating plate of you device.",
  42. "UserLogin.restoredefaultop_guide": "If you have modified the login password and forget it,you can press the 'Reset' button for 10 seconds to restore the factory settings,so that the default login password can be used.The default login password can be found in the user guide.",
  43. "UserLogin.wifi.in24": "WLAN 2.4 GHz frequency band:",
  44. "UserLogin.wifi.in5": "WLAN 5 GHz frequency band:",
  45. "index.Login": "Login",
  46. "index.internet.status": "Internet status:",
  47. "index.internet.type": "Internet connection type:",
  48. "index.internet.time": "Connection duration:",
  49. "index.lan.devicecount": "LAN connected devices:",
  50. "index.printer.number": "Printers:",
  51. "index.usbstorage.number": "USB storage devices:",
  52. "index.datacard.number": "Datacards:",
  53. "index.usb.number": "USB devices:",
  54. "index.voice.number": "SipPhone devices:",
  55. "index_internet.Useless": "Internet is unavailable",
  56. "index_internet.Connected": "Connected",
  57. "index_internet.Disconnected": "Disconnected",
  58. "index_internet.Fault": "Error",
  59. "index_internet.NormalDisconnect": "Normal Disconnection",
  60. "index_internet.Unknown": "Unknown Error",
  61. "index_internet.ErrAuthFail": "Authentication failed.",
  62. "index_internet.ErrNoAnswer": "No response from server",
  63. "index_internet.ErrConnectFail": "No IP Address",
  64. "index_internet.ErrLayer2Down": "Disconnected",
  65. "UserLogin.firsttime_title": "Notice",
  66. "UserLogin.firsttime_body": "Your login password is the default one. Please modify it for network security.",
  67. "UserLogin.changePassword": "Modify Login Password",
  68. "UserLogin.notice": "Do not prompt again"
  69. });
  70. Em.I18n.addTranslations({
  71. "home.title": "I want to ...",
  72. "home.continue_wifi": "Try WLAN",
  73. "home.cable_detect_again": "Try Again",
  74. "home.datacard_pin": "Internet access through cable failed, you can unlock datacard to access Internet.",
  75. "home.datacard_connect": "Your datacard is ready, you can access Internet now.",
  76. "home.datacard_disconnect": "You are accessing Internet through datacard, you can disconnect here:",
  77. "home.internet.cable_err": 'Cable error[8180]. Please make sure the cable is connected to the gateway properly. If the cable connection is secure, click "Try Again". You can also click Try WLAN to set up a WLAN connection. ',
  78. "home.internet.unknown_err": "Unknown Error[8180].",
  79. "home.internet.fail_ISP": "Your device can not connect to Internet, please contact your ISP (Internet Service Provider).",
  80. "home.internet.fail_Huawei": 'You can call Service Center of Huawei Device by 400-830-8300, or you can visit the web site <a href="http://www.huaweidevice.com">http://www.huaweidevice.com</a>.',
  81. "home.internet.fail_timeout": "Connect to Internet timed out[8180].",
  82. "home.internet.scan_fail": "Scanning Internet connection failed.",
  83. "home.internet.pvc_fail": "Your PVC is probably wrong. You can contact your ISP (Internet Service Provider) to get the right PVC and connect again.",
  84. "home.internet.origin_url": "Continue access original web site in {{arg1}} seconds: ",
  85. "home.internet.title": "Start Wizard",
  86. "home.internet.Connectlabel": "Connection Status: ",
  87. "home.internet.operation": "I want to",
  88. "home.internet.choosetype": "Select your Internet connection mode:",
  89. "home.internet.umts": "You can access Internet through data card now",
  90. "home.internet.moretypes": "More Internet connection modes",
  91. "home.internet.ispaccount": "Please enter the username and password you received from your ISP.",
  92. "home.internet.showpassword": "Show password",
  93. "home.internet.connecting": "Connecting to the Internet…",
  94. "home.internet.scanning": "Scanning for Internet connection…",
  95. "home.internet.diagnosing": "Diagnosing your Internet connection ...",
  96. "home.internet.recommend_scan": 'Your Internet connection is disconnected. You can press "Connect" to scan Internet connection.',
  97. "home.internet.change": "Your Internet connection is change.",
  98. "home.internet.connectingSuccess": "Internet connected.",
  99. "home.wifi.status": "WLAN status:",
  100. "home.wifi.title": "Set Up WLAN",
  101. "home.wifi.lable": "WLAN",
  102. "home.wifi.users": "WLAN devices: ",
  103. "home.wifi.title.config": "Set up a WLAN Connection",
  104. "home.wifi.twofourghz": "2.4 GHz",
  105. "home.wifi.passwordplace": "The default WLAN account information is printed on the label. Enable WLAN by turning the switch on. You can also modify the SSID and password here.",
  106. "home.wifi.off": "OFF",
  107. "home.wifi.on": "ON",
  108. "home.wifi.access24id": "WLAN 2.4 GHz SSID",
  109. "home.wifi.access24id_err": "WLAN 2.4 GHz SSID cannot be left empty.",
  110. "home.wifi.fiveghz": "5 GHz",
  111. "home.wifi.access5id": "WLAN 5 GHz SSID",
  112. "home.wifi.access5id_err": "WLAN 5 GHz SSID cannot be left empty.",
  113. "home.wifi.password_err": "Password cannot be left empty.",
  114. "home.wifi.samewithfon": "The SSID is same with the Fon SSID.",
  115. "home.network.title": "Check My Network Status",
  116. "home.network.Statuslabel": "Connected devices:",
  117. "home.network.connect_normal": "Normal",
  118. "home.network.connect_disconnect": "disconnect",
  119. "home.network.mynetwork": "My Network",
  120. "home.network.more": "More",
  121. "home.network.fold": "Hide",
  122. "home.network.wifidevice": "Connected WLAN Devices",
  123. "home.network.ethdevice": "Connected Ethernet Devices",
  124. "home.network.voicedevice": "Phone Devices",
  125. "home.network.internet": "Internet",
  126. "home.network.atp": "Gateway",
  127. "home.network.usbdevice": "Connected USB Devices",
  128. "network.usb.info": "Here just show space usage of USB device you clicked, for more configuration, eg: FTP Service、media sharing and so on,you can visite config pages.",
  129. "home.network.usb_used": "Used : ",
  130. "home.network.usb_left": "Free :",
  131. "home.network.backup": "create a shortcut"
  132. });
  133. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  134. 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, -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, 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, -1, -1, -1, -1);
  135.  
  136. function base64Encode(g) {
  137. var c, e, a;
  138. var f, d, b;
  139. a = g.length;
  140. e = 0;
  141. c = "";
  142. while (e < a) {
  143. f = g.charCodeAt(e++) & 255;
  144. if (e == a) {
  145. c += base64EncodeChars.charAt(f >> 2);
  146. c += base64EncodeChars.charAt((f & 3) << 4);
  147. c += "==";
  148. break
  149. }
  150. d = g.charCodeAt(e++);
  151. if (e == a) {
  152. c += base64EncodeChars.charAt(f >> 2);
  153. c += base64EncodeChars.charAt(((f & 3) << 4) | ((d & 240) >> 4));
  154. c += base64EncodeChars.charAt((d & 15) << 2);
  155. c += "=";
  156. break
  157. }
  158. b = g.charCodeAt(e++);
  159. c += base64EncodeChars.charAt(f >> 2);
  160. c += base64EncodeChars.charAt(((f & 3) << 4) | ((d & 240) >> 4));
  161. c += base64EncodeChars.charAt(((d & 15) << 2) | ((b & 192) >> 6));
  162. c += base64EncodeChars.charAt(b & 63)
  163. }
  164. return c
  165. }
  166.  
  167. function base64Decode(h) {
  168. var g, f, d, b;
  169. var e, a, c;
  170. a = h.length;
  171. e = 0;
  172. c = "";
  173. while (e < a) {
  174. do {
  175. g = base64DecodeChars[h.charCodeAt(e++) & 255]
  176. } while (e < a && g == -1);
  177. if (g == -1) {
  178. break
  179. }
  180. do {
  181. f = base64DecodeChars[h.charCodeAt(e++) & 255]
  182. } while (e < a && f == -1);
  183. if (f == -1) {
  184. break
  185. }
  186. c += String.fromCharCode((g << 2) | ((f & 48) >> 4));
  187. do {
  188. d = h.charCodeAt(e++) & 255;
  189. if (d == 61) {
  190. return c
  191. }
  192. d = base64DecodeChars[d]
  193. } while (e < a && d == -1);
  194. if (d == -1) {
  195. break
  196. }
  197. c += String.fromCharCode(((f & 15) << 4) | ((d & 60) >> 2));
  198. do {
  199. b = h.charCodeAt(e++) & 255;
  200. if (b == 61) {
  201. return c
  202. }
  203. b = base64DecodeChars[b]
  204. } while (e < a && b == -1);
  205. if (b == -1) {
  206. break
  207. }
  208. c += String.fromCharCode(((d & 3) << 6) | b)
  209. }
  210. return c
  211. };
  212.  
  213. function SHA256(p) {
  214. var k = 8;
  215. var n = 0;
  216.  
  217. function i(q, t) {
  218. var s = (q & 65535) + (t & 65535);
  219. var r = (q >> 16) + (t >> 16) + (s >> 16);
  220. return (r << 16) | (s & 65535)
  221. }
  222.  
  223. function e(r, q) {
  224. return (r >>> q) | (r << (32 - q))
  225. }
  226.  
  227. function f(r, q) {
  228. return (r >>> q)
  229. }
  230.  
  231. function a(q, s, r) {
  232. return ((q & s) ^ ((~q) & r))
  233. }
  234.  
  235. function d(q, s, r) {
  236. return ((q & s) ^ (q & r) ^ (s & r))
  237. }
  238.  
  239. function g(q) {
  240. return (e(q, 2) ^ e(q, 13) ^ e(q, 22))
  241. }
  242.  
  243. function b(q) {
  244. return (e(q, 6) ^ e(q, 11) ^ e(q, 25))
  245. }
  246.  
  247. function o(q) {
  248. return (e(q, 7) ^ e(q, 18) ^ f(q, 3))
  249. }
  250.  
  251. function j(q) {
  252. return (e(q, 17) ^ e(q, 19) ^ f(q, 10))
  253. }
  254.  
  255. function c(r, s) {
  256. var E = new Array(1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298);
  257. var t = new Array(1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225);
  258. var q = new Array(64);
  259. var G, F, D, C, A, y, x, w, v, u;
  260. var B, z;
  261. r[s >> 5] |= 128 << (24 - s % 32);
  262. r[((s + 64 >> 9) << 4) + 15] = s;
  263. for (var v = 0; v < r.length; v += 16) {
  264. G = t[0];
  265. F = t[1];
  266. D = t[2];
  267. C = t[3];
  268. A = t[4];
  269. y = t[5];
  270. x = t[6];
  271. w = t[7];
  272. for (var u = 0; u < 64; u++) {
  273. if (u < 16) {
  274. q[u] = r[u + v]
  275. } else {
  276. q[u] = i(i(i(j(q[u - 2]), q[u - 7]), o(q[u - 15])), q[u - 16])
  277. }
  278. B = i(i(i(i(w, b(A)), a(A, y, x)), E[u]), q[u]);
  279. z = i(g(G), d(G, F, D));
  280. w = x;
  281. x = y;
  282. y = A;
  283. A = i(C, B);
  284. C = D;
  285. D = F;
  286. F = G;
  287. G = i(B, z)
  288. }
  289. t[0] = i(G, t[0]);
  290. t[1] = i(F, t[1]);
  291. t[2] = i(D, t[2]);
  292. t[3] = i(C, t[3]);
  293. t[4] = i(A, t[4]);
  294. t[5] = i(y, t[5]);
  295. t[6] = i(x, t[6]);
  296. t[7] = i(w, t[7])
  297. }
  298. return t
  299. }
  300.  
  301. function h(t) {
  302. var s = Array();
  303. var q = (1 << k) - 1;
  304. for (var r = 0; r < t.length * k; r += k) {
  305. s[r >> 5] |= (t.charCodeAt(r / k) & q) << (24 - r % 32)
  306. }
  307. return s
  308. }
  309.  
  310. function m(r) {
  311. r = r.replace(/\r\n/g, "\n");
  312. var q = "";
  313. for (var t = 0; t < r.length; t++) {
  314. var s = r.charCodeAt(t);
  315. if (s < 128) {
  316. q += String.fromCharCode(s)
  317. } else {
  318. if ((s > 127) && (s < 2048)) {
  319. q += String.fromCharCode((s >> 6) | 192);
  320. q += String.fromCharCode((s & 63) | 128)
  321. } else {
  322. q += String.fromCharCode((s >> 12) | 224);
  323. q += String.fromCharCode(((s >> 6) & 63) | 128);
  324. q += String.fromCharCode((s & 63) | 128)
  325. }
  326. }
  327. }
  328. return q
  329. }
  330.  
  331. function l(s) {
  332. var r = n ? "0123456789ABCDEF" : "0123456789abcdef";
  333. var t = "";
  334. for (var q = 0; q < s.length * 4; q++) {
  335. t += r.charAt((s[q >> 2] >> ((3 - q % 4) * 8 + 4)) & 15) + r.charAt((s[q >> 2] >> ((3 - q % 4) * 8)) & 15)
  336. }
  337. return t
  338. }
  339. p = m(p);
  340. return l(c(h(p), p.length * k))
  341. };
  342. Ember.TEMPLATES.user_login_0 = Ember.Handlebars.template(function anonymous(d, k, c, i, h) {
  343. this.compilerInfo = [3, ">= 1.0.0-rc.4"];
  344. c = c || Ember.Handlebars.helpers;
  345. h = h || {};
  346. var f = "",
  347. a, e, b, l, j = c.helperMissing,
  348. g = this.escapeExpression;
  349. h.buffer.push('\n <div class="accordion-heading marginright_35"> \n <div id="collapseinfo_1" class="text_right paddingright_15 index_page_font_color accordion-toggle text_underline">');
  350. e = {};
  351. b = {};
  352. l = {
  353. hash: {},
  354. contexts: [k],
  355. types: ["ID"],
  356. hashContexts: b,
  357. hashTypes: e,
  358. data: h
  359. };
  360. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.Resolve", l) : j.call(k, "t", "UserLogin.Resolve", l))));
  361. h.buffer.push('</div> \n </div> \n <div id="collapse_1" class="hide"> \n <div class="accordion-inner"> \n <div class="rounddiv getaccount_part"> \n <div class="bodydiv rounddiv paddingtop_8 getaccount_part_body index_page_font_color" align="center"> \n &nbsp;&nbsp;&nbsp;');
  362. e = {};
  363. b = {};
  364. l = {
  365. hash: {},
  366. contexts: [k],
  367. types: ["ID"],
  368. hashContexts: b,
  369. hashTypes: e,
  370. data: h
  371. };
  372. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.username_password", l) : j.call(k, "t", "UserLogin.username_password", l))));
  373. h.buffer.push('</div> \n <div class="bodydiv rounddiv getaccount_info paddingbottom_20" align="center"> \n <div class="index_page_font_color text_left">');
  374. e = {};
  375. b = {};
  376. l = {
  377. hash: {},
  378. contexts: [k],
  379. types: ["ID"],
  380. hashContexts: b,
  381. hashTypes: e,
  382. data: h
  383. };
  384. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.defaultup_guide", l) : j.call(k, "t", "UserLogin.defaultup_guide", l))));
  385. h.buffer.push("</div> \n </div> \n </div> \n </div> \n </div>\n");
  386. return f
  387. });
  388. Ember.TEMPLATES.user_login_1 = Ember.Handlebars.template(function anonymous(d, k, c, i, h) {
  389. this.compilerInfo = [3, ">= 1.0.0-rc.4"];
  390. c = c || Ember.Handlebars.helpers;
  391. h = h || {};
  392. var f = "",
  393. a, e, b, l, j = c.helperMissing,
  394. g = this.escapeExpression;
  395. h.buffer.push('\n <div class="accordion-heading marginright_35"> \n <div id="collapseinfo_2" class="text_right paddingright_15 index_page_font_color accordion-toggle text_underline">');
  396. e = {};
  397. b = {};
  398. l = {
  399. hash: {},
  400. contexts: [k],
  401. types: ["ID"],
  402. hashContexts: b,
  403. hashTypes: e,
  404. data: h
  405. };
  406. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.forgetps", l) : j.call(k, "t", "UserLogin.forgetps", l))));
  407. h.buffer.push('</div> \n </div> \n <div id="collapse_2" class="hide"> \n <div class="accordion-inner"> \n <div class="rounddiv getaccount_part"> \n <div class="bodydiv rounddiv paddingtop_8 getaccount_part_body index_page_font_color"> \n &nbsp;&nbsp;&nbsp;');
  408. e = {};
  409. b = {};
  410. l = {
  411. hash: {},
  412. contexts: [k],
  413. types: ["ID"],
  414. hashContexts: b,
  415. hashTypes: e,
  416. data: h
  417. };
  418. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.restore_username_password", l) : j.call(k, "t", "UserLogin.restore_username_password", l))));
  419. h.buffer.push(' \n </div> \n <div class="getaccount_info"> \n <div class="bodydiv rounddiv" align="center"> \n <div class="text_left index_page_font_color">');
  420. e = {};
  421. b = {};
  422. l = {
  423. hash: {},
  424. contexts: [k],
  425. types: ["ID"],
  426. hashContexts: b,
  427. hashTypes: e,
  428. data: h
  429. };
  430. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.restoredefaultop_guide", l) : j.call(k, "t", "UserLogin.restoredefaultop_guide", l))));
  431. h.buffer.push('</div> \n <div class="text_left"><font color="#FF0000">');
  432. e = {};
  433. b = {};
  434. l = {
  435. hash: {},
  436. contexts: [k],
  437. types: ["ID"],
  438. hashContexts: b,
  439. hashTypes: e,
  440. data: h
  441. };
  442. h.buffer.push(g(((a = c.t), a ? a.call(k, "UserLogin.restore_attention", l) : j.call(k, "t", "UserLogin.restore_attention", l))));
  443. h.buffer.push("</font></div> \n </div> \n </div> \n </div> \n </div> \n </div>\n");
  444. return f
  445. });
  446.  
  447. function check_username_password_if_blank() {
  448. var a = $("#index_username").val().length;
  449. var b = $("#password").val().length;
  450. if ((a < 1) || (b < 1)) {
  451. $("#errorCategory").html(Em.I18n.t("UserLogin.user_pass_blank"));
  452. return true
  453. }
  454. return false
  455. }
  456. Atp.LoginController = Atp.SingleObjController.create({
  457. objName: "system/user_login",
  458. count: 0,
  459. errCsrfProc: function(a) {
  460. utilUpdateCsrf(a.csrf_param, a.csrf_token);
  461. this.postData()
  462. },
  463. postData: function() {
  464. this.content.set("UserName", $("#index_username").val());
  465. this.content.set("Password", $("#password").val());
  466. if (check_username_password_if_blank()) {
  467. return 0
  468. }
  469. var a = utilGetCsrf();
  470. var b = {
  471. csrf: a,
  472. data: utilGetJson(this.content)
  473. };
  474. $("#password").blur();
  475. setAccountCookie();
  476. b.data["Password"] = base64Encode(SHA256(this.content.Password));
  477. this.post($.toJSON(b), function(c) {
  478. if ("ok" == c.errorCategory) {
  479. g_userLevel = c.level;
  480. if (typeof LoginCallBack === "function") {
  481. LoginCallBack(c)
  482. } else {
  483. if (c.IsWizard == false) {
  484. window.location.href = "/html/wizard/internet.html"
  485. } else {
  486. if ((c.IsFirst == false) && ((c.level == 2) || (Atp.IndexLanDeviceCountController.content.get("UserNumber") == 1))) {
  487. utilLoadJavascript("/js/firstlogin.js")
  488. } else {
  489. window.location.href = "/html/wizard/wizard.html"
  490. }
  491. }
  492. }
  493. } else {
  494. if (1 != c.errcode) {
  495. delAccountCookie();
  496. Atp.LoginController.set("count", c.count);
  497. if ((1 == c.errcode) && ("" != c.csrf)) {
  498. $("#errorCategory").html(Em.I18n.t(c.csrf))
  499. } else {
  500. $("#errorCategory").html(Em.I18n.t("UserLogin." + c.errorCategory, {
  501. arg1: Atp.LoginController.count,
  502. count: Atp.LoginController.count
  503. }))
  504. }
  505. loadcookie()
  506. }
  507. }
  508. })
  509. }
  510. });
  511.  
  512. function loadcookie() {
  513. if (typeof $.cookie("username") != "undefined" && $.cookie("username") != "" && $.cookie("username") != null) {
  514. $("#index_username").val($.cookie("username"))
  515. }
  516. }
  517.  
  518. function setAccountCookie() {
  519. var a = new Date();
  520. a.setTime(a.getTime() + (365 * 24 * 60 * 60 * 1000));
  521. var c = ";expires=" + a.toGMTString();
  522. var b = "username=" + $("#index_username").val() + c + "; path=/";
  523. document.cookie = b
  524. }
  525.  
  526. function delAccountCookie() {
  527. $.cookie("username", null)
  528. }
  529. Atp.AdminNameController = Atp.MultiObjController.create({
  530. objName: "system/useraccount",
  531. init: function() {
  532. this._super()
  533. }
  534. });
  535. Atp.UserFindUserNamePasswordView = Em.View.extend({
  536. classNames: "accordion-group",
  537. tagName: "div",
  538. elementId: "user_find",
  539. template: Em.TEMPLATES.user_login_0
  540. });
  541. Atp.UserAccountRestoreView = Em.View.extend({
  542. classNames: "accordion-group margintop_15",
  543. tagName: "div",
  544. elementId: "user_restore",
  545. template: Em.TEMPLATES.user_login_1
  546. });
  547.  
  548. function create_login_block(a) {
  549. var b = "";
  550. if (a) {
  551. b = '<div class="width_100p index_page_us_ps_top_div height_3" id="index_login_content">&nbsp;</div>'
  552. } else {
  553. b = '<div id="output_login_internal" class="header height_20" style="background-color:#23384B;" align="right"> <button id="index_window" type="button" class="close_detail marginright_5" data-dismiss="modal">X</button></div>'
  554. }
  555. b += '<div class="margintop_20 text_left paddingleft_5p login_font_color fontsize_18">' + Em.I18n.t("index.Login") + '</div> <div class="margintop_15" align="center"> <table id="input_username_pass" class="login_table width_400"> <tr class="height_25"> <td class="login_first_row_first_td login_first_row_first_td_r width_35"> <label class="pull-left margintop_5 ie6marginleft_10 ic-name ie6image"></label> </td> <td class="login_first_row_second_td paddingleft_5 paddingright_5 width_70 text_left">' + Em.I18n.t("UserLogin.UserName") + '</td> <td class="login_first_row_third_td"> <input id="index_username" type="text" style="border:none;margin-bottom:0px;height:25px;width:98%;" /> </td> </tr> <tr class="height_25"> <td class="login_second_row_first_td login_first_row_first_td_r width_35"> <label class="pull-left ie6password ic-password ie6image"></label> </td> <td class="login_second_row_second_td paddingleft_5 paddingright_5 width_70 text_left">' + Em.I18n.t("UserLogin.Password") + '</td> <td class="login_second_row_third_td"> <input id="password" type="password" autocomplete="off" style="border:none;margin-bottom:0px;height:25px;width:98%;" /> </td> </tr> </table><br> </div> <div class="loginerrorinfo" align="center"><div class="errorInfo"><font id="errorCategory" color="#FF0000"></font><br></div></div>';
  556. if (a) {} else {
  557. b += '<div class="login_cancel_div paddingtop_10 paddingbottom_10 text_center"> <button id="loginbtn" onclick="Atp.LoginController.postData();">' + Em.I18n.t("UserLogin.LoginLabel") + "</button> </div>"
  558. }
  559. b += '<div class="margintop_15 min_height_52"><div class="accordion" id="accordion_help"></div>';
  560. if (a) {
  561. b += '<div class="login_cancel_div paddingtop_10 paddingbottom_10 text_center"> <button id="loginbtn" onclick="Atp.LoginController.postData();" class="loginfontcolor">' + Em.I18n.t("UserLogin.LoginLabel") + "</button> </div>"
  562. }
  563. b += "</div>";
  564. return b
  565. }
  566. var loginviewnum = 2;
  567. var infoshow_1 = false;
  568. var infoshow_2 = false;
  569. var infoshow_3 = false;
  570.  
  571. function init_login_block() {
  572. $("body").keydown(function(b) {
  573. var c = b.which;
  574. if (c == 13) {
  575. $("#loginbtn").click();
  576. return false
  577. }
  578. });
  579. Atp.AdminNameController.load(function() {
  580. var d = Atp.AdminNameController.content;
  581. var b = false;
  582. if (d) {
  583. if (d.length == 1) {
  584. if (d[0]["username"]) {
  585. Atp.LoginController.content.set("UserName", d[0]["username"]);
  586. b = true
  587. }
  588. } else {
  589. for (var c = 0; c < d.length; c++) {
  590. if ((d[c]["userlevel"] == 2) && (d[c]["username"])) {
  591. Atp.LoginController.content.set("UserName", d[c]["username"]);
  592. b = true;
  593. break
  594. }
  595. }
  596. }
  597. }
  598. if (b) {
  599. $("#password").focus();
  600. if (typeof $.cookie("username") != "undefined" && $.cookie("username") != "" && $.cookie("username") != null) {
  601. $("#index_username").val($.cookie("username"))
  602. } else {
  603. $("#index_username").val(Atp.LoginController.content.get("UserName"))
  604. }
  605. } else {
  606. $("#index_username").focus()
  607. }
  608. });
  609.  
  610. function a(d, f, b) {
  611. var c = 1;
  612. var e = false;
  613. if ((d <= 0) || (d > f)) {
  614. return e
  615. }
  616. for (c = 1; c <= f; c++) {
  617. if (c != d) {
  618. $("#collapse_" + c).hide(100)
  619. }
  620. }
  621. if (b) {
  622. $("#collapse_" + d).hide(100)
  623. } else {
  624. $("#collapse_" + d).show(100);
  625. e = true
  626. }
  627. return e
  628. }
  629. $("#collapseinfo_1").live("click", function() {
  630. infoshow_2 = false;
  631. infoshow_3 = false;
  632. infoshow_1 = a(1, loginviewnum, infoshow_1)
  633. });
  634. $("#collapseinfo_2").live("click", function() {
  635. infoshow_1 = false;
  636. infoshow_3 = false;
  637. infoshow_2 = a(2, loginviewnum, infoshow_2)
  638. })
  639. }
  640. if ($("#login_window").length > 0) {
  641. var loginBlock = create_login_block(true);
  642. $("#login_window").html(loginBlock);
  643. init_login_block();
  644. Atp.UserFindUserNamePasswordView.create().appendTo("#accordion_help");
  645. Atp.UserAccountRestoreView.create().appendTo("#accordion_help")
  646. } else {
  647. if ($("#output_login").length > 0) {
  648. var loginBlock = create_login_block();
  649. $("#output_login").html(loginBlock);
  650. init_login_block();
  651. setInterval("reDisplayOutWin()", 50);
  652. $("#output_login").removeClass("hide");
  653. Atp.UserFindUserNamePasswordView.create().appendTo("#accordion_help");
  654. Atp.UserAccountRestoreView.create().appendTo("#accordion_help")
  655. }
  656. }
  657.  
  658. function reDisplayOutWin() {
  659. var e = $(window).width();
  660. var d = $(window).height();
  661. var c = $(document).scrollTop();
  662. var f = $("#output_login");
  663. var b = (e - f.width()) / 2;
  664. var a = (d - f.height()) / 2 - c / 2;
  665. if (f.hasClass("hide") == false) {
  666. f.css({
  667. left: b + "px",
  668. top: a + "px"
  669. })
  670. }
  671. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement