From bf86a4b90e61ad040d37dc8eadcf966d9864f5cf Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 21 Apr 2020 01:59:08 -0700 Subject: [PATCH] Email validation login screen on mobile web app. --- translate/translate.json | 74 +++++++++++++++++++---------------- views/login-mobile.handlebars | 59 +++++++++++++++++++++++++++- 2 files changed, 97 insertions(+), 36 deletions(-) diff --git a/translate/translate.json b/translate/translate.json index 762c600e..ccb3799b 100644 --- a/translate/translate.json +++ b/translate/translate.json @@ -1829,7 +1829,7 @@ "ru": "Отказано в доступе.", "zh-chs": "拒絕訪問。", "xloc": [ - "login-mobile.handlebars->5->14", + "login-mobile.handlebars->5->15", "login.handlebars->5->15" ] }, @@ -1974,7 +1974,7 @@ "ru": "Достигнуто ограничение учетных записей.", "zh-chs": "達到帳戶限制。", "xloc": [ - "login-mobile.handlebars->5->4", + "login-mobile.handlebars->5->5", "login.handlebars->5->5" ] }, @@ -1992,7 +1992,7 @@ "ru": "Учетная запись заблокирована.", "zh-chs": "帳戶被鎖定。", "xloc": [ - "login-mobile.handlebars->5->13", + "login-mobile.handlebars->5->14", "login.handlebars->5->14" ] }, @@ -2010,7 +2010,7 @@ "ru": "Учетная запись не найдена.", "zh-chs": "找不到帳戶。", "xloc": [ - "login-mobile.handlebars->5->10", + "login-mobile.handlebars->5->11", "login.handlebars->5->11" ] }, @@ -4213,6 +4213,7 @@ "ru": "Обратно к экрану входа", "zh-chs": "回到登入", "xloc": [ + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->8", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->createpanel->1->1->12", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpanel->1->10", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpasswordpanel->1->10", @@ -4846,6 +4847,7 @@ { "en": "Change Email Address", "xloc": [ + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->checkCheckOperations->1->2->1->1", "login.handlebars->container->column_l->centralTable->1->0->logincell->checkemailpanel->1->checkCheckOperations->1->2->1->1" ] }, @@ -9357,6 +9359,7 @@ "default.handlebars->29->1524", "default.handlebars->29->1566", "default.handlebars->29->276", + "login-mobile.handlebars->5->38", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->tokenpanel->1->7->1->4->1->3", "login.handlebars->5->39", "login.handlebars->container->column_l->centralTable->1->0->logincell->tokenpanel->1->7->1->4->1->3" @@ -9401,6 +9404,7 @@ { "en": "Email Confirmation", "xloc": [ + "login-mobile.handlebars->5->39", "login.handlebars->5->40" ] }, @@ -9532,6 +9536,7 @@ { "en": "Email verification required, check your mailbox and click the confirmation link.", "xloc": [ + "login-mobile.handlebars->5->3", "login.handlebars->5->3" ] }, @@ -9549,7 +9554,7 @@ "ru": "Email:", "zh-chs": "電子郵件:", "xloc": [ - "login-mobile.handlebars->5->18", + "login-mobile.handlebars->5->19", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->createpanel->1->1->9->1->2->1", "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->resetpanel->1->7->1->0->1", "login.handlebars->5->19", @@ -10121,7 +10126,7 @@ "ru": "Существующий аккаунт с этим адресом email.", "zh-chs": "使用此電子郵件地址的現有帳戶。", "xloc": [ - "login-mobile.handlebars->5->5", + "login-mobile.handlebars->5->6", "login.handlebars->5->6" ] }, @@ -10607,7 +10612,7 @@ "ru": "Забыли пароль?", "zh-chs": "忘記密碼?", "xloc": [ - "login-mobile.handlebars->5->19", + "login-mobile.handlebars->5->20", "login.handlebars->5->20" ] }, @@ -11316,8 +11321,8 @@ "ru": "Хороший пароль", "zh-chs": "好的密碼", "xloc": [ - "login-mobile.handlebars->5->24", - "login-mobile.handlebars->5->28", + "login-mobile.handlebars->5->25", + "login-mobile.handlebars->5->29", "login.handlebars->5->25", "login.handlebars->5->29" ] @@ -11911,7 +11916,7 @@ "ru": "IP адрес заблокирован, повторите попытку позже.", "zh-chs": "IP位址已封鎖,請稍後再試。", "xloc": [ - "login-mobile.handlebars->5->17", + "login-mobile.handlebars->5->18", "login.handlebars->5->18" ] }, @@ -13164,7 +13169,7 @@ "ru": "Некорректный токен создания учетной записи.", "zh-chs": "無效的帳戶創建令牌。", "xloc": [ - "login-mobile.handlebars->5->6", + "login-mobile.handlebars->5->7", "login.handlebars->5->7" ] }, @@ -13182,7 +13187,7 @@ "ru": "Некорректный email.", "zh-chs": "不合規電郵。", "xloc": [ - "login-mobile.handlebars->5->9", + "login-mobile.handlebars->5->10", "login.handlebars->5->10" ] }, @@ -13217,7 +13222,7 @@ "ru": "Некорректный токен, попробуйте еще.", "zh-chs": "令牌無效,請重試。", "xloc": [ - "login-mobile.handlebars->5->11", + "login-mobile.handlebars->5->12", "login.handlebars->5->12" ] }, @@ -14907,7 +14912,7 @@ "ru": "Вход не выполнен, проверьте имя пользователя и пароль.", "zh-chs": "登錄失敗,請檢查用戶名和密碼。", "xloc": [ - "login-mobile.handlebars->5->15", + "login-mobile.handlebars->5->16", "login.handlebars->5->16" ] }, @@ -15704,7 +15709,7 @@ "ru": "Максимальная длина {0}", "zh-chs": "最大長度為{0}", "xloc": [ - "login-mobile.handlebars->5->32", + "login-mobile.handlebars->5->33", "login.handlebars->5->33" ] }, @@ -16356,7 +16361,7 @@ "ru": "Минимальная длина {0}", "zh-chs": "最小長度為{0}", "xloc": [ - "login-mobile.handlebars->5->31", + "login-mobile.handlebars->5->32", "login.handlebars->5->32" ] }, @@ -18757,7 +18762,7 @@ "ru": "Подсказка пароля", "zh-chs": "密碼提示", "xloc": [ - "login-mobile.handlebars->5->22", + "login-mobile.handlebars->5->23", "login.handlebars->5->23" ] }, @@ -18794,8 +18799,8 @@ "ru": "Политика пароля", "zh-chs": "密碼政策", "xloc": [ - "login-mobile.handlebars->5->26", - "login-mobile.handlebars->5->30", + "login-mobile.handlebars->5->27", + "login-mobile.handlebars->5->31", "login.handlebars->5->27", "login.handlebars->5->31", "login.handlebars->5->38" @@ -18815,7 +18820,7 @@ "ru": "Требуется смена пароля.", "zh-chs": "要求更改密碼。", "xloc": [ - "login-mobile.handlebars->5->16", + "login-mobile.handlebars->5->17", "login.handlebars->5->17" ] }, @@ -18885,7 +18890,7 @@ "ru": "Пароль не принят, используйте другой.", "zh-chs": "密碼被拒絕,請使用其他密碼。", "xloc": [ - "login-mobile.handlebars->5->8", + "login-mobile.handlebars->5->9", "login.handlebars->5->9" ] }, @@ -20825,6 +20830,7 @@ { "en": "Resend Confirmation Email", "xloc": [ + "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->checkemailpanel->1->checkCheckOperations->1->2->1->1", "login.handlebars->container->column_l->centralTable->1->0->logincell->checkemailpanel->1->checkCheckOperations->1->2->1->1" ] }, @@ -21546,7 +21552,7 @@ "ru": "Безопасный вход", "zh-chs": "安全登錄", "xloc": [ - "login-mobile.handlebars->5->20", + "login-mobile.handlebars->5->21", "login.handlebars->5->21" ] }, @@ -21970,7 +21976,7 @@ "ru": "Отправить токен на зарегистрированный адрес электронной почты?", "zh-chs": "將令牌發送到註冊的電子郵件地址?", "xloc": [ - "login-mobile.handlebars->5->21", + "login-mobile.handlebars->5->22", "login.handlebars->5->22" ] }, @@ -23817,8 +23823,8 @@ "ru": "Надежный пароль", "zh-chs": "強密碼", "xloc": [ - "login-mobile.handlebars->5->23", - "login-mobile.handlebars->5->27", + "login-mobile.handlebars->5->24", + "login-mobile.handlebars->5->28", "login.handlebars->5->24", "login.handlebars->5->28" ] @@ -25499,7 +25505,7 @@ "ru": "Невозможно создать учетную запись.", "zh-chs": "無法創建帳戶。", "xloc": [ - "login-mobile.handlebars->5->3", + "login-mobile.handlebars->5->4", "login.handlebars->5->4" ] }, @@ -25552,7 +25558,7 @@ "ru": "Не удалось отправить email.", "zh-chs": "無法發送電子郵件。", "xloc": [ - "login-mobile.handlebars->5->12", + "login-mobile.handlebars->5->13", "login.handlebars->5->13" ] }, @@ -26529,7 +26535,7 @@ "ru": "Имя пользователя уже существует.", "zh-chs": "此用戶名已存在。", "xloc": [ - "login-mobile.handlebars->5->7", + "login-mobile.handlebars->5->8", "login.handlebars->5->8" ] }, @@ -27017,8 +27023,8 @@ "ru": "Слабый пароль", "zh-chs": "密碼強度低", "xloc": [ - "login-mobile.handlebars->5->25", - "login-mobile.handlebars->5->29", + "login-mobile.handlebars->5->26", + "login-mobile.handlebars->5->30", "login.handlebars->5->26", "login.handlebars->5->30" ] @@ -29177,7 +29183,7 @@ "ru": "{0} букв в нижнем регистре", "zh-chs": "{0}小寫", "xloc": [ - "login-mobile.handlebars->5->34", + "login-mobile.handlebars->5->35", "login.handlebars->5->35" ] }, @@ -29263,7 +29269,7 @@ "ru": "{0} спец. символы", "zh-chs": "{0}非字母數字", "xloc": [ - "login-mobile.handlebars->5->36", + "login-mobile.handlebars->5->37", "login.handlebars->5->37" ] }, @@ -29281,7 +29287,7 @@ "ru": "{0} цифры", "zh-chs": "{0}數字", "xloc": [ - "login-mobile.handlebars->5->35", + "login-mobile.handlebars->5->36", "login.handlebars->5->36" ] }, @@ -29412,7 +29418,7 @@ "ru": "{0} заглавных букв", "zh-chs": "{0}大寫", "xloc": [ - "login-mobile.handlebars->5->33", + "login-mobile.handlebars->5->34", "login.handlebars->5->34" ] }, diff --git a/views/login-mobile.handlebars b/views/login-mobile.handlebars index fa900c5a..264c4720 100644 --- a/views/login-mobile.handlebars +++ b/views/login-mobile.handlebars @@ -226,6 +226,31 @@ + @@ -278,7 +303,7 @@ // Display the right server message var messageid = parseInt('{{{messageid}}}'); - var okmessages = ['', "Hold on, reset mail sent.", "Email sent."]; + var okmessages = ['', "Hold on, reset mail sent.", "Email sent.", "Email verification required, check your mailbox and click the confirmation link."]; 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."]; if (messageid > 0) { var msg = ''; @@ -286,7 +311,7 @@ else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; } if (msg != '') { if (messageid >= 100) { msg = ('' + msg + '

'); } else { msg = ('' + msg + '

'); } - for (var i = 1; i < 7; i++) { QH('message' + i, msg); } + for (var i = 1; i < 8; i++) { QH('message' + i, msg); } } } @@ -422,6 +447,7 @@ QV('message4', false); QV('message5', false); QV('message6', false); + QV('message7', false); go(x); } @@ -435,12 +461,18 @@ QV('tokenpanel', x == 4); QV('resettokenpanel', x == 5); QV('resetpasswordpanel', x == 6); + QV('checkemailpanel', x == 7); if (x == 1) { Q('username').focus(); } if (x == 2) { if (features & 0x200000) { Q('aemail').focus(); } else { Q('ausername').focus(); } } // Email is username if (x == 3) { Q('remail').focus(); } if (x == 4) { Q('tokenInput').focus(); } if (x == 5) { Q('resetTokenInput').focus(); } if (x == 6) { Q('rapassword1').focus(); } + if (x == 7) { + QH('unconfirmedEmail', passhint); + QV('checkCheckOperations', Q('unconfirmedEmail').innerHTML != ''); + QH('checkEmailVal', passhint); + } } function validateLogin(box, e) { @@ -614,6 +646,28 @@ QE('resetTokenOkButton', (Q('resetTokenInput').value.length == 6) || (Q('resetTokenInput').value.length == 8) || (Q('resetTokenInput').value.length == 44)); } + function changeEmailAddress() { + var email = Q('unconfirmedEmail').innerHTML; + var x = addHtmlValue("Email", ''); + setDialogMode(1, "Email Confirmation", 3, changeEmailAddressEx, x); + validateEmailAddress(); + } + + function validateEmailAddress() { + QE('idx_dlgOkButton', (validateEmail(Q('dp1email').value) == true)); + } + + function changeEmailAddressEx() { + Q('checkEmailVal').value = Q('dp1email').value; + QH('unconfirmedEmail', Q('dp1email').value); + Q('checkEmailButton').click(); + } + + function resentEmailConfirmation() { + Q('checkEmailVal').value = Q('unconfirmedEmail').innerHTML; + Q('checkEmailButton').click(); + } + // // POPUP DIALOG // @@ -659,6 +713,7 @@ function haltReturn(e) { if (e.keyCode == 13) { haltEvent(e); } } 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 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; }); }; + function addHtmlValue(t, v) { return '
' + t + '' + v + '
'; }