Fix infinite loop with sign me

Added data-cfasync="false" for CloudFlare Rocketscript
This commit is contained in:
RainLoop Team 2014-05-21 23:49:27 +04:00
parent be77754286
commit b6a06d74a9
12 changed files with 787 additions and 751 deletions

View file

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

View file

@ -108,7 +108,7 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
if ($pubkey == null || $pubkey == '') {
die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
}
if ($use_ssl) {
$server = RECAPTCHA_API_SECURE_SERVER;
} else {
@ -119,7 +119,7 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
if ($error) {
$errorpart = "&amp;error=" . $error;
}
return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
return '<script type="text/javascript" data-cfasync="false" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
<noscript>
<iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
@ -219,7 +219,7 @@ function _recaptcha_aes_encrypt($val,$ky) {
if (! function_exists ("mcrypt_encrypt")) {
die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
}
$mode=MCRYPT_MODE_CBC;
$mode=MCRYPT_MODE_CBC;
$enc=MCRYPT_RIJNDAEL_128;
$val=_recaptcha_aes_pad($val);
return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
@ -236,11 +236,11 @@ function recaptcha_mailhide_url($pubkey, $privkey, $email) {
die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
"you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
}
$ky = pack('H*', $privkey);
$cryptmail = _recaptcha_aes_encrypt ($email, $ky);
return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
}
@ -271,7 +271,7 @@ function _recaptcha_mailhide_email_parts ($email) {
function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email);
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);

View file

@ -1360,6 +1360,35 @@ class Actions
}
}
/**
* @param \RainLoop\Account $oAccount
*
* @throws \RainLoop\Exceptions\ClientException
*/
public function CheckMailConnection($oAccount)
{
try
{
$this->MailClient()
->Connect($oAccount->Domain()->IncHost(\MailSo\Base\Utils::GetDomainFromEmail($oAccount->Email())),
$oAccount->Domain()->IncPort(), $oAccount->Domain()->IncSecure())
->Login($oAccount->IncLogin(), $oAccount->Password())
;
}
catch (\RainLoop\Exceptions\ClientException $oException)
{
throw $oException;
}
catch (\MailSo\Net\Exceptions\ConnectionException $oException)
{
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
}
catch (\Exception $oException)
{
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
}
}
/**
* @param string $sEmail
* @param string $sLogin
@ -1461,26 +1490,12 @@ class Actions
try
{
$this->MailClient()
->Connect($oAccount->Domain()->IncHost(\MailSo\Base\Utils::GetDomainFromEmail($oAccount->Email())),
$oAccount->Domain()->IncPort(), $oAccount->Domain()->IncSecure())
->Login($oAccount->IncLogin(), $oAccount->Password())
;
}
catch (\RainLoop\Exceptions\ClientException $oException)
{
$this->loginErrorDelay();
throw $oException;
}
catch (\MailSo\Net\Exceptions\ConnectionException $oException)
{
$this->loginErrorDelay();
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::ConnectionError, $oException);
$this->CheckMailConnection($oAccount);
}
catch (\Exception $oException)
{
$this->loginErrorDelay();
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
throw $oException;
}
return $oAccount;
@ -1890,6 +1905,21 @@ class Actions
));
}
/**
* @param \RainLoop\Account $oAccount
*/
public function ClearSignMeData($oAccount)
{
if ($oAccount)
{
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY);
$this->StorageProvider()->Clear(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$oAccount->SignMeToken());
}
}
/**
* @return array
*/
@ -1898,11 +1928,7 @@ class Actions
$oAccount = $this->getAccountFromToken(false);
if ($oAccount && $oAccount->SignMe())
{
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SIGN_ME_TOKEN_KEY);
$this->StorageProvider()->Clear(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$oAccount->SignMeToken());
$this->ClearSignMeData($oAccount);
}
return $this->TrueResponse(__FUNCTION__);

File diff suppressed because it is too large Load diff

View file

@ -994,8 +994,18 @@ class ServiceActions
$oAccount = $this->oActions->GetAccountFromSignMeToken();
if ($oAccount)
{
$this->oActions->AuthProcess($oAccount);
$sAuthAccountHash = $this->oActions->GetSpecAuthToken();
try
{
$this->oActions->CheckMailConnection($oAccount);
$this->oActions->AuthProcess($oAccount);
$sAuthAccountHash = $this->oActions->GetSpecAuthToken();
}
catch (\Exception $oException)
{
$this->oActions->ClearSignMeData($oAccount);
}
}
}
@ -1021,7 +1031,7 @@ class ServiceActions
$this->oActions->Plugins()->CompileTemplate($bAdmin);
return
($bWrapByScriptTag ? '<script type="text/javascript">' : '').
($bWrapByScriptTag ? '<script type="text/javascript" data-cfasync="false">' : '').
'window.rainloopTEMPLATES='.\MailSo\Base\Utils::Php2js(array($sHtml)).';'.
($bWrapByScriptTag ? '</script>' : '')
;
@ -1064,7 +1074,7 @@ class ServiceActions
$sResult = empty($sLangJs) ? 'null' : '{'.\substr($sLangJs, 0, -1).'}';
return
($bWrapByScriptTag ? '<script type="text/javascript">' : '').
($bWrapByScriptTag ? '<script type="text/javascript" data-cfasync="false">' : '').
'window.rainloopI18N='.$sResult.';'.$sMoment.
($bWrapByScriptTag ? '</script>' : '')
;
@ -1079,7 +1089,7 @@ class ServiceActions
private function compileAppData($aAppData, $bWrapByScriptTag = true)
{
return
($bWrapByScriptTag ? '<script>' : '').
($bWrapByScriptTag ? '<script type="text/javascript" data-cfasync="false">' : '').
'window.rainloopAppData='.\json_encode($aAppData).';'.
'if(window.__rlah_set){__rlah_set()};'.
($bWrapByScriptTag ? '</script>' : '')

View file

@ -311,7 +311,7 @@ class Social
$sCheckToken = !empty($aParts[0]) ? $aParts[0] : '';
$sCheckAuth = !empty($aParts[1]) ? $aParts[1] : '';
}
$sRedirectUrl = $this->oHttp->GetFullUrl().'?SocialGoogle';
if (!$this->oHttp->HasQuery('code'))
{
@ -415,7 +415,7 @@ class Social
@\header('Content-Type: text/html; charset=utf-8');
$sCallBackType = $bLogin ? '_login' : '';
$sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_google'.$sCallBackType.'_service';
$sResult = '<script>opener && opener.'.$sConnectionFunc.' && opener.'.
$sResult = '<script type="text/javascript" data-cfasync="false">opener && opener.'.$sConnectionFunc.' && opener.'.
$sConnectionFunc.'('.$iErrorCode.'); self && self.close && self.close();</script>';
}
@ -451,7 +451,7 @@ class Social
try
{
$oAccount = $this->oActions->GetAccount();
$oFacebook = $this->FacebookConnector($oAccount ? $oAccount : null);
if ($oFacebook)
{
@ -537,7 +537,7 @@ class Social
$aUserData = \RainLoop\Utils::DecodeKeyValues($sUserData);
}
}
if ($aUserData && \is_array($aUserData) &&
!empty($aUserData['Email']) &&
!empty($aUserData['Login']) &&
@ -547,7 +547,7 @@ class Social
if ($oAccount instanceof \RainLoop\Account)
{
$this->oActions->AuthProcess($oAccount);
$iErrorCode = 0;
}
}
@ -580,7 +580,7 @@ class Social
@\header('Content-Type: text/html; charset=utf-8');
$sCallBackType = $bLogin ? '_login' : '';
$sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_facebook'.$sCallBackType.'_service';
$sResult = '<script>opener && opener.'.$sConnectionFunc.' && opener.'.
$sResult = '<script type="text/javascript" data-cfasync="false">opener && opener.'.$sConnectionFunc.' && opener.'.
$sConnectionFunc.'('.$iErrorCode.'); self && self.close && self.close();</script>';
}
@ -729,7 +729,7 @@ class Social
if ($oAccount instanceof \RainLoop\Account)
{
$this->oActions->AuthProcess($oAccount);
$iErrorCode = 0;
}
}
@ -778,7 +778,7 @@ class Social
@\header('Content-Type: text/html; charset=utf-8');
$sCallBackType = $bLogin ? '_login' : '';
$sConnectionFunc = 'rl_'.\md5(\RainLoop\Utils::GetConnectionToken()).'_twitter'.$sCallBackType.'_service';
$sResult = '<script>opener && opener.'.$sConnectionFunc.' && opener.'.
$sResult = '<script type="text/javascript" data-cfasync="false">opener && opener.'.$sConnectionFunc.' && opener.'.
$sConnectionFunc.'('.$iErrorCode.'); self && self.close && self.close();</script>';
}

View file

@ -5,7 +5,7 @@ namespace RainLoop;
class Utils
{
static $Cookies = null;
/**
* @return void
*/
@ -34,7 +34,7 @@ class Utils
{
return \MailSo\Base\Crypt::XxteaDecrypt($sEncriptedString, $sKey);
}
/**
* @param array $aValues
* @param string $sCustomKey = ''
@ -258,7 +258,7 @@ class Utils
foreach ($aList as $sName)
{
$sTemplateName = \substr($sName, 0, -5);
$sResult .= '<script id="'.\preg_replace('/[^a-zA-Z0-9]/', '', $sTemplateName).'" type="text/html">'.
$sResult .= '<script id="'.\preg_replace('/[^a-zA-Z0-9]/', '', $sTemplateName).'" type="text/html" data-cfasync="false">'.
$oAction->ProcessTemplate($sTemplateName, \file_get_contents($sDirName.'/'.$sName)).'</script>';
}
@ -366,12 +366,12 @@ class Utils
}
public static function CustomBaseConvert($sNumberInput, $sFromBaseInput = '0123456789', $sToBaseInput = '0123456789')
{
{
if ($sFromBaseInput === $sToBaseInput)
{
return $sNumberInput;
}
$mFromBase = \str_split($sFromBaseInput, 1);
$mToBase = \str_split($sToBaseInput, 1);
$aNumber = \str_split($sNumberInput, 1);
@ -387,10 +387,10 @@ class Utils
{
$mRetVal = \bcadd($mRetVal, \bcmul(\array_search($aNumber[$iIndex - 1], $mFromBase), \bcpow($iFromLen, $numberLen - $iIndex)));
}
return $mRetVal;
}
if ($sFromBaseInput != '0123456789')
{
$sBase10 = \RainLoop\Utils::CustomBaseConvert($sNumberInput, $sFromBaseInput, '0123456789');

View file

@ -13,9 +13,9 @@
<![endif]-->
<script type="text/javascript">
function __fIncludeScr(sSrc) {
document.write(unescape('%3Csc' + 'ript type="text/jav' + 'ascr' + 'ipt" sr' + 'c="' + sSrc + '"%3E%3C/' + 'scr' + 'ipt%3E'));
document.write(unescape('%3Csc' + 'ript data-cfasync="false" type="text/jav' + 'ascr' + 'ipt" sr' + 'c="' + sSrc + '"%3E%3C/' + 'scr' + 'ipt%3E'));
}
if (!navigator || !navigator.cookieEnabled) {
document.location.replace('{{BaseAppIndexFile}}?/NoCookie');
}
@ -28,11 +28,11 @@
<link rel="apple-touch-icon" href="{{BaseAppAppleTouchFile}}" type="image/png" />
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" />
<link type="text/css" rel="stylesheet" id="rlThemeLink" />
<script type="text/javascript">{{BaseAppBootScriptSource}}</script>
<script type="text/javascript">
<script type="text/javascript" data-cfasync="false">{{BaseAppBootScriptSource}}</script>
<script type="text/javascript" data-cfasync="false">
__fIncludeScr('{{BaseAppDataScriptLink}}' + (window.__rlah ? window.__rlah() || '0' : '0') + '/{{BaseRandHash}}/');
</script>
<script type="text/javascript">
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['NewThemeLink']) {
document.getElementById('rlThemeLink').href = window.rainloopAppData['NewThemeLink'];
}
@ -48,7 +48,7 @@
<div class="e-bounce bounce3"></div>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript" data-cfasync="false">
var oE = document.getElementById('rl-loading');
if (oE) {
oE.style.opacity = 0;
@ -71,25 +71,25 @@
</div>
<div id="rl-templates"></div>
<div id="rl-hidden"></div>
<script type="text/javascript" src="{{BaseAppLibsScriptLink}}"></script>
<script type="text/javascript" src="{{BaseAppEditorScriptLink}}"></script>
<script type="text/javascript">
<script type="text/javascript" src="{{BaseAppLibsScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" src="{{BaseAppEditorScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['TemplatesLink']) {
__fIncludeScr(window.rainloopAppData['TemplatesLink']);
}
</script>
<script type="text/javascript">
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['LangLink']) {
__fIncludeScr(window.rainloopAppData['LangLink']);
}
</script>
<script type="text/javascript" src="{{BaseAppMainScriptLink}}"></script>
<script type="text/javascript">
<script type="text/javascript" src="{{BaseAppMainScriptLink}}" data-cfasync="false"></script>
<script type="text/javascript" data-cfasync="false">
if (window.rainloopAppData && window.rainloopAppData['PluginsLink']) {
__fIncludeScr(window.rainloopAppData['PluginsLink']);
}
</script>
<script type="text/javascript">
<script type="text/javascript" data-cfasync="false">
function __showError() {
var oR = document.getElementById('rl-loading'),
oL = document.getElementById('rl-loading-error');

View file

@ -637,7 +637,7 @@
border-radius: 8px;
}
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
@ -1142,7 +1142,7 @@ table {
border-collapse: collapse;
border-spacing: 0;
}
@charset "UTF-8";
@font-face {
@ -1513,7 +1513,7 @@ table {
.icon-resize-out:before {
content: "\e06d";
}
/** initial setup **/
.nano {
/*
@ -1630,7 +1630,7 @@ table {
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
background-color: rgba(0, 0, 0, 0.4);
}
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
@ -1995,7 +1995,7 @@ img.mfp-img {
right: 0;
padding-top: 0; }
/* overlay at start */
.mfp-fade.mfp-bg {
@ -2041,7 +2041,7 @@ img.mfp-img {
-moz-transform: translateX(50px);
transform: translateX(50px);
}
.simple-pace {
-webkit-pointer-events: none;
pointer-events: none;
@ -2112,7 +2112,7 @@ img.mfp-img {
@keyframes simple-pace-stripe-animation {
0% { transform: none; transform: none; }
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
}
}
.inputosaurus-container {
background-color:#fff;
border:1px solid #bcbec0;
@ -2180,7 +2180,7 @@ img.mfp-img {
box-shadow:none;
}
.inputosaurus-input-hidden { display:none; }
.flag-wrapper {
width: 24px;
height: 16px;
@ -2224,7 +2224,7 @@ img.mfp-img {
.flag.flag-pt-br {background-position: -192px -11px}
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
.clearfix {
*zoom: 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long