Merge pull request #4017 from Icinga/fix/external-authentication-3995

Fix external authentication
This commit is contained in:
Johannes Meyer 2019-12-05 15:40:47 +01:00 committed by GitHub
commit cc08f7e11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<?php foreach ($navigation as $item): /** @var \Icinga\Web\Navigation\NavigationItem $item */?> <?php foreach ($navigation as $item): /** @var \Icinga\Web\Navigation\NavigationItem $item */?>
<a class="dashboard-link" href="<?= $this->url($item->getUrl(), $item->getUrlParameters()) ?>"> <a class="dashboard-link" href="<?= $this->url($item->getUrl(), $item->getUrlParameters()) ?>"<?= $this->propertiesToString($item->getAttributes()) ?>>
<div class="link-icon"> <div class="link-icon">
<?= $this->icon($item->getIcon() ?: 'forward', null, array('aria-hidden' => true)) ?> <?= $this->icon($item->getIcon() ?: 'forward', null, array('aria-hidden' => true)) ?>
</div> </div>

View File

@ -70,11 +70,11 @@ class ExternalBackend implements UserBackendInterface
public static function getRemoteUser($variable = 'REMOTE_USER') public static function getRemoteUser($variable = 'REMOTE_USER')
{ {
$username = getenv($variable); $username = getenv($variable);
if ($username !== false) { if (! empty($username)) {
return $username; return $username;
} }
if (array_key_exists($variable, $_SERVER)) { if (array_key_exists($variable, $_SERVER) && ! empty($_SERVER[$variable])) {
return $_SERVER[$variable]; return $_SERVER[$variable];
} }
} }