mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
parent
1623f515ff
commit
c7105186d9
2 changed files with 12 additions and 1 deletions
|
|
@ -106,6 +106,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
'admin_login' => array('admin', 'Login and password for web admin panel'),
|
'admin_login' => array('admin', 'Login and password for web admin panel'),
|
||||||
'admin_password' => array('12345'),
|
'admin_password' => array('12345'),
|
||||||
'allow_admin_panel' => array(true, 'Access settings'),
|
'allow_admin_panel' => array(true, 'Access settings'),
|
||||||
|
'admin_panel_host' => array(''),
|
||||||
'core_install_access_domains' => array('')
|
'core_install_access_domains' => array('')
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,17 @@ class Service
|
||||||
$aPaths = \explode('/', $sQuery);
|
$aPaths = \explode('/', $sQuery);
|
||||||
$this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths));
|
$this->oActions->Plugins()->RunHook('filter.http-paths', array(&$aPaths));
|
||||||
|
|
||||||
$bAdmin = !empty($aPaths[0]) && \in_array(\strtolower($aPaths[0]), array('admin', 'cp'));
|
$bAdmin = false;
|
||||||
|
$sAdminPanelHost = $this->oActions->Config()->Get('security', 'admin_panel_host', '');
|
||||||
|
if (empty($sAdminPanelHost))
|
||||||
|
{
|
||||||
|
$bAdmin = !empty($aPaths[0]) && \in_array(\strtolower($aPaths[0]), array('admin', 'cp'));
|
||||||
|
}
|
||||||
|
else if (empty($aPaths[0]) && \strtolower($sAdminPanelHost) === \strtolower($this->oHttp->GetHost()))
|
||||||
|
{
|
||||||
|
$bAdmin = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($bAdmin && !$this->oActions->Config()->Get('security', 'allow_admin_panel', true))
|
if ($bAdmin && !$this->oActions->Config()->Get('security', 'allow_admin_panel', true))
|
||||||
{
|
{
|
||||||
echo $this->oActions->ErrorTemplates('Access Denied.',
|
echo $this->oActions->ErrorTemplates('Access Denied.',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue