mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-26 16:26:44 +03:00
Resolve #1169
This commit is contained in:
parent
311dc7610f
commit
9ff3e94870
3 changed files with 5 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ const
|
|||
BASE = doc.location.pathname.replace(/\/+$/,'') + '/',
|
||||
HASH_PREFIX = '#/',
|
||||
|
||||
adminPath = () => rl.adminArea() && !Settings.app('adminHostUse'),
|
||||
adminPath = () => rl.adminArea() && !Settings.app('adminHost'),
|
||||
|
||||
prefix = () => BASE + '?' + (adminPath() ? Settings.app('adminPath') : '');
|
||||
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ class Actions
|
|||
'webPath' => \RainLoop\Utils::WebPath(),
|
||||
'webVersionPath' => \RainLoop\Utils::WebVersionPath()
|
||||
), $bAdmin ? array(
|
||||
'adminHostUse' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
|
||||
'adminHost' => '' !== $oConfig->Get('security', 'admin_panel_host', ''),
|
||||
'adminPath' => $oConfig->Get('security', 'admin_panel_key', '') ?: 'admin',
|
||||
'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true)
|
||||
) : array()
|
||||
|
|
|
|||
|
|
@ -84,13 +84,12 @@ abstract class Service
|
|||
|
||||
$aPaths = \explode('/', $sQuery);
|
||||
|
||||
$bAdmin = false;
|
||||
$sAdminPanelHost = $oConfig->Get('security', 'admin_panel_host', '');
|
||||
$sAdminPanelHost = \trim($oConfig->Get('security', 'admin_panel_host', ''));
|
||||
if (empty($sAdminPanelHost)) {
|
||||
$bAdmin = !empty($aPaths[0]) && ($oConfig->Get('security', 'admin_panel_key', '') ?: 'admin') === $aPaths[0];
|
||||
$bAdmin && \array_shift($aPaths);
|
||||
} else if (empty($aPaths[0]) && \mb_strtolower($sAdminPanelHost) === \mb_strtolower($oHttp->GetHost())) {
|
||||
$bAdmin = true;
|
||||
} else {
|
||||
$bAdmin = \mb_strtolower($sAdminPanelHost) === \mb_strtolower($oHttp->GetHost());
|
||||
}
|
||||
|
||||
$oActions = $bAdmin ? new ActionsAdmin() : Api::Actions();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue