This commit is contained in:
the-djmaze 2023-06-12 13:12:13 +02:00
parent 311dc7610f
commit 9ff3e94870
3 changed files with 5 additions and 6 deletions

View file

@ -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') : '');

View file

@ -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()

View file

@ -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();