From: Marcin Haba Date: Sun, 13 Dec 2015 16:50:02 +0000 (+0100) Subject: baculum: Fix working with php-fpm X-Git-Tag: Release-7.4.0~134 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8b9b523d41d17b1787ea189de643ad633e94e6d;p=bacula%2Fbacula baculum: Fix working with php-fpm --- diff --git a/gui/baculum/protected/Class/BaculumAPI.php b/gui/baculum/protected/Class/BaculumAPI.php index 67f5e22fa6..94236f6689 100644 --- a/gui/baculum/protected/Class/BaculumAPI.php +++ b/gui/baculum/protected/Class/BaculumAPI.php @@ -53,7 +53,11 @@ abstract class BaculumAPI extends TPage if(is_null($this->user) && $this->Application->getModule('configuration')->isApplicationConfig() === true) { $appConfig = ConfigurationManager::getApplicationConfig(); // @TOFIX: Baculum API layer should not use $_SERVER variables. - $this->user = isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != $appConfig['baculum']['login'] ? $_SERVER['PHP_AUTH_USER'] : null; + if (isset($_SERVER['PHP_AUTH_USER'])) { + // NOTE: With php-fpm $_SERVER['PHP_AUTH_USER'] value is empty string here + $user = trim($_SERVER['PHP_AUTH_USER']); + $this->user = (!empty($user) && $user != $appConfig['baculum']['login']) ? $user : null; + } } switch($_SERVER['REQUEST_METHOD']) {