mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
allowAdminPanel => adminAllowed
This commit is contained in:
parent
2a01d8c991
commit
c1dd6edc28
4 changed files with 5 additions and 6 deletions
|
|
@ -17,7 +17,7 @@ class AdminApp extends AbstractApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
if (!Settings.app('allowAdminPanel')) {
|
if (!Settings.app('adminAllowed')) {
|
||||||
rl.route.root();
|
rl.route.root();
|
||||||
setTimeout(() => location.href = '/', 1);
|
setTimeout(() => location.href = '/', 1);
|
||||||
} else if (SettingsGet('Auth')) {
|
} else if (SettingsGet('Auth')) {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export const
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
logoutLink = () => (rl.adminArea() && !Settings.app('adminHostUse'))
|
logoutLink = () => (rl.adminArea() && !Settings.app('adminHostUse'))
|
||||||
? SERVER_PREFIX + (Settings.app('adminPath') || 'admin')
|
? SERVER_PREFIX + Settings.app('adminPath')
|
||||||
: ROOT,
|
: ROOT,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -718,8 +718,8 @@ class Actions
|
||||||
'attachmentsActions' => $aAttachmentsActions
|
'attachmentsActions' => $aAttachmentsActions
|
||||||
), $bAdmin ? array(
|
), $bAdmin ? array(
|
||||||
'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
|
'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
|
||||||
'adminPath' => \strtolower($oConfig->Get('security', 'admin_panel_key', 'admin')),
|
'adminPath' => $oConfig->Get('security', 'admin_panel_key', '') ?: 'admin',
|
||||||
'allowAdminPanel' => (bool)$oConfig->Get('security', 'allow_admin_panel', true),
|
'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true),
|
||||||
) : array());
|
) : array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,7 @@ class Service
|
||||||
$sAdminPanelHost = $oConfig->Get('security', 'admin_panel_host', '');
|
$sAdminPanelHost = $oConfig->Get('security', 'admin_panel_host', '');
|
||||||
if (empty($sAdminPanelHost))
|
if (empty($sAdminPanelHost))
|
||||||
{
|
{
|
||||||
$sAdminPanelKey = \strtolower($oConfig->Get('security', 'admin_panel_key', 'admin'));
|
$bAdmin = !empty($aPaths[0]) && ($oConfig->Get('security', 'admin_panel_key', '') ?: 'admin') === $aPaths[0];
|
||||||
$bAdmin = !empty($aPaths[0]) && \strtolower($aPaths[0]) === $sAdminPanelKey;
|
|
||||||
}
|
}
|
||||||
else if (empty($aPaths[0]) &&
|
else if (empty($aPaths[0]) &&
|
||||||
\mb_strtolower($sAdminPanelHost) === \mb_strtolower($this->oHttp->GetHost()))
|
\mb_strtolower($sAdminPanelHost) === \mb_strtolower($this->oHttp->GetHost()))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue