Enhancement to Two Factor Auth (Closes #123)

This commit is contained in:
RainLoop Team 2014-04-17 02:32:41 +04:00
parent e86afd8d6e
commit fa8d7e5ebe
32 changed files with 150 additions and 56 deletions

View file

@ -1101,12 +1101,14 @@ RainLoopApp.prototype.bootstart = function ()
Plugins.runHook('rl-start-user-screens');
RL.pub('rl.bootstart-user-screens');
if (!!RL.settingsGet('AccountSignMe'))
if (!!RL.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler)
{
_.delay(function () {
window.navigator.registerProtocolHandler('mailto',
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
'' + (RL.settingsGet('Title') || 'RainLoop'));
try {
window.navigator.registerProtocolHandler('mailto',
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
'' + (RL.settingsGet('Title') || 'RainLoop'));
} catch(e) {}
if (RL.settingsGet('MailToEmail'))
{

View file

@ -35,8 +35,9 @@ WebMailAjaxRemoteStorage.prototype.folders = function (fCallback)
* @param {boolean} bSignMe
* @param {string=} sLanguage
* @param {string=} sAdditionalCode
* @param {boolean=} bAdditionalCodeSignMe
*/
WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode)
WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
{
this.defaultRequest(fCallback, 'Login', {
'Email': sEmail,
@ -44,6 +45,7 @@ WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin,
'Password': sPassword,
'Language': sLanguage || '',
'AdditionalCode': sAdditionalCode || '',
'AdditionalCodeSignMe': bAdditionalCodeSignMe ? '1' : '0',
'SignMe': bSignMe ? '1' : '0'
});
};

View file

@ -58,7 +58,7 @@
.border-radius(3px);
}
.inputLoginForm, .inputEmail, .inputLogin, .inputPassword {
.inputLoginForm, .inputEmail, .inputLogin, .inputPassword, .inputAdditionalCode {
font-size: 18px;
height: 30px;
line-height: 29px;

View file

@ -19,6 +19,7 @@ function LoginViewModel()
this.additionalCode.error = ko.observable(false);
this.additionalCode.focused = ko.observable(false);
this.additionalCode.visibility = ko.observable(false);
this.additionalCodeSignMe = ko.observable(false);
this.logoImg = Utils.trim(RL.settingsGet('LoginLogo'));
this.loginDescription = Utils.trim(RL.settingsGet('LoginDescription'));
@ -137,7 +138,9 @@ function LoginViewModel()
}, this), this.email(), this.login(), this.password(), !!this.signMe(),
this.bSendLanguage ? this.mainLanguage() : '',
this.additionalCode.visibility() ? this.additionalCode() : '');
this.additionalCode.visibility() ? this.additionalCode() : '',
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
);
return true;

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.6.4",
"release": "893",
"release": "895",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "Gruntfile.js",

View file

@ -928,7 +928,7 @@ class Actions
$sSignMeToken = \RainLoop\Utils::GetCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY, '');
if (!empty($sSignMeToken))
{
$oAccount = $this->oActions->GetAccountFromCustomToken($this->StorageProvider()->Get(null,
$oAccount = $this->GetAccountFromCustomToken($this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$sSignMeToken
), false, false);
@ -1375,12 +1375,14 @@ class Actions
* @param string $sLogin
* @param string $sPassword
* @param string $sSignMeToken = ''
* @param string $sTwoFactorAuthCode = ''
* @param string $sAdditionalCode = ''
* @param string $bAdditionalCodeSignMeSignMe = false
*
* @return \RainLoop\Account
* @throws \RainLoop\Exceptions\ClientException
*/
public function LoginProcess(&$sEmail, &$sLogin, &$sPassword, $sSignMeToken = '', $sTwoFactorAuthCode = '')
public function LoginProcess(&$sEmail, &$sLogin, &$sPassword, $sSignMeToken = '',
$sAdditionalCode = '', $bAdditionalCodeSignMeSignMe = false)
{
if (false === \strpos($sEmail, '@') && 0 < \strlen(\trim($this->Config()->Get('login', 'default_domain', ''))))
{
@ -1424,32 +1426,43 @@ class Actions
$aData = $this->getTwoFactorInfo($oAccount->ParentEmailHelper());
if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable'])
{
$sTwoFactorAuthCode = \trim($sTwoFactorAuthCode);
if (empty($sTwoFactorAuthCode))
$iAdditionalCodeTimeoutLimit = 60 * 60 * 24 * 14; // two weeks
$iAdditionalCodeTimeout = isset($aData['Timeout']) && \is_numeric($aData['Timeout']) ? (int) $aData['Timeout'] : 0;
if (0 === $iAdditionalCodeTimeout || $iAdditionalCodeTimeout + $iAdditionalCodeTimeoutLimit < \time())
{
$this->Logger()->Write('TwoFactorAuth: Required Code for '.$oAccount->ParentEmailHelper().' account.');
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthRequired);
}
else
{
$this->Logger()->Write('TwoFactorAuth: Verify Code for '.$oAccount->ParentEmailHelper().' account.');
$bGood = false;
if (6 < \strlen($sTwoFactorAuthCode) && !empty($aData['BackupCodes']))
$sAdditionalCode = \trim($sAdditionalCode);
if (empty($sAdditionalCode))
{
$aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes'])));
$bGood = \in_array($sTwoFactorAuthCode, $aBackupCodes);
if ($bGood)
{
$this->removeBackupCodeFromTwoFactorInfo($oAccount->ParentEmailHelper(), $sTwoFactorAuthCode);
}
$this->Logger()->Write('TwoFactorAuth: Required Code for '.$oAccount->ParentEmailHelper().' account.');
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthRequired);
}
if (!$bGood && !$this->TwoFactorAuthProvider()->VerifyCode($aData['Secret'], $sTwoFactorAuthCode))
else
{
$this->loginErrorDelay();
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthError);
$this->Logger()->Write('TwoFactorAuth: Verify Code for '.$oAccount->ParentEmailHelper().' account.');
$bGood = false;
if (6 < \strlen($sAdditionalCode) && !empty($aData['BackupCodes']))
{
$aBackupCodes = \explode(' ', \trim(\preg_replace('/[^\d]+/', ' ', $aData['BackupCodes'])));
$bGood = \in_array($sAdditionalCode, $aBackupCodes);
if ($bGood)
{
$this->removeBackupCodeFromTwoFactorInfo($oAccount->ParentEmailHelper(), $sAdditionalCode);
}
}
if ($bAdditionalCodeSignMeSignMe)
{
$this->setSkipTimeoutForTwoFactor($oAccount->ParentEmailHelper());
}
if (!$bGood && !$this->TwoFactorAuthProvider()->VerifyCode($aData['Secret'], $sAdditionalCode))
{
$this->loginErrorDelay();
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountTwoFactorAuthError);
}
}
}
}
@ -1492,9 +1505,10 @@ class Actions
$sLogin = \trim($this->GetActionParam('Login', ''));
$sPassword = $this->GetActionParam('Password', '');
$sLanguage = $this->GetActionParam('Language', '');
$bSignMe = '1' === $this->GetActionParam('SignMe', '0');
$bSignMe = '1' === (string) $this->GetActionParam('SignMe', '0');
$sAdditionalCode = $this->GetActionParam('AdditionalCode', '');
$bAdditionalCodeSignMe = '1' === (string) $this->GetActionParam('AdditionalCodeSignMe', '0');
$this->Logger()->AddSecret($sPassword);
@ -1504,7 +1518,7 @@ class Actions
{
$oAccount = $this->LoginProcess($sEmail, $sLogin, $sPassword,
$bSignMe ? \md5(\microtime(true).APP_SALT.\rand(10000, 99999).$sEmail) : '',
$sAdditionalCode);
$sAdditionalCode, $bAdditionalCodeSignMe);
}
catch (\RainLoop\Exceptions\ClientException $oException)
{
@ -4631,7 +4645,8 @@ class Actions
'Enable' => false,
'Secret' => '',
'Url' => '',
'BackupCodes' => ''
'BackupCodes' => '',
'Timeout' => 0
);
if (!empty($sEmail))
@ -4657,6 +4672,7 @@ class Actions
$aResult['Enable'] = isset($mData['Enable']) ? !!$mData['Enable'] : false;
$aResult['Secret'] = $mData['Secret'];
$aResult['BackupCodes'] = $mData['BackupCodes'];
$aResult['Timeout'] = isset($mData['Timeout']) ? (int) $mData['Timeout'] : 0;
$aResult['Url'] = $this->TwoFactorAuthProvider()->GetQRCodeGoogleUrl(
$aResult['User'], $aResult['Secret'], $this->Config()->Get('webmail', 'title', ''));
@ -4723,6 +4739,41 @@ class Actions
return false;
}
/**
* @param string $sEmail
*
* @return bool
*/
private function setSkipTimeoutForTwoFactor($sEmail)
{
if (empty($sEmail))
{
return false;
}
$sData = $this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/'
);
if ($sData)
{
$mData = \RainLoop\Utils::DecodeKeyValues($sData);
if (\is_array($mData))
{
$mData['Timeout'] = \time();
return $this->StorageProvider()->Put(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/',
\RainLoop\Utils::EncodeKeyValues($mData)
);
}
}
return false;
}
/**
* @return array
*/
@ -4767,6 +4818,7 @@ class Actions
'User' => $sEmail,
'Enable' => false,
'Secret' => $sSecret,
'Timeout' => 0,
'BackupCodes' => \implode(' ', $aCodes)
))
);
@ -4822,6 +4874,7 @@ class Actions
'User' => $sEmail,
'Enable' => '1' === \trim($this->GetActionParam('Enable', '0')),
'Secret' => $mData['Secret'],
'Timeout' => isset($mData['Timeout']) ? $mData['Timeout'] : 0,
'BackupCodes' => $mData['BackupCodes']
))
);

View file

@ -66,7 +66,7 @@
.thm-border-radius(@login-border-radius);
.thm-box-shadow(@login-box-shadow);
.legend, .checkboxSignMe, g-ui-link {
.legend, .checkboxSignMe, .checkboxAdditionalCodeSignMe, .g-ui-link {
color: @login-color !important;
}
}

View file

@ -17,7 +17,7 @@
<label data-bind="click: function () { openPGP(!openPGP()); }">
<i data-bind="css: openPGP() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
Allow OpenPGP (beta)
Allow OpenPGP <span style="color:red">(beta)</span>
</label>
</div>
</div>
@ -26,7 +26,7 @@
<label data-bind="click: function () { allowTwoFactorAuth(!allowTwoFactorAuth()); }">
<i data-bind="css: allowTwoFactorAuth() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
Allow 2-Step Verification (Google Authenticator) (beta)
Allow 2-Step Verification (Google Authenticator)
</label>
</div>
</div>

View file

@ -47,13 +47,20 @@
</div>
<div class="control-group" data-bind="visible: additionalCode.visibility(), css: {'error': additionalCode.error}">
<div class="input-append">
<input class="i18n inputPassword span4" type="password" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
<input class="i18n inputAdditionalCode span4" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
data-bind="value: additionalCode, hasFocus: additionalCode.focused" data-i18n-placeholder="LOGIN/LABEL_VERIFICATION_CODE" />
<span class="add-on">
<i class="icon-key"></i>
</span>
</div>
</div>
<div class="control-group" data-bind="visible: additionalCode.visibility()">
<label class="pull-left additionalCodeSignMeLabel" data-bind="click: function () { additionalCodeSignMe(!additionalCodeSignMe()); }">
<i data-bind="css: additionalCodeSignMe() ? 'checkboxAdditionalCodeSignMe icon-checkbox-checked' : 'checkboxAdditionalCodeSignMe icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="LOGIN/LABEL_DONT_ASK_VERIFICATION_CODE"></span>
</label>
</div>
{{INCLUDE/BottomControlGroup/PLACE}}
<div class="control-group">
<button type="submit" class="btn btn-large span4 buttonLogin" data-bind="command: submitCommand">

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Passwort"
LABEL_SIGN_ME = "Anmeldung merken"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Anmelden"
TITLE_SIGN_IN_GOOGLE = "Mit Google anmelden"
TITLE_SIGN_IN_FACEBOOK = "Mit Facebook anmelden"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Password"
LABEL_SIGN_ME = "Remember Me"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Sign In"
TITLE_SIGN_IN_GOOGLE = "Sign In using Google"
TITLE_SIGN_IN_FACEBOOK = "Sign In using Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Contraseña"
LABEL_SIGN_ME = "Recuerdame"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Ingresar"
TITLE_SIGN_IN_GOOGLE = "Ingresar usando Google"
TITLE_SIGN_IN_FACEBOOK = "Ingresar usando Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Identifiant"
LABEL_PASSWORD = "Mot de passe"
LABEL_SIGN_ME = "Se souvenir de moi"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Se connecter"
TITLE_SIGN_IN_GOOGLE = "Se connecter avec Google"
TITLE_SIGN_IN_FACEBOOK = "Se connecter avec Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Belépés"
LABEL_PASSWORD = "Jelszó"
LABEL_SIGN_ME = "Megjegyzés"
LABEL_VERIFICATION_CODE = "Megerősítő kód"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Belépés"
TITLE_SIGN_IN_GOOGLE = "Belépés Google használatával"
TITLE_SIGN_IN_FACEBOOK = "Belépés Facebook használatával"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Innskrá"
LABEL_PASSWORD = "Lykilorð"
LABEL_SIGN_ME = "Muna"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Innskrá"
TITLE_SIGN_IN_GOOGLE = "Innskráning með Google"
TITLE_SIGN_IN_FACEBOOK = "Innskráning með Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Password"
LABEL_SIGN_ME = "Ricordami"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Accedi"
TITLE_SIGN_IN_GOOGLE = "Accedi usando Google"
TITLE_SIGN_IN_FACEBOOK = "Accedi usando Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "ログイン"
LABEL_PASSWORD = "パスワード"
LABEL_SIGN_ME = "サインイン状態を保持する"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "サインイン"
TITLE_SIGN_IN_GOOGLE = "Googleアカウントでログイン"
TITLE_SIGN_IN_FACEBOOK = "Facebookアカウントでログイン"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "아이디"
LABEL_PASSWORD = "비밀번호"
LABEL_SIGN_ME = "아이디 기억"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "로그인"
TITLE_SIGN_IN_GOOGLE = "구글 계정으로 로그인"
TITLE_SIGN_IN_FACEBOOK = "페이스북 계정으로 로그인"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Ielogoties"
LABEL_PASSWORD = "Parole"
LABEL_SIGN_ME = "Atcerēties mani"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Ielogoties"
TITLE_SIGN_IN_GOOGLE = "Ielogoties izmantojot Google"
TITLE_SIGN_IN_FACEBOOK = "Ielogoties izmantojot Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Paswoord"
LABEL_SIGN_ME = "Aangemeld blijven"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Aanmelden"
TITLE_SIGN_IN_GOOGLE = "Aanmelden met Google"
TITLE_SIGN_IN_FACEBOOK = "Aanmelden met Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Logg inn"
LABEL_PASSWORD = "Passord"
LABEL_SIGN_ME = "Husk meg"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Logg Inn"
TITLE_SIGN_IN_GOOGLE = "Logg inn Med Google"
TITLE_SIGN_IN_FACEBOOK = "Logg inn MED Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Login"
LABEL_PASSWORD = "Hasło"
LABEL_SIGN_ME = "Zapamiętaj mnie"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Zaloguj"
TITLE_SIGN_IN_GOOGLE = "Zaloguj się przez Google"
TITLE_SIGN_IN_FACEBOOK = "Zaloguj się przez Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Usuário"
LABEL_PASSWORD = "Senha"
LABEL_SIGN_ME = "Lembre-me"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Entre"
TITLE_SIGN_IN_GOOGLE = "Entre com a conta do Google"
TITLE_SIGN_IN_FACEBOOK = "Entre com a conta do Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Usuário"
LABEL_PASSWORD = "Senha"
LABEL_SIGN_ME = "Lembre-me"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Entre"
TITLE_SIGN_IN_GOOGLE = "Entre com a conta do Google"
TITLE_SIGN_IN_FACEBOOK = "Entre com a conta do Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Conectare"
LABEL_PASSWORD = "Parolă"
LABEL_SIGN_ME = "Ține-mă minte"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Conectare"
TITLE_SIGN_IN_GOOGLE = "Войти, используя Google"
TITLE_SIGN_IN_FACEBOOK = "Войти, используя Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Логин"
LABEL_PASSWORD = "Пароль"
LABEL_SIGN_ME = "Запомнить меня"
LABEL_VERIFICATION_CODE = "Код подтверждения"
LABEL_DONT_ASK_VERIFICATION_CODE = "Не спрашивать код в течение 2-х недель"
BUTTON_SIGN_IN = "Войти"
TITLE_SIGN_IN_GOOGLE = "Войти, используя Google"
TITLE_SIGN_IN_FACEBOOK = "Войти, используя Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "Používateľské meno"
LABEL_PASSWORD = "Heslo"
LABEL_SIGN_ME = "Zapamätať"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "Prihlásiť"
TITLE_SIGN_IN_GOOGLE = "Prihlásiť pomocu Google"
TITLE_SIGN_IN_FACEBOOK = "Prihlásiť pomocou Facebook"

View file

@ -4,6 +4,7 @@ LABEL_LOGIN = "登陆"
LABEL_PASSWORD = "密码"
LABEL_SIGN_ME = "记住我"
LABEL_VERIFICATION_CODE = "Verification Code"
LABEL_DONT_ASK_VERIFICATION_CODE = "Don't ask for the code for 2 weeks"
BUTTON_SIGN_IN = "登入"
TITLE_SIGN_IN_GOOGLE = "Sign In using Google"
TITLE_SIGN_IN_FACEBOOK = "Sign In using Facebook"

View file

@ -7187,7 +7187,8 @@ html.rl-no-preview-pane #rl-right .ui-resizable-handle {
.b-login-content .loginFormWrapper .inputLoginForm,
.b-login-content .loginFormWrapper .inputEmail,
.b-login-content .loginFormWrapper .inputLogin,
.b-login-content .loginFormWrapper .inputPassword {
.b-login-content .loginFormWrapper .inputPassword,
.b-login-content .loginFormWrapper .inputAdditionalCode {
font-size: 18px;
height: 30px;
line-height: 29px;

File diff suppressed because one or more lines are too long

View file

@ -11452,6 +11452,7 @@ function LoginViewModel()
this.additionalCode.error = ko.observable(false);
this.additionalCode.focused = ko.observable(false);
this.additionalCode.visibility = ko.observable(false);
this.additionalCodeSignMe = ko.observable(false);
this.logoImg = Utils.trim(RL.settingsGet('LoginLogo'));
this.loginDescription = Utils.trim(RL.settingsGet('LoginDescription'));
@ -11570,7 +11571,9 @@ function LoginViewModel()
}, this), this.email(), this.login(), this.password(), !!this.signMe(),
this.bSendLanguage ? this.mainLanguage() : '',
this.additionalCode.visibility() ? this.additionalCode() : '');
this.additionalCode.visibility() ? this.additionalCode() : '',
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
);
return true;
@ -16630,8 +16633,9 @@ WebMailAjaxRemoteStorage.prototype.folders = function (fCallback)
* @param {boolean} bSignMe
* @param {string=} sLanguage
* @param {string=} sAdditionalCode
* @param {boolean=} bAdditionalCodeSignMe
*/
WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode)
WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
{
this.defaultRequest(fCallback, 'Login', {
'Email': sEmail,
@ -16639,6 +16643,7 @@ WebMailAjaxRemoteStorage.prototype.login = function (fCallback, sEmail, sLogin,
'Password': sPassword,
'Language': sLanguage || '',
'AdditionalCode': sAdditionalCode || '',
'AdditionalCodeSignMe': bAdditionalCodeSignMe ? '1' : '0',
'SignMe': bSignMe ? '1' : '0'
});
};
@ -19558,12 +19563,14 @@ RainLoopApp.prototype.bootstart = function ()
Plugins.runHook('rl-start-user-screens');
RL.pub('rl.bootstart-user-screens');
if (!!RL.settingsGet('AccountSignMe'))
if (!!RL.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler)
{
_.delay(function () {
window.navigator.registerProtocolHandler('mailto',
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
'' + (RL.settingsGet('Title') || 'RainLoop'));
try {
window.navigator.registerProtocolHandler('mailto',
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
'' + (RL.settingsGet('Title') || 'RainLoop'));
} catch(e) {}
if (RL.settingsGet('MailToEmail'))
{

File diff suppressed because one or more lines are too long