Email validation login screen on mobile web app.

Ylian Saint-Hilaire committed Apr 21, 2020 at 01:59 UTC bf86a4b90e61ad040d37dc8eadcf966d9864f5cf
2 files changed +97 -36
translate/translate.json
+40 -34
@@ -1829,7 +1829,7 @@
1829 "ru": "Отказано в доступе.",
1830 "zh-chs": "拒絕訪問。",
1831 "xloc": [
1832 - "login-mobile.handlebars->5->14",
1832 + "login-mobile.handlebars->5->15",
1833 "login.handlebars->5->15"
1834 ]
1835 },
@@ -1974,7 +1974,7 @@
1974 "ru": "Достигнуто ограничение учетных записей.",
1975 "zh-chs": "達到帳戶限制。",
1976 "xloc": [
1977 - "login-mobile.handlebars->5->4",
1977 + "login-mobile.handlebars->5->5",
1978 "login.handlebars->5->5"
1979 ]
1980 },
@@ -1992,7 +1992,7 @@
1992 "ru": "Учетная запись заблокирована.",
1993 "zh-chs": "帳戶被鎖定。",
1994 "xloc": [
1995 - "login-mobile.handlebars->5->13",
1995 + "login-mobile.handlebars->5->14",
1996 "login.handlebars->5->14"
1997 ]
1998 },
@@ -2010,7 +2010,7 @@
2010 "ru": "Учетная запись не найдена.",
2011 "zh-chs": "找不到帳戶。",
2012 "xloc": [
2013 - "login-mobile.handlebars->5->10",
2013 + "login-mobile.handlebars->5->11",
2014 "login.handlebars->5->11"
2015 ]
2016 },
@@ -4213,6 +4213,7 @@
4213 "ru": "Обратно к экрану входа",
4214 "zh-chs": "回到登入",
4215 "xloc": [
4216 + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->8",
4217 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->createpanel->1->1->12",
4218 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpanel->1->10",
4219 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpasswordpanel->1->10",
@@ -4846,6 +4847,7 @@
4847 {
4848 "en": "Change Email Address",
4849 "xloc": [
4850 + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->checkCheckOperations->1->2->1->1",
4851 "login.handlebars->container->column_l->centralTable->1->0->logincell->checkemailpanel->1->checkCheckOperations->1->2->1->1"
4852 ]
4853 },
@@ -9357,6 +9359,7 @@
9359 "default.handlebars->29->1524",
9360 "default.handlebars->29->1566",
9361 "default.handlebars->29->276",
9362 + "login-mobile.handlebars->5->38",
9363 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->tokenpanel->1->7->1->4->1->3",
9364 "login.handlebars->5->39",
9365 "login.handlebars->container->column_l->centralTable->1->0->logincell->tokenpanel->1->7->1->4->1->3"
@@ -9401,6 +9404,7 @@
9404 {
9405 "en": "Email Confirmation",
9406 "xloc": [
9407 + "login-mobile.handlebars->5->39",
9408 "login.handlebars->5->40"
9409 ]
9410 },
@@ -9532,6 +9536,7 @@
9536 {
9537 "en": "Email verification required, check your mailbox and click the confirmation link.",
9538 "xloc": [
9539 + "login-mobile.handlebars->5->3",
9540 "login.handlebars->5->3"
9541 ]
9542 },
@@ -9549,7 +9554,7 @@
9554 "ru": "Email:",
9555 "zh-chs": "電子郵件:",
9556 "xloc": [
9552 - "login-mobile.handlebars->5->18",
9557 + "login-mobile.handlebars->5->19",
9558 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->createpanel->1->1->9->1->2->1",
9559 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpanel->1->7->1->0->1",
9560 "login.handlebars->5->19",
@@ -10121,7 +10126,7 @@
10126 "ru": "Существующий аккаунт с этим адресом email.",
10127 "zh-chs": "使用此電子郵件地址的現有帳戶。",
10128 "xloc": [
10124 - "login-mobile.handlebars->5->5",
10129 + "login-mobile.handlebars->5->6",
10130 "login.handlebars->5->6"
10131 ]
10132 },
@@ -10607,7 +10612,7 @@
10612 "ru": "Забыли пароль?",
10613 "zh-chs": "忘記密碼?",
10614 "xloc": [
10610 - "login-mobile.handlebars->5->19",
10615 + "login-mobile.handlebars->5->20",
10616 "login.handlebars->5->20"
10617 ]
10618 },
@@ -11316,8 +11321,8 @@
11321 "ru": "Хороший пароль",
11322 "zh-chs": "好的密碼",
11323 "xloc": [
11319 - "login-mobile.handlebars->5->24",
11320 - "login-mobile.handlebars->5->28",
11324 + "login-mobile.handlebars->5->25",
11325 + "login-mobile.handlebars->5->29",
11326 "login.handlebars->5->25",
11327 "login.handlebars->5->29"
11328 ]
@@ -11911,7 +11916,7 @@
11916 "ru": "IP адрес заблокирован, повторите попытку позже.",
11917 "zh-chs": "IP位址已封鎖,請稍後再試。",
11918 "xloc": [
11914 - "login-mobile.handlebars->5->17",
11919 + "login-mobile.handlebars->5->18",
11920 "login.handlebars->5->18"
11921 ]
11922 },
@@ -13164,7 +13169,7 @@
13169 "ru": "Некорректный токен создания учетной записи.",
13170 "zh-chs": "無效的帳戶創建令牌。",
13171 "xloc": [
13167 - "login-mobile.handlebars->5->6",
13172 + "login-mobile.handlebars->5->7",
13173 "login.handlebars->5->7"
13174 ]
13175 },
@@ -13182,7 +13187,7 @@
13187 "ru": "Некорректный email.",
13188 "zh-chs": "不合規電郵。",
13189 "xloc": [
13185 - "login-mobile.handlebars->5->9",
13190 + "login-mobile.handlebars->5->10",
13191 "login.handlebars->5->10"
13192 ]
13193 },
@@ -13217,7 +13222,7 @@
13222 "ru": "Некорректный токен, попробуйте еще.",
13223 "zh-chs": "令牌無效,請重試。",
13224 "xloc": [
13220 - "login-mobile.handlebars->5->11",
13225 + "login-mobile.handlebars->5->12",
13226 "login.handlebars->5->12"
13227 ]
13228 },
@@ -14907,7 +14912,7 @@
14912 "ru": "Вход не выполнен, проверьте имя пользователя и пароль.",
14913 "zh-chs": "登錄失敗,請檢查用戶名和密碼。",
14914 "xloc": [
14910 - "login-mobile.handlebars->5->15",
14915 + "login-mobile.handlebars->5->16",
14916 "login.handlebars->5->16"
14917 ]
14918 },
@@ -15704,7 +15709,7 @@
15709 "ru": "Максимальная длина {0}",
15710 "zh-chs": "最大長度為{0}",
15711 "xloc": [
15707 - "login-mobile.handlebars->5->32",
15712 + "login-mobile.handlebars->5->33",
15713 "login.handlebars->5->33"
15714 ]
15715 },
@@ -16356,7 +16361,7 @@
16361 "ru": "Минимальная длина {0}",
16362 "zh-chs": "最小長度為{0}",
16363 "xloc": [
16359 - "login-mobile.handlebars->5->31",
16364 + "login-mobile.handlebars->5->32",
16365 "login.handlebars->5->32"
16366 ]
16367 },
@@ -18757,7 +18762,7 @@
18762 "ru": "Подсказка пароля",
18763 "zh-chs": "密碼提示",
18764 "xloc": [
18760 - "login-mobile.handlebars->5->22",
18765 + "login-mobile.handlebars->5->23",
18766 "login.handlebars->5->23"
18767 ]
18768 },
@@ -18794,8 +18799,8 @@
18799 "ru": "Политика пароля",
18800 "zh-chs": "密碼政策",
18801 "xloc": [
18797 - "login-mobile.handlebars->5->26",
18798 - "login-mobile.handlebars->5->30",
18802 + "login-mobile.handlebars->5->27",
18803 + "login-mobile.handlebars->5->31",
18804 "login.handlebars->5->27",
18805 "login.handlebars->5->31",
18806 "login.handlebars->5->38"
@@ -18815,7 +18820,7 @@
18820 "ru": "Требуется смена пароля.",
18821 "zh-chs": "要求更改密碼。",
18822 "xloc": [
18818 - "login-mobile.handlebars->5->16",
18823 + "login-mobile.handlebars->5->17",
18824 "login.handlebars->5->17"
18825 ]
18826 },
@@ -18885,7 +18890,7 @@
18890 "ru": "Пароль не принят, используйте другой.",
18891 "zh-chs": "密碼被拒絕,請使用其他密碼。",
18892 "xloc": [
18888 - "login-mobile.handlebars->5->8",
18893 + "login-mobile.handlebars->5->9",
18894 "login.handlebars->5->9"
18895 ]
18896 },
@@ -20825,6 +20830,7 @@
20830 {
20831 "en": "Resend Confirmation Email",
20832 "xloc": [
20833 + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->checkCheckOperations->1->2->1->1",
20834 "login.handlebars->container->column_l->centralTable->1->0->logincell->checkemailpanel->1->checkCheckOperations->1->2->1->1"
20835 ]
20836 },
@@ -21546,7 +21552,7 @@
21552 "ru": "Безопасный вход",
21553 "zh-chs": "安全登錄",
21554 "xloc": [
21549 - "login-mobile.handlebars->5->20",
21555 + "login-mobile.handlebars->5->21",
21556 "login.handlebars->5->21"
21557 ]
21558 },
@@ -21970,7 +21976,7 @@
21976 "ru": "Отправить токен на зарегистрированный адрес электронной почты?",
21977 "zh-chs": "將令牌發送到註冊的電子郵件地址?",
21978 "xloc": [
21973 - "login-mobile.handlebars->5->21",
21979 + "login-mobile.handlebars->5->22",
21980 "login.handlebars->5->22"
21981 ]
21982 },
@@ -23817,8 +23823,8 @@
23823 "ru": "Надежный пароль",
23824 "zh-chs": "強密碼",
23825 "xloc": [
23820 - "login-mobile.handlebars->5->23",
23821 - "login-mobile.handlebars->5->27",
23826 + "login-mobile.handlebars->5->24",
23827 + "login-mobile.handlebars->5->28",
23828 "login.handlebars->5->24",
23829 "login.handlebars->5->28"
23830 ]
@@ -25499,7 +25505,7 @@
25505 "ru": "Невозможно создать учетную запись.",
25506 "zh-chs": "無法創建帳戶。",
25507 "xloc": [
25502 - "login-mobile.handlebars->5->3",
25508 + "login-mobile.handlebars->5->4",
25509 "login.handlebars->5->4"
25510 ]
25511 },
@@ -25552,7 +25558,7 @@
25558 "ru": "Не удалось отправить email.",
25559 "zh-chs": "無法發送電子郵件。",
25560 "xloc": [
25555 - "login-mobile.handlebars->5->12",
25561 + "login-mobile.handlebars->5->13",
25562 "login.handlebars->5->13"
25563 ]
25564 },
@@ -26529,7 +26535,7 @@
26535 "ru": "Имя пользователя уже существует.",
26536 "zh-chs": "此用戶名已存在。",
26537 "xloc": [
26532 - "login-mobile.handlebars->5->7",
26538 + "login-mobile.handlebars->5->8",
26539 "login.handlebars->5->8"
26540 ]
26541 },
@@ -27017,8 +27023,8 @@
27023 "ru": "Слабый пароль",
27024 "zh-chs": "密碼強度低",
27025 "xloc": [
27020 - "login-mobile.handlebars->5->25",
27021 - "login-mobile.handlebars->5->29",
27026 + "login-mobile.handlebars->5->26",
27027 + "login-mobile.handlebars->5->30",
27028 "login.handlebars->5->26",
27029 "login.handlebars->5->30"
27030 ]
@@ -29177,7 +29183,7 @@
29183 "ru": "{0} букв в нижнем регистре",
29184 "zh-chs": "{0}小寫",
29185 "xloc": [
29180 - "login-mobile.handlebars->5->34",
29186 + "login-mobile.handlebars->5->35",
29187 "login.handlebars->5->35"
29188 ]
29189 },
@@ -29263,7 +29269,7 @@
29269 "ru": "{0} спец. символы",
29270 "zh-chs": "{0}非字母數字",
29271 "xloc": [
29266 - "login-mobile.handlebars->5->36",
29272 + "login-mobile.handlebars->5->37",
29273 "login.handlebars->5->37"
29274 ]
29275 },
@@ -29281,7 +29287,7 @@
29287 "ru": "{0} цифры",
29288 "zh-chs": "{0}數字",
29289 "xloc": [
29284 - "login-mobile.handlebars->5->35",
29290 + "login-mobile.handlebars->5->36",
29291 "login.handlebars->5->36"
29292 ]
29293 },
@@ -29412,7 +29418,7 @@
29418 "ru": "{0} заглавных букв",
29419 "zh-chs": "{0}大寫",
29420 "xloc": [
29415 - "login-mobile.handlebars->5->33",
29421 + "login-mobile.handlebars->5->34",
29422 "login.handlebars->5->34"
29423 ]
29424 },
views/login-mobile.handlebars
+57 -2
@@ -226,6 +226,31 @@
226 <input id=resetpasswordformargs name="urlargs" type="hidden" value="" />
227 </form>
228 </div>
229 + <div id=checkemailpanel style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
230 + <form method=post>
231 + <input type=hidden name=action value=checkemail />
232 + <div id=message7></div>
233 + <table id="checkCheckOperations" style="width:100%;display:none">
234 + <tr>
235 + <td>
236 + <div id="unconfirmedEmail"></div><br />
237 + </td>
238 + </tr>
239 + <tr>
240 + <td>
241 + <div>
242 + <input id=changeEmailButton type=button value="Change Email Address" onclick="changeEmailAddress()" />
243 + <input id=checkEmailButton2 type=button value="Resend Confirmation Email" onclick="resentEmailConfirmation()" />
244 + <input id=checkEmailButton type=submit style="display:none" />
245 + <input id=checkEmailVal name=email type="hidden" value="" />
246 + </div>
247 + </td>
248 + </tr>
249 + </table>
250 + <hr /><a onclick="return xgo(1,event);" href="#" style=cursor:pointer>Back to login</a>
251 + <input id=checkemailformargs name="urlargs" type="hidden" value="" />
252 + </form>
253 + </div>
254
255 </td>
256 </tr>
@@ -278,7 +303,7 @@
303
304 // Display the right server message
305 var messageid = parseInt('{{{messageid}}}');
281 - var okmessages = ['', "Hold on, reset mail sent.", "Email sent."];
306 + var okmessages = ['', "Hold on, reset mail sent.", "Email sent.", "Email verification required, check your mailbox and click the confirmation link."];
307 var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested.", "IP address blocked, try again later."];
308 if (messageid > 0) {
309 var msg = '';
@@ -286,7 +311,7 @@
311 else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
312 if (msg != '') {
313 if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
289 - for (var i = 1; i < 7; i++) { QH('message' + i, msg); }
314 + for (var i = 1; i < 8; i++) { QH('message' + i, msg); }
315 }
316 }
317
@@ -422,6 +447,7 @@
447 QV('message4', false);
448 QV('message5', false);
449 QV('message6', false);
450 + QV('message7', false);
451 go(x);
452 }
453
@@ -435,12 +461,18 @@
461 QV('tokenpanel', x == 4);
462 QV('resettokenpanel', x == 5);
463 QV('resetpasswordpanel', x == 6);
464 + QV('checkemailpanel', x == 7);
465 if (x == 1) { Q('username').focus(); }
466 if (x == 2) { if (features & 0x200000) { Q('aemail').focus(); } else { Q('ausername').focus(); } } // Email is username
467 if (x == 3) { Q('remail').focus(); }
468 if (x == 4) { Q('tokenInput').focus(); }
469 if (x == 5) { Q('resetTokenInput').focus(); }
470 if (x == 6) { Q('rapassword1').focus(); }
471 + if (x == 7) {
472 + QH('unconfirmedEmail', passhint);
473 + QV('checkCheckOperations', Q('unconfirmedEmail').innerHTML != '');
474 + QH('checkEmailVal', passhint);
475 + }
476 }
477
478 function validateLogin(box, e) {
@@ -614,6 +646,28 @@
646 QE('resetTokenOkButton', (Q('resetTokenInput').value.length == 6) || (Q('resetTokenInput').value.length == 8) || (Q('resetTokenInput').value.length == 44));
647 }
648
649 + function changeEmailAddress() {
650 + var email = Q('unconfirmedEmail').innerHTML;
651 + var x = addHtmlValue("Email", '<input id=dp1email style=width:230px maxlength=256 value="' + email + '" autocomplete=off onchange=validateEmailAddress() onkeyup=validateEmailAddress() />');
652 + setDialogMode(1, "Email Confirmation", 3, changeEmailAddressEx, x);
653 + validateEmailAddress();
654 + }
655 +
656 + function validateEmailAddress() {
657 + QE('idx_dlgOkButton', (validateEmail(Q('dp1email').value) == true));
658 + }
659 +
660 + function changeEmailAddressEx() {
661 + Q('checkEmailVal').value = Q('dp1email').value;
662 + QH('unconfirmedEmail', Q('dp1email').value);
663 + Q('checkEmailButton').click();
664 + }
665 +
666 + function resentEmailConfirmation() {
667 + Q('checkEmailVal').value = Q('unconfirmedEmail').innerHTML;
668 + Q('checkEmailButton').click();
669 + }
670 +
671 //
672 // POPUP DIALOG
673 //
@@ -659,6 +713,7 @@
713 function haltReturn(e) { if (e.keyCode == 13) { haltEvent(e); } }
714 function validateEmail(v) { var emailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return emailReg.test(v); } // New version
715 function format(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); };
716 + function addHtmlValue(t, v) { return '<table><td style=text-align:left>' + t + '<td><b>' + v + '</b></table>'; }
717
718 </script>
719 </body>