From b118e9679d1d36eac12c96b4a7fbca0c04a4fb72 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 26 Feb 2014 17:57:22 +0100 Subject: [PATCH] When webserver setting is missing regular authentication will be used Check if the remote user is set and use regular authentication when the key is missing. refs #5405 --- library/Icinga/Authentication/Manager.php | 4 ++-- library/Icinga/Web/Widget/Chart/PieChart.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Authentication/Manager.php b/library/Icinga/Authentication/Manager.php index f46153fd7..a818c6081 100644 --- a/library/Icinga/Authentication/Manager.php +++ b/library/Icinga/Authentication/Manager.php @@ -404,13 +404,13 @@ class Manager $this->fromRemoteUser = true; $this->authenticateFromSession(); if ($this->user !== null) { - if ($this->user->getUsername() !== $_SERVER["REMOTE_USER"]) { + if (array_key_exists('REMOTE_USER', $_SERVER) && $this->user->getUsername() !== $_SERVER["REMOTE_USER"]) { // Remote user has changed, clear all sessions $this->removeAuthorization(); } return; } - if ($_SERVER["REMOTE_USER"] !== null) { + if (array_key_exists('REMOTE_USER', $_SERVER) && $_SERVER["REMOTE_USER"]) { $this->user = new User($_SERVER["REMOTE_USER"]); $this->persistCurrentUser(); } diff --git a/library/Icinga/Web/Widget/Chart/PieChart.php b/library/Icinga/Web/Widget/Chart/PieChart.php index 0e4547135..edc4e78fe 100644 --- a/library/Icinga/Web/Widget/Chart/PieChart.php +++ b/library/Icinga/Web/Widget/Chart/PieChart.php @@ -43,7 +43,7 @@ class PieChart implements Widget */ private $template =<<<'EOD' -
+
EOD;