Skip to content

Commit

Permalink
AutoLogin: Check the remote username against logged in user
Browse files Browse the repository at this point in the history
fixes #6462
  • Loading branch information
mxhash committed Jul 30, 2014
1 parent e2c761a commit 56a2935
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions library/Icinga/Authentication/Manager.php
Expand Up @@ -111,6 +111,13 @@ public function persistCurrentUser()
public function authenticateFromSession()
{
$this->user = Session::getSession()->get('user');

if ($this->user !== null && $this->user->isRemoteUser() === true) {
list($originUsername, $field) = $this->user->getRemoteUserInformation();
if (array_key_exists($field, $_SERVER) && $_SERVER[$field] !== $originUsername) {
$this->removeAuthorization();
}
}
}

/**
Expand Down

0 comments on commit 56a2935

Please sign in to comment.