Remove LOGIN parameter (login, ownCloud, sso) (Security fix)

Code refactoring
This commit is contained in:
RainLoop Team 2014-06-26 20:11:49 +04:00
parent cd448ffe91
commit 5d84af4458
22 changed files with 393 additions and 488 deletions

View file

@ -20,27 +20,25 @@ if (isset($_POST['appname'], $_POST['rainloop-password'], $_POST['rainloop-email
$sUser = OCP\User::getUser(); $sUser = OCP\User::getUser();
$sPostEmail = $_POST['rainloop-email']; $sPostEmail = $_POST['rainloop-email'];
$sPostLogin = isset($_POST['rainloop-login']) ? $_POST['rainloop-login'] : '';
OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-email', $sPostEmail); OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-email', $sPostEmail);
OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-login', $sPostLogin);
$sPass = $_POST['rainloop-password']; $sPass = $_POST['rainloop-password'];
if ('******' !== $sPass && '' !== $sPass) if ('******' !== $sPass && '' !== $sPass)
{ {
include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php'; include_once OC_App::getAppPath('rainloop').'/lib/RainLoopHelper.php';
OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-password', OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-password',
OC_RainLoop_Helper::encodePassword($sPass, md5($sPostEmail.$sPostLogin))); OC_RainLoop_Helper::encodePassword($sPass, md5($sPostEmail)));
} }
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', ''); $sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
$sLogin = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', '');
} }
else else
{ {
OC_JSON::error(array('Message' => 'Invalid argument(s)', 'Email' => $sEmail, 'Login' => $sLogin)); OC_JSON::error(array('Message' => 'Invalid argument(s)', 'Email' => $sEmail));
return false; return false;
} }
OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail, 'Login' => $sLogin)); OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail));
return true; return true;

View file

@ -2,7 +2,7 @@
class OC_RainLoop_Helper class OC_RainLoop_Helper
{ {
public static function getSsoHash($sUrl, $sSsoKey, $sEmail, $sPassword, $sLogin = '') public static function getSsoHash($sUrl, $sSsoKey, $sEmail, $sPassword)
{ {
if (!function_exists('curl_init')) if (!function_exists('curl_init'))
{ {
@ -21,8 +21,7 @@ class OC_RainLoop_Helper
CURLOPT_POSTFIELDS => http_build_query(array( CURLOPT_POSTFIELDS => http_build_query(array(
'SsoKey' => $sSsoKey, 'SsoKey' => $sSsoKey,
'Email' => $sEmail, 'Email' => $sEmail,
'Password' => $sPassword, 'Password' => $sPassword
'Login' => $sLogin
), '', '&'), ), '', '&'),
CURLOPT_TIMEOUT => 5 CURLOPT_TIMEOUT => 5
)); ));

View file

@ -30,7 +30,6 @@ else
$sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', ''); $sEmail = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-email', '');
$oTemplate->assign('rainloop-email', $sEmail); $oTemplate->assign('rainloop-email', $sEmail);
$oTemplate->assign('rainloop-login', OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', ''));
$sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', ''); $sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', '');
$oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******'); $oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******');

View file

@ -8,9 +8,6 @@
<input type="text" id="rainloop-email" name="rainloop-email" <input type="text" id="rainloop-email" name="rainloop-email"
value="<?php echo $_['rainloop-email']; ?>" placeholder="<?php p($l->t('Email')); ?>" /> value="<?php echo $_['rainloop-email']; ?>" placeholder="<?php p($l->t('Email')); ?>" />
<input type="text" id="rainloop-email" name="rainloop-login"
value="<?php echo $_['rainloop-login']; ?>" placeholder="<?php p($l->t('Login (optional)')); ?>" />
<input type="password" id="rainloop-password" name="rainloop-password" <input type="password" id="rainloop-password" name="rainloop-password"
value="<?php echo $_['rainloop-password']; ?>" placeholder="<?php p($l->t('Password')); ?>" /> value="<?php echo $_['rainloop-password']; ?>" placeholder="<?php p($l->t('Password')); ?>" />

View file

@ -985,16 +985,6 @@ RainLoopApp.prototype.getContactsTagsAutocomplete = function (sQuery, fCallback)
})); }));
}; };
RainLoopApp.prototype.emailsPicsHashes = function ()
{
RL.remote().emailsPicsHashes(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
RL.cache().setEmailsPicsHashesData(oData.Result);
}
});
};
/** /**
* @param {string} sMailToUrl * @param {string} sMailToUrl
* @returns {boolean} * @returns {boolean}
@ -1190,8 +1180,6 @@ RainLoopApp.prototype.bootstart = function ()
_.delay(function () { _.delay(function () {
RL.emailsPicsHashes();
RL.remote().servicesPics(function (sResult, oData) { RL.remote().servicesPics(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {

View file

@ -214,15 +214,6 @@ LinkBuilder.prototype.langLink = function (sLang)
return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/'; return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/';
}; };
/**
* @param {string} sHash
* @return {string}
*/
LinkBuilder.prototype.getUserPicUrlFromHash = function (sHash)
{
return this.sServer + '/Raw/' + this.sSpecSuffix + '/UserPic/' + sHash + '/' + this.sVersion + '/';
};
/** /**
* @return {string} * @return {string}
*/ */

View file

@ -5,16 +5,10 @@
*/ */
function AbstractCacheStorage() function AbstractCacheStorage()
{ {
this.oEmailsPicsHashes = {};
this.oServices = {}; this.oServices = {};
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar); this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
} }
/**
* @type {Object}
*/
AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
/** /**
* @type {Object} * @type {Object}
*/ */
@ -28,7 +22,6 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
AbstractCacheStorage.prototype.clear = function () AbstractCacheStorage.prototype.clear = function ()
{ {
this.oServices = {}; this.oServices = {};
this.oEmailsPicsHashes = {};
}; };
/** /**
@ -42,19 +35,11 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
var var
sUrl = '', sUrl = '',
sService = '', sService = '',
sEmailLower = sEmail.toLowerCase(), sEmailLower = sEmail.toLowerCase()
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmailLower]) ? '' : this.oEmailsPicsHashes[sEmailLower]
; ;
if ('' !== sPicHash) sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
{ sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
}
else
{
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
}
if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower) if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower)
{ {
@ -75,11 +60,3 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{ {
this.oServices = oData; this.oServices = oData;
}; };
/**
* @param {Object} oData
*/
AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};

View file

@ -728,14 +728,6 @@ WebMailAjaxRemoteStorage.prototype.servicesPics = function (fCallback)
this.defaultRequest(fCallback, 'ServicesPics'); this.defaultRequest(fCallback, 'ServicesPics');
}; };
/**
* @param {?Function} fCallback
*/
WebMailAjaxRemoteStorage.prototype.emailsPicsHashes = function (fCallback)
{
this.defaultRequest(fCallback, 'EmailsPicsHashes');
};
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */

View file

@ -209,7 +209,6 @@ class ImapClient extends \MailSo\Net\NetClient
{ {
if ($this->oLogger) if ($this->oLogger)
{ {
$this->oLogger->AddSecret($this->EscapeString($sLogin));
$this->oLogger->AddSecret($this->EscapeString($sPassword)); $this->oLogger->AddSecret($this->EscapeString($sPassword));
} }

View file

@ -158,14 +158,6 @@ class Actions
return $this->sSpecAuthToken; return $this->sSpecAuthToken;
} }
/**
* @return string
*/
public function BuildSsoCacherKey($sSsoHash)
{
return '/Sso/Data/'.$sSsoHash.'/Login/';
}
/** /**
* @return \RainLoop\Application * @return \RainLoop\Application
*/ */
@ -409,8 +401,9 @@ class Actions
$this->StorageProvider()->Put(null, $this->StorageProvider()->Put(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$oAccount->SignMeToken(), \RainLoop\KeyPathHelper::SignMeUserToken($oAccount->SignMeToken()),
$oAccount->GetAuthToken()); $oAccount->GetAuthToken()
);
} }
} }
} }
@ -975,7 +968,7 @@ class Actions
{ {
$oAccount = $this->GetAccountFromCustomToken($this->StorageProvider()->Get(null, $oAccount = $this->GetAccountFromCustomToken($this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$sSignMeToken \RainLoop\KeyPathHelper::SignMeUserToken($sSignMeToken)
), false, false); ), false, false);
} }
@ -1418,7 +1411,6 @@ class Actions
/** /**
* @param string $sEmail * @param string $sEmail
* @param string $sLogin
* @param string $sPassword * @param string $sPassword
* @param string $sSignMeToken = '' * @param string $sSignMeToken = ''
* @param string $sAdditionalCode = '' * @param string $sAdditionalCode = ''
@ -1427,7 +1419,7 @@ class Actions
* @return \RainLoop\Account * @return \RainLoop\Account
* @throws \RainLoop\Exceptions\ClientException * @throws \RainLoop\Exceptions\ClientException
*/ */
public function LoginProcess(&$sEmail, &$sLogin, &$sPassword, $sSignMeToken = '', public function LoginProcess(&$sEmail, &$sPassword, $sSignMeToken = '',
$sAdditionalCode = '', $bAdditionalCodeSignMeSignMe = false) $sAdditionalCode = '', $bAdditionalCodeSignMeSignMe = false)
{ {
if (false === \strpos($sEmail, '@') && 0 < \strlen(\trim($this->Config()->Get('login', 'default_domain', '')))) if (false === \strpos($sEmail, '@') && 0 < \strlen(\trim($this->Config()->Get('login', 'default_domain', ''))))
@ -1435,13 +1427,13 @@ class Actions
$sEmail = $sEmail.'@'.\trim(\trim($this->Config()->Get('login', 'default_domain', '')), ' @'); $sEmail = $sEmail.'@'.\trim(\trim($this->Config()->Get('login', 'default_domain', '')), ' @');
} }
if (0 === \strlen($sLogin)) $this->Logger()->AddSecret($sPassword);
{
$sLogin = $sEmail;
}
$sLogin = $sEmail;
$this->Plugins()->RunHook('filter.login-credentials', array(&$sEmail, &$sLogin, &$sPassword)); $this->Plugins()->RunHook('filter.login-credentials', array(&$sEmail, &$sLogin, &$sPassword));
$this->Logger()->AddSecret($sPassword);
$oAccount = $this->LoginProvide($sEmail, $sLogin, $sPassword, $sSignMeToken); $oAccount = $this->LoginProvide($sEmail, $sLogin, $sPassword, $sSignMeToken);
if (!($oAccount instanceof \RainLoop\Account)) if (!($oAccount instanceof \RainLoop\Account))
{ {
@ -1538,14 +1530,11 @@ class Actions
$sAdditionalCode = $this->GetActionParam('AdditionalCode', ''); $sAdditionalCode = $this->GetActionParam('AdditionalCode', '');
$bAdditionalCodeSignMe = '1' === (string) $this->GetActionParam('AdditionalCodeSignMe', '0'); $bAdditionalCodeSignMe = '1' === (string) $this->GetActionParam('AdditionalCodeSignMe', '0');
$this->Logger()->AddSecret($sPassword);
$oAccount = null; $oAccount = null;
try try
{ {
$sLogin = ''; $oAccount = $this->LoginProcess($sEmail, $sPassword,
$oAccount = $this->LoginProcess($sEmail, $sLogin, $sPassword,
$bSignMe ? \md5(\microtime(true).APP_SALT.\rand(10000, 99999).$sEmail) : '', $bSignMe ? \md5(\microtime(true).APP_SALT.\rand(10000, 99999).$sEmail) : '',
$sAdditionalCode, $bAdditionalCodeSignMe); $sAdditionalCode, $bAdditionalCodeSignMe);
} }
@ -1592,10 +1581,11 @@ class Actions
{ {
$sAccounts = $this->StorageProvider()->Get(null, $sAccounts = $this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'Webmail/Accounts/'.$sParentEmail.'/Array', null); \RainLoop\KeyPathHelper::WebmailAccounts($sParentEmail),
null
);
$aAccounts = $sAccounts ? @\unserialize($sAccounts) : array(); $aAccounts = $sAccounts ? @\unserialize($sAccounts) : array();
if (\is_array($aAccounts) && 0 < \count($aAccounts)) if (\is_array($aAccounts) && 0 < \count($aAccounts))
{ {
if (1 === \count($aAccounts)) if (1 === \count($aAccounts))
@ -1670,12 +1660,12 @@ class Actions
(1 === \count($aAccounts) && !empty($aAccounts[$sParentEmail]))) (1 === \count($aAccounts) && !empty($aAccounts[$sParentEmail])))
{ {
$this->StorageProvider()->Clear(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, $this->StorageProvider()->Clear(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'Webmail/Accounts/'.$sParentEmail.'/Array'); \RainLoop\KeyPathHelper::WebmailAccounts($sParentEmail));
} }
else else
{ {
$this->StorageProvider()->Put(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, $this->StorageProvider()->Put(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'Webmail/Accounts/'.$sParentEmail.'/Array', @\serialize($aAccounts)); \RainLoop\KeyPathHelper::WebmailAccounts($sParentEmail), @\serialize($aAccounts));
} }
} }
@ -1720,8 +1710,6 @@ class Actions
$sEmail = \trim($this->GetActionParam('Email', '')); $sEmail = \trim($this->GetActionParam('Email', ''));
$sPassword = $this->GetActionParam('Password', ''); $sPassword = $this->GetActionParam('Password', '');
$this->Logger()->AddSecret($sPassword);
$sParentEmail = $oAccount->ParentEmailHelper(); $sParentEmail = $oAccount->ParentEmailHelper();
$sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true); $sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true);
@ -1730,8 +1718,7 @@ class Actions
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountAlreadyExists); throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountAlreadyExists);
} }
$sLogin = ''; $oNewAccount = $this->LoginProcess($sEmail, $sPassword);
$oNewAccount = $this->LoginProcess($sEmail, $sLogin, $sPassword);
$oNewAccount->SetParentEmail($sParentEmail); $oNewAccount->SetParentEmail($sParentEmail);
$aAccounts = $this->GetAccounts($oAccount); $aAccounts = $this->GetAccounts($oAccount);
@ -1938,7 +1925,8 @@ class Actions
$this->StorageProvider()->Clear(null, $this->StorageProvider()->Clear(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'SignMe/UserToken/'.$oAccount->SignMeToken()); \RainLoop\KeyPathHelper::SignMeUserToken($oAccount->SignMeToken())
);
} }
} }
@ -2325,10 +2313,10 @@ class Actions
if (2 < \strlen($sDomain)) if (2 < \strlen($sDomain))
{ {
$sValue = ''; $sValue = '';
$iTime = $this->Cacher()->GetTimer('Licensing/DomainKey/Value/'.$sDomain); $iTime = $this->Cacher()->GetTimer(\RainLoop\KeyPathHelper::LicensingDomainKeyValue($sDomain));
if (!$sForce && $iTime + 60 * 5 > \time()) if (!$sForce && $iTime + 60 * 5 > \time())
{ {
$sValue = $this->Cacher()->Get('Licensing/DomainKey/Value/'.$sDomain); $sValue = $this->Cacher()->Get(\RainLoop\KeyPathHelper::LicensingDomainKeyValue($sDomain));
} }
if (0 === \strlen($sValue)) if (0 === \strlen($sValue))
@ -2350,8 +2338,8 @@ class Actions
\sleep(1); \sleep(1);
} }
$this->Cacher()->Set('Licensing/DomainKey/Value/'.$sDomain, $sValue); $this->Cacher()->Set(\RainLoop\KeyPathHelper::LicensingDomainKeyValue($sDomain), $sValue);
$this->Cacher()->SetTimer('Licensing/DomainKey/Value/'.$sDomain); $this->Cacher()->SetTimer(\RainLoop\KeyPathHelper::LicensingDomainKeyValue($sDomain));
} }
$aMatch = array(); $aMatch = array();
@ -2663,7 +2651,7 @@ class Actions
$oHttp = \MailSo\Base\Http::SingletonInstance(); $oHttp = \MailSo\Base\Http::SingletonInstance();
$sCacheKey = 'UPDATER/('.$sRepo.')/'.$sRepoFile; $sCacheKey = \RainLoop\KeyPathHelper::RepositoryCacheFile($sRepo, $sRepoFile);
$sRep = $this->Cacher()->Get($sCacheKey); $sRep = $this->Cacher()->Get($sCacheKey);
if ('' !== $sRep) if ('' !== $sRep)
{ {
@ -2747,7 +2735,7 @@ class Actions
$oHttp = \MailSo\Base\Http::SingletonInstance(); $oHttp = \MailSo\Base\Http::SingletonInstance();
$sCacheKey = 'CORE-UPDATER/'.$sRepo; $sCacheKey = \RainLoop\KeyPathHelper::RepositoryCacheCore($sRepo);
$sRep = $this->Cacher()->Get($sCacheKey); $sRep = $this->Cacher()->Get($sCacheKey);
if ('' !== $sRep) if ('' !== $sRep)
{ {
@ -3419,14 +3407,6 @@ class Actions
$this->setSettingsFromParams($oSettings, 'SignatureToAll', 'bool'); $this->setSettingsFromParams($oSettings, 'SignatureToAll', 'bool');
$this->setSettingsFromParams($oSettings, 'EnableTwoFactor', 'bool'); $this->setSettingsFromParams($oSettings, 'EnableTwoFactor', 'bool');
$this->setSettingsFromParams($oSettings, 'CustomThemeImg', 'string');
if ('' === $oSettings->GetConf('CustomThemeImg', ''))
{
$this->StorageProvider()->Clear($oAccount,
\RainLoop\Providers\Storage\Enumerations\StorageType::USER, 'CustomThemeBackground');
}
return $this->DefaultResponse(__FUNCTION__, return $this->DefaultResponse(__FUNCTION__,
$this->SettingsProvider()->Save($oAccount, $oSettings)); $this->SettingsProvider()->Save($oAccount, $oSettings));
} }
@ -4725,7 +4705,7 @@ class Actions
$sFolderFullName = $this->GetActionParam('MessageFolder', ''); $sFolderFullName = $this->GetActionParam('MessageFolder', '');
$sUid = $this->GetActionParam('MessageUid', ''); $sUid = $this->GetActionParam('MessageUid', '');
$this->Cacher()->Set('/ReadReceipt/'.$oAccount->Email().'/'.$sFolderFullName.'/'.$sUid, '1'); $this->Cacher()->Set(\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $sFolderFullName, $sUid), '1');
if (0 < \strlen($sFolderFullName) && 0 < \strlen($sUid)) if (0 < \strlen($sFolderFullName) && 0 < \strlen($sUid))
{ {
@ -4779,7 +4759,8 @@ class Actions
{ {
$mResult = null; $mResult = null;
$sData = $this->StorageProvider()->Get($oAccount->ParentEmailHelper(), $sData = $this->StorageProvider()->Get(
$oAccount->ParentEmailHelper(),
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
'contacts_sync' 'contacts_sync'
); );
@ -4821,7 +4802,8 @@ class Actions
$mData = $this->getContactsSyncData($oAccount); $mData = $this->getContactsSyncData($oAccount);
$bResult = $this->StorageProvider()->Put($oAccount->ParentEmailHelper(), $bResult = $this->StorageProvider()->Put(
$oAccount->ParentEmailHelper(),
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
'contacts_sync', 'contacts_sync',
\RainLoop\Utils::EncodeKeyValues(array( \RainLoop\Utils::EncodeKeyValues(array(
@ -4883,7 +4865,7 @@ class Actions
$sData = $this->StorageProvider()->Get(null, $sData = $this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/' \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail)
); );
if ($sData) if ($sData)
@ -4941,7 +4923,7 @@ class Actions
$sData = $this->StorageProvider()->Get(null, $sData = $this->StorageProvider()->Get(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/' \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail)
); );
if ($sData) if ($sData)
@ -4957,7 +4939,7 @@ class Actions
return $this->StorageProvider()->Put(null, return $this->StorageProvider()->Put(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/', \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail),
\RainLoop\Utils::EncodeKeyValues($mData) \RainLoop\Utils::EncodeKeyValues($mData)
); );
} }
@ -5005,7 +4987,7 @@ class Actions
$this->StorageProvider()->Put(null, $this->StorageProvider()->Put(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/', \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail),
\RainLoop\Utils::EncodeKeyValues(array( \RainLoop\Utils::EncodeKeyValues(array(
'User' => $sEmail, 'User' => $sEmail,
'Enable' => false, 'Enable' => false,
@ -5060,7 +5042,7 @@ class Actions
{ {
$bResult = $this->StorageProvider()->Put(null, $bResult = $this->StorageProvider()->Put(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$sEmail.'/Data/', \RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail),
\RainLoop\Utils::EncodeKeyValues(array( \RainLoop\Utils::EncodeKeyValues(array(
'User' => $sEmail, 'User' => $sEmail,
'Enable' => '1' === \trim($this->GetActionParam('Enable', '0')), 'Enable' => '1' === \trim($this->GetActionParam('Enable', '0')),
@ -5109,7 +5091,7 @@ class Actions
$this->StorageProvider()->Clear(null, $this->StorageProvider()->Clear(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
'TwoFactorAuth/User/'.$oAccount->ParentEmailHelper().'/Data/' \RainLoop\KeyPathHelper::TwoFactorAuthUserData($oAccount->ParentEmailHelper())
); );
return $this->DefaultResponse(__FUNCTION__, return $this->DefaultResponse(__FUNCTION__,
@ -5288,7 +5270,6 @@ class Actions
$aResult = \array_slice($aResult, 0, $iLimit); $aResult = \array_slice($aResult, 0, $iLimit);
} }
// Plugins
$this->Plugins()->RunHook('ajax.suggestions-post', array(&$aResult, $sQuery, $oAccount, $iLimit)); $this->Plugins()->RunHook('ajax.suggestions-post', array(&$aResult, $sQuery, $oAccount, $iLimit));
if ($iLimit < \count($aResult)) if ($iLimit < \count($aResult))
@ -5299,15 +5280,6 @@ class Actions
return $this->DefaultResponse(__FUNCTION__, $aResult); return $this->DefaultResponse(__FUNCTION__, $aResult);
} }
/**
* @return array
*/
public function DoEmailsPicsHashes()
{
// $oAccount = $this->getAccountFromToken();
return $this->DefaultResponse(__FUNCTION__, array());
}
/** /**
* @return array * @return array
*/ */
@ -6188,6 +6160,7 @@ class Actions
{ {
$sIfModifiedSince = $this->Http()->GetHeader('If-Modified-Since', ''); $sIfModifiedSince = $this->Http()->GetHeader('If-Modified-Since', '');
$sIfNoneMatch = $this->Http()->GetHeader('If-None-Match', ''); $sIfNoneMatch = $this->Http()->GetHeader('If-None-Match', '');
if (!empty($sIfModifiedSince) || !empty($sIfNoneMatch)) if (!empty($sIfModifiedSince) || !empty($sIfNoneMatch))
{ {
$this->Http()->StatusHeader(304); $this->Http()->StatusHeader(304);
@ -6308,42 +6281,6 @@ class Actions
$this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'csv') : false; $this->AddressBookProvider($oAccount)->Export($oAccount->ParentEmailHelper(), 'csv') : false;
} }
/**
* @return bool
*/
public function RawUserPic()
{
$sRawKey = (string) $this->GetActionParam('RawKey', '');
if (!empty($sRawKey))
{
$this->verifyCacheByKey($sRawKey);
}
$oAccount = $this->getAccountFromToken();
$sData = $this->StorageProvider()->Get($oAccount,
\RainLoop\Providers\Storage\Enumerations\StorageType::USER, 'contacts/'.$sRawKey);
if ($sData)
{
$aData = \explode('|||', $sData, 2);
if (\is_array($aData) && 2 === \count($aData) && !empty($aData[0]) && !empty($aData[1]))
{
header('Content-Type: '.$aData[0]);
header('Content-Disposition: inline; filename="'.\preg_replace('/[^a-zA-Z0-9]+/', '.', $aData[0]).'"', true);
header('Accept-Ranges: none', true);
header('Content-Transfer-Encoding: binary');
$this->cacheByKey($sRawKey);
echo \MailSo\Base\Utils::Base64Decode($aData[1]);
return true;
}
}
return false;
}
/** /**
* @return \RainLoop\Account|bool * @return \RainLoop\Account|bool
*/ */
@ -6878,7 +6815,6 @@ class Actions
{ {
$aNames = explode('\\', get_class($oData)); $aNames = explode('\\', get_class($oData));
$mResult = array( $mResult = array(
// '@Action' => $sParent,
'@Object' => end($aNames) '@Object' => end($aNames)
); );
@ -7147,7 +7083,7 @@ class Actions
try try
{ {
$oReadReceipt = \MailSo\Mime\Email::Parse($mResult['ReadReceipt']); $oReadReceipt = \MailSo\Mime\Email::Parse($mResult['ReadReceipt']);
if (!$oReadReceipt || ($oReadReceipt && $oAccount->Email() === $oReadReceipt->GetEmail())) if (!$oReadReceipt)
{ {
$mResult['ReadReceipt'] = ''; $mResult['ReadReceipt'] = '';
} }
@ -7156,7 +7092,7 @@ class Actions
} }
if (0 < \strlen($mResult['ReadReceipt']) && '1' === $this->Cacher()->Get( if (0 < \strlen($mResult['ReadReceipt']) && '1' === $this->Cacher()->Get(
'/ReadReceipt/'.$oAccount->Email().'/'.$mResult['Folder'].'/'.$mResult['Uid'], '0')) \RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $mResult['Folder'], $mResult['Uid']), '0'))
{ {
$mResult['ReadReceipt'] = ''; $mResult['ReadReceipt'] = '';
} }

View file

@ -70,19 +70,17 @@ class Api
/** /**
* @param string $sEmail * @param string $sEmail
* @param string $sPassword * @param string $sPassword
* @param string $sLogin = ''
* @param bool $bUseTimeout = true * @param bool $bUseTimeout = true
* *
* @return string * @return string
*/ */
public static function GetUserSsoHash($sEmail, $sPassword, $sLogin = '', $bUseTimeout = true) public static function GetUserSsoHash($sEmail, $sPassword, $bUseTimeout = true)
{ {
$sSsoHash = \sha1(\rand(10000, 99999).$sEmail.$sPassword.$sLogin.\microtime(true)); $sSsoHash = \sha1(\rand(10000, 99999).$sEmail.$sPassword.\microtime(true));
return self::Actions()->Cacher()->Set(self::Actions()->BuildSsoCacherKey($sSsoHash), \RainLoop\Utils::EncodeKeyValues(array( return self::Actions()->Cacher()->Set(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash), \RainLoop\Utils::EncodeKeyValues(array(
'Email' => $sEmail, 'Email' => $sEmail,
'Password' => $sPassword, 'Password' => $sPassword,
'Login' => $sLogin,
'Time' => $bUseTimeout ? \time() : 0 'Time' => $bUseTimeout ? \time() : 0
))) ? $sSsoHash : ''; ))) ? $sSsoHash : '';
} }
@ -94,6 +92,23 @@ class Api
*/ */
public static function ClearUserSsoHash($sSsoHash) public static function ClearUserSsoHash($sSsoHash)
{ {
return self::Actions()->Delete(self::Actions()->BuildSsoCacherKey($sSsoHash)); return self::Actions()->Cacher()->Delete(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash));
}
/**
* @todo
* @param string $sEmail
*
* @return bool
*/
public static function ClearUserDateStorage($sEmail)
{
$sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail);
// TwoFactor Auth User Data
self::Actions()->StorageProvider()->Clear(null,
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
\RainLoop\KeyPathHelper::TwoFactorAuthUserData($sEmail)
);
} }
} }

View file

@ -0,0 +1,132 @@
<?php
namespace RainLoop;
class KeyPathHelper
{
/**
* @param string $sEmail
*
* @return string
*/
static public function TwoFactorAuthUserData($sEmail)
{
return 'TwoFactorAuth/User/'.$sEmail.'/Data/';
}
/**
* @param string $sSsoHash
*
* @return string
*/
static public function SsoCacherKey($sSsoHash)
{
return '/Sso/Data/'.$sSsoHash.'/Login/';
}
/**
* @param string $sSignMeToken
*
* @return string
*/
static public function SignMeUserToken($sSignMeToken)
{
return '/SignMe/UserToken/'.$sSignMeToken;
}
/**
* @param string $sEmail
*
* @return string
*/
static public function WebmailAccounts($sEmail)
{
return 'Webmail/Accounts/'.$sEmail.'/Array';
}
/**
* @param string $sDomain
*
* @return string
*/
static public function LicensingDomainKeyValue($sDomain)
{
return 'Licensing/DomainKey/Value/'.$sDomain;
}
/**
* @param string $sRepo
* @param string $sRepoFile
*
* @return string
*/
static public function RepositoryCacheFile($sRepo, $sRepoFile)
{
return 'RepositoryCache/Repo/'.$sRepo.'/File/'.$sRepoFile;
}
/**
* @param string $sRepo
*
* @return string
*/
static public function RepositoryCacheCore($sRepo)
{
return 'RepositoryCache/CoreRepo/'.$sRepo;
}
/**
* @param string $sEmail
* @param string $sFolderFullName
* @param string $sUid
*
* @return string
*/
static public function ReadReceiptCache($sEmail, $sFolderFullName, $sUid)
{
return '/ReadReceipt/'.$sEmail.'/'.$sFolderFullName.'/'.$sUid;
}
/**
* @param string $sLanguage
* @param string $sPluginsHash
*
* @return string
*/
static public function LangCache($sLanguage, $sPluginsHash)
{
return '/LangCache/'.$sPluginsHash.'/'.$sLanguage.'/'.APP_VERSION.'/';
}
/**
* @param bool $bAdmin
* @param string $sPluginsHash
*
* @return string
*/
static public function TemplatesCache($bAdmin, $sPluginsHash)
{
return '/TemplatesCache/'.$sPluginsHash.'/'.($bAdmin ? 'Admin' : 'App').'/'.APP_VERSION.'/';
}
/**
* @param string $sPluginsHash
*
* @return string
*/
static public function PluginsJsCache($sPluginsHash)
{
return '/PluginsJsCache/'.$sPluginsHash.'/'.APP_VERSION.'/';
}
/**
* @param string $sTheme
* @param string $sPluginsHash
*
* @return string
*/
static public function CssCache($sPluginsHash)
{
return '/CssCache/'.$sPluginsHash.'/'.$sTheme.'/'.APP_VERSION.'/';
}
}

View file

@ -229,6 +229,8 @@ class PdoAddressBook
'password' => $sPassword 'password' => $sPassword
); );
$this->oLogger->AddSecret($sPassword);
if (!empty($sProxy)) if (!empty($sProxy))
{ {
$aSettings['proxy'] = $sProxy; $aSettings['proxy'] = $sProxy;
@ -239,7 +241,6 @@ class PdoAddressBook
$oClient = new \Sabre\DAV\Client($aSettings); $oClient = new \Sabre\DAV\Client($aSettings);
$oClient->setVerifyPeer(false); $oClient->setVerifyPeer(false);
$this->oLogger->AddSecret($sPassword);
$this->oLogger->Write('User: '.$aSettings['userName'].', Url: '.$sUrl, \MailSo\Log\Enumerations\Type::INFO, 'DAV'); $this->oLogger->Write('User: '.$aSettings['userName'].', Url: '.$sUrl, \MailSo\Log\Enumerations\Type::INFO, 'DAV');
$aRemoteSyncData = $this->prepearRemoteSyncData($oClient, $sPath); $aRemoteSyncData = $this->prepearRemoteSyncData($oClient, $sPath);

View file

@ -85,11 +85,8 @@ class Service
break; break;
} }
if (!\in_array($sErrStr, array('iconv(): Detected an illegal character in input string'))) $this->oActions->Logger()->Write($sErrFile.' [line:'.$iErrLine.', code:'.$iErrNo.']', $iType, 'PHP');
{ $this->oActions->Logger()->Write('Error: '.$sErrStr, $iType, 'PHP');
$this->oActions->Logger()->Write($sErrFile.' [line:'.$iErrLine.', code:'.$iErrNo.']', $iType, 'PHP');
$this->oActions->Logger()->Write('Error: '.$sErrStr, $iType, 'PHP');
}
return false; return false;
} }

View file

@ -351,27 +351,9 @@ class ServiceActions
$aData = \RainLoop\Utils::DecodeKeyValues($sData); $aData = \RainLoop\Utils::DecodeKeyValues($sData);
if (\is_array($aData) && !empty($aData['Token']) && !empty($aData['Url']) && $aData['Token'] === \RainLoop\Utils::GetConnectionToken()) if (\is_array($aData) && !empty($aData['Token']) && !empty($aData['Url']) && $aData['Token'] === \RainLoop\Utils::GetConnectionToken())
{ {
$sUrl = $aData['Url']; $iCode = 404;
$sContentType = '';
$aOptions = array( $mResult = $this->oHttp->GetUrlAsString($aData['Url'], 'RainLoop External Proxy', $sContentType, $iCode);
CURLOPT_URL => $sUrl,
CURLOPT_HEADER => false,
CURLOPT_USERAGENT => 'RainLoop External Proxy',
CURLOPT_FAILONERROR => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => false,
CURLOPT_TIMEOUT => (int) 10
);
$oCurl = \curl_init();
\curl_setopt_array($oCurl, $aOptions);
$mResult = \curl_exec($oCurl);
$iCode = (int) \curl_getinfo($oCurl, CURLINFO_HTTP_CODE);
$sContentType = (string) \curl_getinfo($oCurl, CURLINFO_CONTENT_TYPE);
$sContentType = \trim(\strtolower($sContentType));
if (false !== $mResult && 200 === $iCode && if (false !== $mResult && 200 === $iCode &&
\in_array($sContentType, array('image/png', 'image/jpeg', 'image/jpg', 'image/bmp', 'image/gif'))) \in_array($sContentType, array('image/png', 'image/jpeg', 'image/jpg', 'image/bmp', 'image/gif')))
@ -383,11 +365,6 @@ class ServiceActions
\header('Content-Type: '.$sContentType); \header('Content-Type: '.$sContentType);
echo $mResult; echo $mResult;
} }
if (\is_resource($oCurl))
{
\curl_close($oCurl);
}
} }
} }
@ -480,7 +457,7 @@ class ServiceActions
$sCacheFileName = ''; $sCacheFileName = '';
if ($bCacheEnabled) if ($bCacheEnabled)
{ {
$sCacheFileName = 'LANG:'.$this->oActions->Plugins()->Hash().$sLanguage.APP_VERSION; $sCacheFileName = \RainLoop\KeyPathHelper::LangCache($sLanguage, $this->oActions->Plugins()->Hash());
$sResult = $this->Cacher()->Get($sCacheFileName); $sResult = $this->Cacher()->Get($sCacheFileName);
} }
@ -521,7 +498,7 @@ class ServiceActions
$sCacheFileName = ''; $sCacheFileName = '';
if ($bCacheEnabled) if ($bCacheEnabled)
{ {
$sCacheFileName = 'TEMPLATES:'.($bAdmin ? 'Admin/' : 'App/').$this->oActions->Plugins()->Hash().APP_VERSION; $sCacheFileName = \RainLoop\KeyPathHelper::TemplatesCache($bAdmin, $this->oActions->Plugins()->Hash());
$sResult = $this->Cacher()->Get($sCacheFileName); $sResult = $this->Cacher()->Get($sCacheFileName);
} }
@ -561,7 +538,7 @@ class ServiceActions
$sCacheFileName = ''; $sCacheFileName = '';
if ($bCacheEnabled) if ($bCacheEnabled)
{ {
$sCacheFileName = 'PLUGIN:'.$this->oActions->Plugins()->Hash().APP_VERSION; $sCacheFileName = \RainLoop\KeyPathHelper::PluginsJsCache($this->oActions->Plugins()->Hash());
$sResult = $this->Cacher()->Get($sCacheFileName); $sResult = $this->Cacher()->Get($sCacheFileName);
} }
@ -622,7 +599,7 @@ class ServiceActions
$sCacheFileName = ''; $sCacheFileName = '';
if ($bCacheEnabled) if ($bCacheEnabled)
{ {
$sCacheFileName = 'THEMES/PLUGINS:'.$sTheme.':'.$this->Plugins()->Hash(); $sCacheFileName = \RainLoop\KeyPathHelper::CssCache($sTheme, $this->oActions->Plugins()->Hash());
$sResult = $this->Cacher()->Get($sCacheFileName); $sResult = $this->Cacher()->Get($sCacheFileName);
} }
@ -811,27 +788,24 @@ class ServiceActions
if (!empty($sSsoHash)) if (!empty($sSsoHash))
{ {
$mData = null; $mData = null;
$sSsoKey = $this->oActions->BuildSsoCacherKey($sSsoHash);
$sSsoSubData = $this->Cacher()->Get($sSsoKey); $sSsoSubData = $this->Cacher()->Get(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash));
if (!empty($sSsoSubData)) if (!empty($sSsoSubData))
{ {
$mData = \RainLoop\Utils::DecodeKeyValues($sSsoSubData); $mData = \RainLoop\Utils::DecodeKeyValues($sSsoSubData);
$this->Cacher()->Delete($sSsoKey); $this->Cacher()->Delete(\RainLoop\KeyPathHelper::SsoCacherKey($sSsoHash));
if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'], $mData['Time']) && if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'], $mData['Time']) &&
(0 === $mData['Time'] || \time() - 10 < $mData['Time'])) (0 === $mData['Time'] || \time() - 10 < $mData['Time']))
{ {
$sEmail = \trim($mData['Email']); $sEmail = \trim($mData['Email']);
$sPassword = $mData['Password']; $sPassword = $mData['Password'];
$sLogin = isset($mData['Login']) ? $mData['Login'] : '';
try try
{ {
$this->oActions->Logger()->AddSecret($sPassword); $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword);
$oAccount = $this->oActions->LoginProcess($sEmail, $sLogin, $sPassword);
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);
$bLogout = !($oAccount instanceof \RainLoop\Account); $bLogout = !($oAccount instanceof \RainLoop\Account);
} }
catch (\Exception $oException) catch (\Exception $oException)
@ -861,16 +835,13 @@ class ServiceActions
$bLogout = true; $bLogout = true;
$sEmail = $this->oHttp->GetEnv('REMOTE_USER', ''); $sEmail = $this->oHttp->GetEnv('REMOTE_USER', '');
$sLogin = '';
$sPassword = $this->oHttp->GetEnv('REMOTE_PASSWORD', ''); $sPassword = $this->oHttp->GetEnv('REMOTE_PASSWORD', '');
if (0 < \strlen($sEmail) && 0 < \strlen(\trim($sPassword))) if (0 < \strlen($sEmail) && 0 < \strlen(\trim($sPassword)))
{ {
try try
{ {
$this->oActions->Logger()->AddSecret($sPassword); $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword);
$oAccount = $this->oActions->LoginProcess($sEmail, $sLogin, $sPassword);
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);
$bLogout = !($oAccount instanceof \RainLoop\Account); $bLogout = !($oAccount instanceof \RainLoop\Account);
} }
@ -901,14 +872,11 @@ class ServiceActions
if ($this->oActions->Config()->Get('labs', 'allow_external_login', false)) if ($this->oActions->Config()->Get('labs', 'allow_external_login', false))
{ {
$sEmail = \trim($this->oHttp->GetRequest('Email', '')); $sEmail = \trim($this->oHttp->GetRequest('Email', ''));
$sLogin = \trim($this->oHttp->GetRequest('Login', ''));
$sPassword = $this->oHttp->GetRequest('Password', ''); $sPassword = $this->oHttp->GetRequest('Password', '');
try try
{ {
$this->oActions->Logger()->AddSecret($sPassword); $oAccount = $this->oActions->LoginProcess($sEmail, $sPassword);
$oAccount = $this->oActions->LoginProcess($sEmail, $sLogin, $sPassword);
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);
$bLogout = !($oAccount instanceof \RainLoop\Account); $bLogout = !($oAccount instanceof \RainLoop\Account);
} }
@ -963,34 +931,42 @@ class ServiceActions
*/ */
public function ServiceExternalSso() public function ServiceExternalSso()
{ {
$sResult = '';
$bLogout = true;
$sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', ''); $sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', '');
if ($this->oActions->Config()->Get('labs', 'allow_external_sso', false) && if ($this->oActions->Config()->Get('labs', 'allow_external_sso', false) &&
!empty($sKey) && $sKey === \trim($this->oHttp->GetRequest('SsoKey', ''))) !empty($sKey) && $sKey === \trim($this->oHttp->GetRequest('SsoKey', '')))
{ {
$sEmail = \trim($this->oHttp->GetRequest('Email', '')); $sEmail = \trim($this->oHttp->GetRequest('Email', ''));
$sLogin = \trim($this->oHttp->GetRequest('Login', ''));
$sPassword = $this->oHttp->GetRequest('Password', ''); $sPassword = $this->oHttp->GetRequest('Password', '');
\RainLoop\Api::Handle(); \RainLoop\Api::Handle();
$sResult = \RainLoop\Api::GetUserSsoHash($sEmail, $sPassword, $sLogin);
$sResult = \RainLoop\Api::GetUserSsoHash($sEmail, $sPassword);
$bLogout = 0 === \strlen($sResult); $bLogout = 0 === \strlen($sResult);
switch (\strtolower($this->oHttp->GetRequest('Output', 'Plain'))) switch (\strtolower($this->oHttp->GetRequest('Output', 'Plain')))
{ {
case 'plain': case 'plain':
@\header('Content-Type: text/plain'); @\header('Content-Type: text/plain');
return $sResult; break;
case 'json': case 'json':
@\header('Content-Type: application/json; charset=utf-8'); @\header('Content-Type: application/json; charset=utf-8');
return \MailSo\Base\Utils::Php2js(array( $sResult = \MailSo\Base\Utils::Php2js(array(
'Action' => 'ExternalSso', 'Action' => 'ExternalSso',
'Result' => $sResult 'Result' => $sResult
), $this->Logger()); ), $this->Logger());
break;
} }
} }
return ''; if ($bLogout)
{
$this->oActions->SetAuthLogoutToken();
}
return $sResult;
} }
/** /**

View file

@ -355,11 +355,9 @@ class Social
$aUserData = \RainLoop\Utils::DecodeKeyValues($sUserData); $aUserData = \RainLoop\Utils::DecodeKeyValues($sUserData);
if ($aUserData && \is_array($aUserData) && if ($aUserData && \is_array($aUserData) &&
!empty($aUserData['Email']) && !empty($aUserData['Email']) && isset($aUserData['Password']))
!empty($aUserData['Login']) &&
isset($aUserData['Password']))
{ {
$oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Login'], $aUserData['Password']); $oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Password']);
if ($oAccount instanceof \RainLoop\Account) if ($oAccount instanceof \RainLoop\Account)
{ {
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);
@ -377,7 +375,6 @@ class Social
{ {
$aUserData = array( $aUserData = array(
'Email' => $oAccount->Email(), 'Email' => $oAccount->Email(),
'Login' => $oAccount->IncLogin(),
'Password' => $oAccount->Password() 'Password' => $oAccount->Password()
); );
@ -489,7 +486,6 @@ class Social
{ {
$aUserData = array( $aUserData = array(
'Email' => $oAccount->Email(), 'Email' => $oAccount->Email(),
'Login' => $oAccount->IncLogin(),
'Password' => $oAccount->Password() 'Password' => $oAccount->Password()
); );
@ -539,11 +535,9 @@ class Social
} }
if ($aUserData && \is_array($aUserData) && if ($aUserData && \is_array($aUserData) &&
!empty($aUserData['Email']) && !empty($aUserData['Email']) && isset($aUserData['Password']))
!empty($aUserData['Login']) &&
isset($aUserData['Password']))
{ {
$oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Login'], $aUserData['Password']); $oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Password']);
if ($oAccount instanceof \RainLoop\Account) if ($oAccount instanceof \RainLoop\Account)
{ {
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);
@ -652,7 +646,6 @@ class Social
$aUserData = array( $aUserData = array(
'Email' => $oAccount->Email(), 'Email' => $oAccount->Email(),
'Login' => $oAccount->IncLogin(),
'Password' => $oAccount->Password() 'Password' => $oAccount->Password()
); );
@ -722,10 +715,9 @@ class Social
if ($aUserData && \is_array($aUserData) && if ($aUserData && \is_array($aUserData) &&
!empty($aUserData['Email']) && !empty($aUserData['Email']) &&
!empty($aUserData['Login']) &&
isset($aUserData['Password'])) isset($aUserData['Password']))
{ {
$oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Login'], $aUserData['Password']); $oAccount = $this->oActions->LoginProcess($aUserData['Email'], $aUserData['Password']);
if ($oAccount instanceof \RainLoop\Account) if ($oAccount instanceof \RainLoop\Account)
{ {
$this->oActions->AuthProcess($oAccount); $this->oActions->AuthProcess($oAccount);

View file

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

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
; ;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/ /*jshint onevar: false*/
@ -87,7 +87,7 @@ var
*/ */
var RL = null; var RL = null;
/*jshint onevar: true*/ /*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -244,7 +244,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type; return oType && 'application/pdf' === oType.type;
}); });
} }
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {}; Consts.Defaults = {};
@ -364,7 +364,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string} * @type {string}
*/ */
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -794,7 +794,7 @@ Enums.Notification = {
'UnknownNotification': 999, 'UnknownNotification': 999,
'UnknownError': 999 'UnknownError': 999
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim; Utils.trim = $.trim;
@ -2549,7 +2549,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
return oItem.hasClass('open'); return oItem.hasClass('open');
})); }));
}, 50); }, 50);
/*jslint bitwise: true*/ /*jslint bitwise: true*/
// Base64 encode / decode // Base64 encode / decode
// http://www.webtoolkit.info/ // http://www.webtoolkit.info/
@ -2713,7 +2713,7 @@ Base64 = {
} }
}; };
/*jslint bitwise: false*/ /*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = { ko.bindingHandlers.tooltip = {
@ -3556,7 +3556,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -3773,15 +3773,6 @@ LinkBuilder.prototype.langLink = function (sLang)
return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/'; return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/';
}; };
/**
* @param {string} sHash
* @return {string}
*/
LinkBuilder.prototype.getUserPicUrlFromHash = function (sHash)
{
return this.sServer + '/Raw/' + this.sSpecSuffix + '/UserPic/' + sHash + '/' + this.sVersion + '/';
};
/** /**
* @return {string} * @return {string}
*/ */
@ -3880,7 +3871,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{ {
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -3976,7 +3967,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4052,7 +4043,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4125,7 +4116,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4170,7 +4161,7 @@ LocalStorage.prototype.get = function (iKey)
{ {
return this.oDriver ? this.oDriver.get('p' + iKey) : null; return this.oDriver ? this.oDriver.get('p' + iKey) : null;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4185,7 +4176,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{ {
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4280,7 +4271,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true; return true;
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4358,7 +4349,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute; this.oCross = oRoute;
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4765,7 +4756,7 @@ Knoin.prototype.bootstart = function ()
}; };
kn = new Knoin(); kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5131,7 +5122,7 @@ EmailModel.prototype.inputoTagLine = function ()
{ {
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5177,7 +5168,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ? return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name(); Utils.encodeHtml(this.name()) : this.name();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5474,7 +5465,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true); this.smtpAuth(true);
this.whiteList(''); this.whiteList('');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5613,7 +5604,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
} }
}, this)); }, this));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5731,7 +5722,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{ {
var sValue = this.key(); var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue)); return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5793,7 +5784,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5901,7 +5892,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this)); }, this));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5990,7 +5981,7 @@ AdminLoginViewModel.prototype.onHide = function ()
{ {
this.loginFocus(false); this.loginFocus(false);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6016,7 +6007,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{ {
return '#/' + sRoute; return '#/' + sRoute;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6042,7 +6033,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () { RL.remote().adminLogout(function () {
RL.loginAndLogoutReload(); RL.loginAndLogoutReload();
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6170,7 +6161,7 @@ AdminGeneral.prototype.phpInfoLink = function ()
return RL.link().phpInfo(); return RL.link().phpInfo();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6217,7 +6208,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6288,7 +6279,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6510,7 +6501,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6601,7 +6592,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{ {
RL.reloadDomainList(); RL.reloadDomainList();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6716,7 +6707,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{ {
return RL.link().phpInfo(); return RL.link().phpInfo();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6834,7 +6825,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6933,7 +6924,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList(); RL.reloadPluginList();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7033,7 +7024,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage); RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7090,7 +7081,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
; ;
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')'); return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7167,7 +7158,7 @@ AdminAbout.prototype.updateCoreData = function ()
RL.updateCoreData(); RL.updateCoreData();
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7300,7 +7291,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7353,7 +7344,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function() AdminDataStorage.prototype.populateDataOnStart = function()
{ {
AbstractData.prototype.populateDataOnStart.call(this); AbstractData.prototype.populateDataOnStart.call(this);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7629,7 +7620,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion 'Version': sVersion
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7892,7 +7883,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminPing'); this.defaultRequest(fCallback, 'AdminPing');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7900,16 +7891,10 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
*/ */
function AbstractCacheStorage() function AbstractCacheStorage()
{ {
this.oEmailsPicsHashes = {};
this.oServices = {}; this.oServices = {};
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar); this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
} }
/**
* @type {Object}
*/
AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
/** /**
* @type {Object} * @type {Object}
*/ */
@ -7923,7 +7908,6 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
AbstractCacheStorage.prototype.clear = function () AbstractCacheStorage.prototype.clear = function ()
{ {
this.oServices = {}; this.oServices = {};
this.oEmailsPicsHashes = {};
}; };
/** /**
@ -7937,19 +7921,11 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
var var
sUrl = '', sUrl = '',
sService = '', sService = '',
sEmailLower = sEmail.toLowerCase(), sEmailLower = sEmail.toLowerCase()
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmailLower]) ? '' : this.oEmailsPicsHashes[sEmailLower]
; ;
if ('' !== sPicHash) sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
{ sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
}
else
{
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
}
if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower) if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower)
{ {
@ -7970,15 +7946,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{ {
this.oServices = oData; this.oServices = oData;
}; };
/**
* @param {Object} oData
*/
AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7991,7 +7959,7 @@ function AdminCacheStorage()
} }
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype); _.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8173,7 +8141,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules] ['', oRules]
]; ];
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8190,7 +8158,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function () AdminLoginScreen.prototype.onShow = function ()
{ {
RL.setTitle(''); RL.setTitle('');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8210,7 +8178,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype);
AdminSettingsScreen.prototype.onShow = function () AdminSettingsScreen.prototype.onShow = function ()
{ {
RL.setTitle(''); RL.setTitle('');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8570,7 +8538,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready(); ssm.ready();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8873,7 +8841,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp} * @type {AdminApp}
*/ */
RL = new AdminApp(); RL = new AdminApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -8926,7 +8894,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null; window['__RLBOOT'] = null;
}); });
}; };
if (window.SimplePace) { if (window.SimplePace) {
window.SimplePace.add(10); window.SimplePace.add(10);
} }

File diff suppressed because one or more lines are too long

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
; ;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/ /*jshint onevar: false*/
@ -90,7 +90,7 @@ var
$proxyDiv = $('<div></div>') $proxyDiv = $('<div></div>')
; ;
/*jshint onevar: true*/ /*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -247,7 +247,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type; return oType && 'application/pdf' === oType.type;
}); });
} }
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {}; Consts.Defaults = {};
@ -367,7 +367,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string} * @type {string}
*/ */
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -797,7 +797,7 @@ Enums.Notification = {
'UnknownNotification': 999, 'UnknownNotification': 999,
'UnknownError': 999 'UnknownError': 999
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim; Utils.trim = $.trim;
@ -2552,7 +2552,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
return oItem.hasClass('open'); return oItem.hasClass('open');
})); }));
}, 50); }, 50);
/*jslint bitwise: true*/ /*jslint bitwise: true*/
// Base64 encode / decode // Base64 encode / decode
// http://www.webtoolkit.info/ // http://www.webtoolkit.info/
@ -2716,7 +2716,7 @@ Base64 = {
} }
}; };
/*jslint bitwise: false*/ /*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = { ko.bindingHandlers.tooltip = {
@ -3559,7 +3559,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -3776,15 +3776,6 @@ LinkBuilder.prototype.langLink = function (sLang)
return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/'; return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/';
}; };
/**
* @param {string} sHash
* @return {string}
*/
LinkBuilder.prototype.getUserPicUrlFromHash = function (sHash)
{
return this.sServer + '/Raw/' + this.sSpecSuffix + '/UserPic/' + sHash + '/' + this.sVersion + '/';
};
/** /**
* @return {string} * @return {string}
*/ */
@ -3883,7 +3874,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{ {
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -3979,7 +3970,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
}; };
/** /**
* @constructor * @constructor
@ -4218,7 +4209,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
this.setHtml('', bFocus); this.setHtml('', bFocus);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -4929,7 +4920,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{ {
this.oCallbacks[sEventName] = fCallback; this.oCallbacks[sEventName] = fCallback;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5005,7 +4996,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5078,7 +5069,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5123,7 +5114,7 @@ LocalStorage.prototype.get = function (iKey)
{ {
return this.oDriver ? this.oDriver.get('p' + iKey) : null; return this.oDriver ? this.oDriver.get('p' + iKey) : null;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5138,7 +5129,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{ {
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5233,7 +5224,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true; return true;
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5311,7 +5302,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute; this.oCross = oRoute;
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -5718,7 +5709,7 @@ Knoin.prototype.bootstart = function ()
}; };
kn = new Knoin(); kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6084,7 +6075,7 @@ EmailModel.prototype.inputoTagLine = function ()
{ {
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6210,7 +6201,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' '); return aResult.join(' ');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6241,7 +6232,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
}, this); }, this);
} }
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6287,7 +6278,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ? return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name(); Utils.encodeHtml(this.name()) : this.name();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6525,7 +6516,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass; return sClass;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -6588,7 +6579,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
} }
return bResult; return bResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -7801,7 +7792,7 @@ MessageModel.prototype.flagHash = function ()
return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(), return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
this.isReadReceipt()].join(''); this.isReadReceipt()].join('');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8135,7 +8126,7 @@ FolderModel.prototype.printableFullName = function ()
{ {
return this.fullName.split(this.delimiter).join(' / '); return this.fullName.split(this.delimiter).join(' / ');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8158,7 +8149,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function () AccountModel.prototype.changeAccountLink = function ()
{ {
return RL.link().change(this.email); return RL.link().change(this.email);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8196,7 +8187,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name(); var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>'; return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8246,7 +8237,7 @@ FilterActionModel.prototype.removeSelf = function ()
{ {
this.parentList.remove(this); this.parentList.remove(this);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8297,7 +8288,7 @@ FilterConditionModel.prototype.removeSelf = function ()
this.parentList.remove(this); this.parentList.remove(this);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8353,7 +8344,7 @@ FilterModel.prototype.parse = function (oItem)
return bResult; return bResult;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8386,7 +8377,7 @@ OpenPgpKeyModel.prototype.user = '';
OpenPgpKeyModel.prototype.email = ''; OpenPgpKeyModel.prototype.email = '';
OpenPgpKeyModel.prototype.armor = ''; OpenPgpKeyModel.prototype.armor = '';
OpenPgpKeyModel.prototype.isPrivate = false; OpenPgpKeyModel.prototype.isPrivate = false;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8484,7 +8475,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder); this.selectedFolder(oFolder);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8596,7 +8587,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function ()
{ {
this.folderName.focused(true); this.folderName.focused(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -8711,7 +8702,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification); this.notification(sNotification);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -10200,7 +10191,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.editorResizeThrottle(); this.editorResizeThrottle();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -10944,7 +10935,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
// oItem.checked(false); // oItem.checked(false);
// }); // });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11082,7 +11073,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
{ {
this.fromFocus(true); this.fromFocus(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11178,7 +11169,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
{ {
this.emailFocus(true); this.emailFocus(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11266,7 +11257,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
{ {
this.key.focus(true); this.key.focus(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11308,7 +11299,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
this.key(oOpenPgpKey.armor); this.key(oOpenPgpKey.armor);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11405,7 +11396,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function ()
{ {
this.email.focus(true); this.email.focus(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11647,7 +11638,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr
this.to(aRec); this.to(aRec);
this.text(sText); this.text(sText);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11797,7 +11788,7 @@ PopupsIdentityViewModel.prototype.onFocus = function ()
this.email.focused(true); this.email.focused(true);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11859,7 +11850,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -11915,7 +11906,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
{ {
this.code.focused(true); this.code.focused(true);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12023,7 +12014,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this)); }, this));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12070,7 +12061,7 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
} }
}, this)); }, this));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12368,7 +12359,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12466,7 +12457,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function ()
} }
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12480,7 +12471,7 @@ function MailBoxSystemDropDownViewModel()
} }
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12494,7 +12485,7 @@ function SettingsSystemDropDownViewModel()
} }
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -12744,7 +12735,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel); kn.showScreenPopup(PopupsContactsViewModel);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -13649,7 +13640,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
; ;
return !!oJua; return !!oJua;
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14343,7 +14334,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache(); RL.reloadFlagsCurrentMessageListAndMessageFromCache();
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14374,7 +14365,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(RL.link().inbox()); kn.setHash(RL.link().inbox());
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14407,7 +14398,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(RL.link().inbox()); kn.setHash(RL.link().inbox());
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14569,7 +14560,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{ {
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14621,7 +14612,7 @@ SettingsContacts.prototype.onBuild = function ()
//{ //{
// //
//}; //};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14704,7 +14695,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
} }
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14794,7 +14785,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14954,7 +14945,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
}); });
}, 50); }, 50);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -14991,7 +14982,7 @@ SettingsFilters.prototype.addFilter = function ()
this.filters.push(oFilter); this.filters.push(oFilter);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15143,7 +15134,7 @@ SettingsSecurity.prototype.onBuild = function ()
this.processing(true); this.processing(true);
RL.remote().getTwoFactor(this.onResult); RL.remote().getTwoFactor(this.onResult);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15212,7 +15203,7 @@ function SettingsSocialScreen()
} }
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15319,7 +15310,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword)); Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword));
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15516,7 +15507,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false); oFolder.subScribed(false);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15632,7 +15623,7 @@ SettingsThemes.prototype.onBuild = function ()
}; };
})); }));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15702,7 +15693,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
RL.reloadOpenPgpKeys(); RL.reloadOpenPgpKeys();
} }
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -15835,7 +15826,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -17088,7 +17079,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword)
{ {
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -17364,7 +17355,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion 'Version': sVersion
}); });
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18095,14 +18086,6 @@ WebMailAjaxRemoteStorage.prototype.servicesPics = function (fCallback)
this.defaultRequest(fCallback, 'ServicesPics'); this.defaultRequest(fCallback, 'ServicesPics');
}; };
/**
* @param {?Function} fCallback
*/
WebMailAjaxRemoteStorage.prototype.emailsPicsHashes = function (fCallback)
{
this.defaultRequest(fCallback, 'EmailsPicsHashes');
};
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
@ -18159,7 +18142,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers'); this.defaultRequest(fCallback, 'SocialUsers');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18167,16 +18150,10 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
*/ */
function AbstractCacheStorage() function AbstractCacheStorage()
{ {
this.oEmailsPicsHashes = {};
this.oServices = {}; this.oServices = {};
this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar); this.bCapaGravatar = RL.capa(Enums.Capa.Gravatar);
} }
/**
* @type {Object}
*/
AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
/** /**
* @type {Object} * @type {Object}
*/ */
@ -18190,7 +18167,6 @@ AbstractCacheStorage.prototype.bCapaGravatar = false;
AbstractCacheStorage.prototype.clear = function () AbstractCacheStorage.prototype.clear = function ()
{ {
this.oServices = {}; this.oServices = {};
this.oEmailsPicsHashes = {};
}; };
/** /**
@ -18204,19 +18180,11 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
var var
sUrl = '', sUrl = '',
sService = '', sService = '',
sEmailLower = sEmail.toLowerCase(), sEmailLower = sEmail.toLowerCase()
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmailLower]) ? '' : this.oEmailsPicsHashes[sEmailLower]
; ;
if ('' !== sPicHash) sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
{ sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
}
else
{
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
}
if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower) if (this.bCapaGravatar && '' === sUrl && '' !== sEmailLower)
{ {
@ -18237,15 +18205,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{ {
this.oServices = oData; this.oServices = oData;
}; };
/**
* @param {Object} oData
*/
AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18565,7 +18525,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags); this.setMessageFlagsToCache(sFolder, sUid, aFlags);
} }
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18747,7 +18707,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules] ['', oRules]
]; ];
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18764,7 +18724,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function () LoginScreen.prototype.onShow = function ()
{ {
RL.setTitle(''); RL.setTitle('');
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18937,7 +18897,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}] [/^([^\/]*)$/, {'normalize_': fNormS}]
]; ];
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -18966,7 +18926,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle); RL.setTitle(this.sSettingsTitle);
RL.data().keyScope(Enums.KeyState.Settings); RL.data().keyScope(Enums.KeyState.Settings);
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -19326,7 +19286,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready(); ssm.ready();
}; };
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/** /**
@ -20314,16 +20274,6 @@ RainLoopApp.prototype.getContactsTagsAutocomplete = function (sQuery, fCallback)
})); }));
}; };
RainLoopApp.prototype.emailsPicsHashes = function ()
{
RL.remote().emailsPicsHashes(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{
RL.cache().setEmailsPicsHashesData(oData.Result);
}
});
};
/** /**
* @param {string} sMailToUrl * @param {string} sMailToUrl
* @returns {boolean} * @returns {boolean}
@ -20519,8 +20469,6 @@ RainLoopApp.prototype.bootstart = function ()
_.delay(function () { _.delay(function () {
RL.emailsPicsHashes();
RL.remote().servicesPics(function (sResult, oData) { RL.remote().servicesPics(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {
@ -20635,7 +20583,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp} * @type {RainLoopApp}
*/ */
RL = new RainLoopApp(); RL = new RainLoopApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -20688,7 +20636,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null; window['__RLBOOT'] = null;
}); });
}; };
if (window.SimplePace) { if (window.SimplePace) {
window.SimplePace.add(10); window.SimplePace.add(10);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long