Release commit

This commit is contained in:
RainLoop Team 2015-02-15 04:30:21 +04:00
parent 86f855fa5b
commit b01f298b7b
13 changed files with 121 additions and 42 deletions

View file

@ -17,10 +17,11 @@ OCP\App::registerPersonal('rainloop', 'personal');
if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false)) if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false))
{ {
OCP\Util::connectHook('OC_User', 'post_login', 'OC_RainLoop_Helper', 'login'); OCP\Util::connectHook('OC_User', 'post_login', 'OC_RainLoop_Helper', 'login');
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
OCP\Util::connectHook('OC_User', 'post_setPassword', 'OC_RainLoop_Helper', 'changePassword'); OCP\Util::connectHook('OC_User', 'post_setPassword', 'OC_RainLoop_Helper', 'changePassword');
} }
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
OCP\Util::addScript('rainloop', 'rainloop'); OCP\Util::addScript('rainloop', 'rainloop');
OCP\App::addNavigationEntry(array( OCP\App::addNavigationEntry(array(

View file

@ -110,8 +110,24 @@ class OC_RainLoop_Helper
public static function logout() public static function logout()
{ {
return OCP\Config::setUserValue( OCP\Config::setUserValue(
OCP\User::getUser(), 'rainloop', 'rainloop-autologin-password', ''); OCP\User::getUser(), 'rainloop', 'rainloop-autologin-password', '');
$sApiPath = __DIR__.'/../app/index.php';
if (file_exists($sApiPath))
{
self::regRainLoopDataFunction();
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
include $sApiPath;
if (class_exists('\\RainLoop\\Api'))
{
\RainLoop\Api::LogoutCurrentLogginedUser();
}
}
return true;
} }
public static function changePassword($aParams) public static function changePassword($aParams)

View file

@ -203,6 +203,10 @@
return 0 < Globals.popupVisibilityNames().length; return 0 < Globals.popupVisibilityNames().length;
}, this); }, this);
Globals.popupVisibility.subscribe(function (bValue) {
Globals.$html.toggleClass('rl-modal', bValue);
});
// keys // keys
Globals.keyScopeReal = ko.observable(Enums.KeyState.All); Globals.keyScopeReal = ko.observable(Enums.KeyState.All);
Globals.keyScopeFake = ko.observable(Enums.KeyState.All); Globals.keyScopeFake = ko.observable(Enums.KeyState.All);

14
dev/External/ko.js vendored
View file

@ -287,7 +287,19 @@
}); });
}, },
'update': function (oElement, fValueAccessor) { 'update': function (oElement, fValueAccessor) {
$(oElement).modal(ko.unwrap(fValueAccessor()) ? 'show' : 'hide');
var Globals = require('Common/Globals');
$(oElement).modal(!!ko.unwrap(fValueAccessor()) ? 'show' : 'hide');
if (Globals.$html.hasClass('rl-anim'))
{
Globals.$html.addClass('rl-modal-animation');
_.delay(function () {
Globals.$html.removeClass('rl-modal-animation');
}, 400);
}
} }
}; };

View file

@ -101,10 +101,14 @@ html.rl-started-trigger.no-mobile .b-login-content .loginFormWrapper {
} }
} }
&.csstransitions.rl-modal.rl-modal-animation .popups {
overflow: hidden;
}
&.csstransitions .modal.fade { &.csstransitions .modal.fade {
.transition(all 200ms ease-out); .transition(all 200ms ease-out);
transform: scale(1.1); transform: scale(0.95);
&.in { &.in {
transform: none; transform: none;

View file

@ -1308,6 +1308,7 @@
}); });
Events.sub('window.resize.real', this.resizerTrigger); Events.sub('window.resize.real', this.resizerTrigger);
Events.sub('window.resize.real', _.debounce(this.resizerTrigger, 50));
if (this.dropboxEnabled()) if (this.dropboxEnabled())
{ {
@ -1328,6 +1329,13 @@
} }
}); });
} }
window.setInterval(function () {
if (self.modalVisibility() && self.oEditor)
{
self.oEditor.resize();
}
}, 5000);
}; };
ComposePopupView.prototype.driveCallback = function (sAccessToken, oData) ComposePopupView.prototype.driveCallback = function (sAccessToken, oData)

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.8.1", "version": "1.8.1",
"release": "255", "release": "258",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "gulpfile.js", "main": "gulpfile.js",

View file

@ -831,7 +831,7 @@ class Utils
public static function GetFileExtension($sFileName) public static function GetFileExtension($sFileName)
{ {
$iLast = \strrpos($sFileName, '.'); $iLast = \strrpos($sFileName, '.');
return false === $iLast ? '' : \substr($sFileName, $iLast + 1); return false === $iLast ? '' : \strtolower(\substr($sFileName, $iLast + 1));
} }
/** /**

View file

@ -617,6 +617,15 @@ class Actions
*/ */
public function ClearAdminAuthToken() public function ClearAdminAuthToken()
{ {
$aAdminHash = \RainLoop\Utils::DecodeKeyValues($this->getAdminAuthToken());
if (
!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) &&
'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1]
)
{
$this->Cacher()->Delete(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2]));
}
\RainLoop\Utils::ClearCookie(self::AUTH_ADMIN_TOKEN_KEY); \RainLoop\Utils::ClearCookie(self::AUTH_ADMIN_TOKEN_KEY);
} }
@ -997,11 +1006,17 @@ class Actions
} }
/** /**
* @return array * @return string
*/ */
private function getAdminToken() private function getAdminToken()
{ {
return \RainLoop\Utils::EncodeKeyValues(array('token', \md5(APP_SALT))); $sRand = \MailSo\Base\Utils::Md5Rand();
if (!$this->Cacher()->Set(\RainLoop\KeyPathHelper::SessionAdminKey($sRand), \time()))
{
$sRand = '';
}
return '' === $sRand ? '' : \RainLoop\Utils::EncodeKeyValues(array('token', \md5(APP_SALT), $sRand));
} }
/** /**
@ -1015,8 +1030,10 @@ class Actions
if ($this->Config()->Get('security', 'allow_admin_panel', true)) if ($this->Config()->Get('security', 'allow_admin_panel', true))
{ {
$aAdminHash = \RainLoop\Utils::DecodeKeyValues($this->getAdminAuthToken()); $aAdminHash = \RainLoop\Utils::DecodeKeyValues($this->getAdminAuthToken());
if ((!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && if (!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) &&
'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1])) 'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] &&
'' !== $this->Cacher()->Get(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2]), '')
)
{ {
$bResult = true; $bResult = true;
} }
@ -1119,7 +1136,7 @@ class Actions
if (!empty($aAccountHash[8]) && !empty($aAccountHash[9])) // init proxy user/password if (!empty($aAccountHash[8]) && !empty($aAccountHash[9])) // init proxy user/password
{ {
$oAccount->SetProxyAuthUser($aAccountHash[8]); $oAccount->SetProxyAuthUser($aAccountHash[8]);
$oAccount->SetProxyAuthUser($aAccountHash[89]); $oAccount->SetProxyAuthPassword($aAccountHash[9]);
} }
$this->Logger()->AddSecret($oAccount->Password()); $this->Logger()->AddSecret($oAccount->Password());
@ -2895,15 +2912,18 @@ class Actions
public function DoLogout() public function DoLogout()
{ {
$oAccount = $this->getAccountFromToken(false); $oAccount = $this->getAccountFromToken(false);
if ($oAccount && $oAccount->SignMe()) if ($oAccount)
{
if ($oAccount->SignMe())
{ {
$this->ClearSignMeData($oAccount); $this->ClearSignMeData($oAccount);
} }
if ($oAccount && '' === $oAccount->ParentEmail()) if (!$oAccount->IsAdditionalAccount())
{ {
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SPEC_TOKEN_KEY); \RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SPEC_TOKEN_KEY);
} }
}
return $this->TrueResponse(__FUNCTION__); return $this->TrueResponse(__FUNCTION__);
} }

View file

@ -130,4 +130,14 @@ class KeyPathHelper
{ {
return '/CssCache/'.$sHash.'/'.$sTheme.'/'.APP_VERSION.'/'; return '/CssCache/'.$sHash.'/'.$sTheme.'/'.APP_VERSION.'/';
} }
/**
* @param string $sRand
*
* @return string
*/
static public function SessionAdminKey($sRand)
{
return '/Session/AdminKey/'.\md5($sRand).'/';
}
} }

View file

@ -522,13 +522,13 @@ class Domain
if (0 < strlen($sW)) if (0 < strlen($sW))
{ {
$sEmail = \MailSo\Base\Utils::IdnToUtf8($sEmail, true); $sEmail = \MailSo\Base\Utils::IdnToUtf8($sEmail, true);
$sLogin = \MailSo\Base\Utils::IdnToUtf8($sLogin); $sLogin = \MailSo\Base\Utils::IdnToUtf8($sLogin, true);
$sW = \preg_replace('/([^\s]+)@[^\s]*/', '$1', $sW); $sW = \preg_replace('/([^\s]+)@[^\s]*/', '$1', $sW);
$sW = ' '.\trim(\preg_replace('/[\s;,\r\n\t]+/', ' ', $sW)).' '; $sW = ' '.\trim(\preg_replace('/[\s;,\r\n\t]+/', ' ', $sW)).' ';
$sUserPart = \MailSo\Base\Utils::GetAccountNameFromEmail(0 < \strlen($sLogin) ? $sLogin : $sEmail); $sUserPart = \MailSo\Base\Utils::GetAccountNameFromEmail(0 < \strlen($sLogin) ? $sLogin : $sEmail);
return false !== \strpos($sW, ' '.$sUserPart.' '); return false !== \stripos($sW, ' '.$sUserPart.' ');
} }
return true; return true;

View file

@ -23,13 +23,16 @@ class OwnCloudSuggestions implements \RainLoop\Providers\Suggestions\ISuggestion
try try
{ {
if (!$oAccount || !\RainLoop\Utils::IsOwnCloud() || if (!$oAccount || !\RainLoop\Utils::IsOwnCloud() ||
!\class_exists('\\OCP\\Contacts') || !\OCP\Contacts::isEnabled()) !\class_exists('\\OCP\\Contacts') || !\OCP\Contacts::isEnabled() ||
!\class_exists('\\OCP\\User') || !\OCP\User::isLoggedIn()
)
{ {
return $aResult; return $aResult;
} }
$aSearchResult = \OCP\Contacts::search($sQuery, array('FN', 'EMAIL')); $aSearchResult = \OCP\Contacts::search($sQuery, array('FN', 'EMAIL'));
if (\is_array($aSearchResult) && 0 < \count($aSearchResult))
{
foreach ($aSearchResult as $aContact) foreach ($aSearchResult as $aContact)
{ {
if (0 >= $iLimit) if (0 >= $iLimit)
@ -60,10 +63,11 @@ class OwnCloudSuggestions implements \RainLoop\Providers\Suggestions\ISuggestion
} }
} }
unset($aSearchResult);
$aResult = \array_values($aResult); $aResult = \array_values($aResult);
} }
unset($aSearchResult);
}
catch (\Exception $oException) catch (\Exception $oException)
{ {
if ($this->oLogger) if ($this->oLogger)

View file

@ -1121,7 +1121,7 @@ class ServiceActions
private function localError($sTitle, $sDesc) private function localError($sTitle, $sDesc)
{ {
@header('Content-Type: text/html; charset=utf-8'); @header('Content-Type: text/html; charset=utf-8');
return $this->oActions->ErrorTemplates($sTitle, \nl2br($sDesc)); return $this->ErrorTemplates($sTitle, \nl2br($sDesc));
} }
/** /**