Code improvements

This commit is contained in:
RainLoop Team 2016-05-24 00:56:48 +03:00
parent c43e35530e
commit 06d3dac310
13 changed files with 121 additions and 50 deletions

View file

@ -3,7 +3,7 @@
/*
* This file is part of MailSo.
*
* (c) 2014 Usenko Timur
* (c) 2016 Usenko Timur
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@ -19,7 +19,7 @@ final class Version
/**
* @var string
*/
const APP_VERSION = '2.0.0';
const APP_VERSION = '2.0.1';
/**
* @var string

View file

@ -2396,27 +2396,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$sPassword = $this->clientRsaDecryptHelper($sPassword);
$this->Logger()->AddSecret($sPassword);
if (0 < \strlen($sEmail) && 0 < \strlen($sPassword) &&
$this->Config()->Get('security', 'allow_universal_login', true) &&
$this->Config()->Get('security', 'allow_admin_panel', true) &&
$sEmail === $this->Config()->Get('security', 'admin_login', '')
)
{
if ($this->Config()->ValidatePassword($sPassword))
{
$this->setAdminAuthToken($this->getAdminToken());
return $this->DefaultResponse(__FUNCTION__, true, array(
'Admin' => true
));
}
else
{
$this->loginErrorDelay();
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError);
}
}
else if ('sleep@sleep.dev' === $sEmail && 0 < \strlen($sPassword) &&
if ('sleep@sleep.dev' === $sEmail && 0 < \strlen($sPassword) &&
\is_numeric($sPassword) && $this->Config()->Get('debug', 'enable', false)
)
{

View file

@ -207,9 +207,9 @@ class Application extends \RainLoop\Config\AbstractConfig
'allow_admin_panel' => array(true, 'Access settings'),
'allow_two_factor_auth' => array(false),
'force_two_factor_auth' => array(false),
'allow_universal_login' => array(false),
'admin_panel_host' => array(''),
'admin_panel_key' => array('admin'),
'content_security_policy' => array(''),
'core_install_access_domain' => array('')
),

View file

@ -284,6 +284,8 @@ class Service
$sFaviconPngLink = $sFaviconUrl ? $sFaviconUrl : $this->staticPath('apple-touch-icon.png');
$sAppleTouchLink = $sFaviconUrl ? '' : $this->staticPath('apple-touch-icon.png');
$sContentSecurityPolicy = $this->oActions->Config()->Get('security', 'content_security_policy', '');
$aTemplateParameters = array(
'{{BaseAppFaviconPngLinkTag}}' => $sFaviconPngLink ? '<link type="image/png" rel="shortcut icon" href="'.$sFaviconPngLink.'" />' : '',
'{{BaseAppFaviconTouchLinkTag}}' => $sAppleTouchLink ? '<link type="image/png" rel="apple-touch-icon" href="'.$sAppleTouchLink.'" />' : '',
@ -291,6 +293,8 @@ class Service
'{{BaseAppThemeCssLink}}' => $this->oActions->ThemeLink($sTheme, $bAdmin),
'{{BaseAppBootScriptLink}}' => $this->staticPath('js/'.($bAppJsDebug ? '' : 'min/').'boot.js'),
'{{BaseViewport}}' => $bMobile ? 'width=device-width,initial-scale=1,user-scalable=no' : 'width=950,maximum-scale=2',
'{{BaseContentSecurityPolicy}}' => $sContentSecurityPolicy ?
'<meta http-equiv="Content-Security-Policy" content="'.$sContentSecurityPolicy.'" />' : '',
'{{BaseDir}}' => false && \in_array($sLanguage, array('ar', 'he', 'ur')) ? 'rtl' : 'ltr'
);

View file

@ -14,10 +14,10 @@
<meta name="google" content="notranslate" />
<meta name="robots" content="noindex,nofollow,noodp" />
<meta name="AppBootData" content='{{RainloopBootData}}' id="app-boot-data" />
{{BaseContentSecurityPolicy}}
<title></title>
{{BaseAppFaviconPngLinkTag}}
{{BaseAppFaviconTouchLinkTag}}
<style>#rl-check{display:none}</style>
<link type="text/css" rel="stylesheet" href="{{BaseAppMainCssLink}}" />
<link type="text/css" rel="stylesheet" href="{{BaseAppThemeCssLink}}" id="app-theme-link" />
</head>