mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
Release commit
This commit is contained in:
parent
86f855fa5b
commit
b01f298b7b
13 changed files with 121 additions and 42 deletions
|
@ -17,10 +17,11 @@ OCP\App::registerPersonal('rainloop', 'personal');
|
|||
if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false))
|
||||
{
|
||||
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', 'logout', 'OC_RainLoop_Helper', 'logout');
|
||||
|
||||
OCP\Util::addScript('rainloop', 'rainloop');
|
||||
|
||||
OCP\App::addNavigationEntry(array(
|
||||
|
|
|
@ -110,8 +110,24 @@ class OC_RainLoop_Helper
|
|||
|
||||
public static function logout()
|
||||
{
|
||||
return OCP\Config::setUserValue(
|
||||
OCP\Config::setUserValue(
|
||||
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)
|
||||
|
|
|
@ -203,6 +203,10 @@
|
|||
return 0 < Globals.popupVisibilityNames().length;
|
||||
}, this);
|
||||
|
||||
Globals.popupVisibility.subscribe(function (bValue) {
|
||||
Globals.$html.toggleClass('rl-modal', bValue);
|
||||
});
|
||||
|
||||
// keys
|
||||
Globals.keyScopeReal = ko.observable(Enums.KeyState.All);
|
||||
Globals.keyScopeFake = ko.observable(Enums.KeyState.All);
|
||||
|
|
14
dev/External/ko.js
vendored
14
dev/External/ko.js
vendored
|
@ -287,7 +287,19 @@
|
|||
});
|
||||
},
|
||||
'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);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
.transition(all 200ms ease-out);
|
||||
transform: scale(1.1);
|
||||
transform: scale(0.95);
|
||||
|
||||
&.in {
|
||||
transform: none;
|
||||
|
|
|
@ -1308,6 +1308,7 @@
|
|||
});
|
||||
|
||||
Events.sub('window.resize.real', this.resizerTrigger);
|
||||
Events.sub('window.resize.real', _.debounce(this.resizerTrigger, 50));
|
||||
|
||||
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)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "RainLoop",
|
||||
"title": "RainLoop Webmail",
|
||||
"version": "1.8.1",
|
||||
"release": "255",
|
||||
"release": "258",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"homepage": "http://rainloop.net",
|
||||
"main": "gulpfile.js",
|
||||
|
|
|
@ -831,7 +831,7 @@ class Utils
|
|||
public static function GetFileExtension($sFileName)
|
||||
{
|
||||
$iLast = \strrpos($sFileName, '.');
|
||||
return false === $iLast ? '' : \substr($sFileName, $iLast + 1);
|
||||
return false === $iLast ? '' : \strtolower(\substr($sFileName, $iLast + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -617,6 +617,15 @@ class Actions
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -997,11 +1006,17 @@ class Actions
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return string
|
||||
*/
|
||||
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))
|
||||
{
|
||||
$aAdminHash = \RainLoop\Utils::DecodeKeyValues($this->getAdminAuthToken());
|
||||
if ((!empty($aAdminHash[0]) && !empty($aAdminHash[1]) &&
|
||||
'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1]))
|
||||
if (!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) &&
|
||||
'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] &&
|
||||
'' !== $this->Cacher()->Get(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2]), '')
|
||||
)
|
||||
{
|
||||
$bResult = true;
|
||||
}
|
||||
|
@ -1119,7 +1136,7 @@ class Actions
|
|||
if (!empty($aAccountHash[8]) && !empty($aAccountHash[9])) // init proxy user/password
|
||||
{
|
||||
$oAccount->SetProxyAuthUser($aAccountHash[8]);
|
||||
$oAccount->SetProxyAuthUser($aAccountHash[89]);
|
||||
$oAccount->SetProxyAuthPassword($aAccountHash[9]);
|
||||
}
|
||||
|
||||
$this->Logger()->AddSecret($oAccount->Password());
|
||||
|
@ -2895,14 +2912,17 @@ class Actions
|
|||
public function DoLogout()
|
||||
{
|
||||
$oAccount = $this->getAccountFromToken(false);
|
||||
if ($oAccount && $oAccount->SignMe())
|
||||
if ($oAccount)
|
||||
{
|
||||
$this->ClearSignMeData($oAccount);
|
||||
}
|
||||
if ($oAccount->SignMe())
|
||||
{
|
||||
$this->ClearSignMeData($oAccount);
|
||||
}
|
||||
|
||||
if ($oAccount && '' === $oAccount->ParentEmail())
|
||||
{
|
||||
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SPEC_TOKEN_KEY);
|
||||
if (!$oAccount->IsAdditionalAccount())
|
||||
{
|
||||
\RainLoop\Utils::ClearCookie(\RainLoop\Actions::AUTH_SPEC_TOKEN_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->TrueResponse(__FUNCTION__);
|
||||
|
|
|
@ -130,4 +130,14 @@ class KeyPathHelper
|
|||
{
|
||||
return '/CssCache/'.$sHash.'/'.$sTheme.'/'.APP_VERSION.'/';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sRand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function SessionAdminKey($sRand)
|
||||
{
|
||||
return '/Session/AdminKey/'.\md5($sRand).'/';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -522,13 +522,13 @@ class Domain
|
|||
if (0 < strlen($sW))
|
||||
{
|
||||
$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 = ' '.\trim(\preg_replace('/[\s;,\r\n\t]+/', ' ', $sW)).' ';
|
||||
|
||||
$sUserPart = \MailSo\Base\Utils::GetAccountNameFromEmail(0 < \strlen($sLogin) ? $sLogin : $sEmail);
|
||||
return false !== \strpos($sW, ' '.$sUserPart.' ');
|
||||
return false !== \stripos($sW, ' '.$sUserPart.' ');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -23,46 +23,50 @@ class OwnCloudSuggestions implements \RainLoop\Providers\Suggestions\ISuggestion
|
|||
try
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
$aSearchResult = \OCP\Contacts::search($sQuery, array('FN', 'EMAIL'));
|
||||
|
||||
foreach ($aSearchResult as $aContact)
|
||||
if (\is_array($aSearchResult) && 0 < \count($aSearchResult))
|
||||
{
|
||||
if (0 >= $iLimit)
|
||||
foreach ($aSearchResult as $aContact)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$sUid = empty($aContact['UID']) ? '' : $aContact['UID'];
|
||||
if (!empty($sUid))
|
||||
{
|
||||
$sFullName = isset($aContact['FN']) ? \trim($aContact['FN']) : '';
|
||||
$mEmails = isset($aContact['EMAIL']) ? $aContact['EMAIL'] : '';
|
||||
|
||||
if (!\is_array($mEmails))
|
||||
if (0 >= $iLimit)
|
||||
{
|
||||
$mEmails = array($mEmails);
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($mEmails as $sEmail)
|
||||
$sUid = empty($aContact['UID']) ? '' : $aContact['UID'];
|
||||
if (!empty($sUid))
|
||||
{
|
||||
$sEmail = \trim($sEmail);
|
||||
if (!empty($sEmail))
|
||||
$sFullName = isset($aContact['FN']) ? \trim($aContact['FN']) : '';
|
||||
$mEmails = isset($aContact['EMAIL']) ? $aContact['EMAIL'] : '';
|
||||
|
||||
if (!\is_array($mEmails))
|
||||
{
|
||||
$iLimit--;
|
||||
$aResult[$sUid] = array($sEmail, $sFullName);
|
||||
$mEmails = array($mEmails);
|
||||
}
|
||||
|
||||
foreach ($mEmails as $sEmail)
|
||||
{
|
||||
$sEmail = \trim($sEmail);
|
||||
if (!empty($sEmail))
|
||||
{
|
||||
$iLimit--;
|
||||
$aResult[$sUid] = array($sEmail, $sFullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$aResult = \array_values($aResult);
|
||||
}
|
||||
|
||||
unset($aSearchResult);
|
||||
|
||||
$aResult = \array_values($aResult);
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
|
|
|
@ -1121,7 +1121,7 @@ class ServiceActions
|
|||
private function localError($sTitle, $sDesc)
|
||||
{
|
||||
@header('Content-Type: text/html; charset=utf-8');
|
||||
return $this->oActions->ErrorTemplates($sTitle, \nl2br($sDesc));
|
||||
return $this->ErrorTemplates($sTitle, \nl2br($sDesc));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue