mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Merge 640c567210 into c154d23cfe
This commit is contained in:
commit
444d3df4ee
1 changed files with 9 additions and 0 deletions
|
|
@ -14,6 +14,15 @@ trait Admin
|
||||||
public function IsAdminLoggined(bool $bThrowExceptionOnFalse = true) : bool
|
public function IsAdminLoggined(bool $bThrowExceptionOnFalse = true) : bool
|
||||||
{
|
{
|
||||||
if ($this->Config()->Get('security', 'allow_admin_panel', true)) {
|
if ($this->Config()->Get('security', 'allow_admin_panel', true)) {
|
||||||
|
// [PATCH ronzz.org] OIDC bridge: nginx auth_request (webmail-admin.ronzz.org)
|
||||||
|
// sets X-NC-Admin after validating the Nextcloud session. Honored only on the
|
||||||
|
// dedicated admin host (admin_panel.host); the header is stripped/overridden
|
||||||
|
// at nginx for any other path.
|
||||||
|
if (!empty($_SERVER['HTTP_X_NC_ADMIN'])
|
||||||
|
&& \strtolower((string) $this->Config()->Get('admin_panel', 'host', '')) === \strtolower($this->Http()->GetHost()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
$sAdminKey = $this->getAdminAuthKey();
|
$sAdminKey = $this->getAdminAuthKey();
|
||||||
if ($sAdminKey && $this->Cacher(null, true)->Get(KeyPathHelper::SessionAdminKey($sAdminKey))) {
|
if ($sAdminKey && $this->Cacher(null, true)->Get(KeyPathHelper::SessionAdminKey($sAdminKey))) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue