mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Revert breaking change in Auth::isAuthenticated()
refs #12580 fixes #13281
This commit is contained in:
parent
f1051f0ea5
commit
4eb61c2bcf
@ -416,7 +416,6 @@ class Web extends EmbeddedWeb
|
|||||||
private function setupUser()
|
private function setupUser()
|
||||||
{
|
{
|
||||||
$auth = Auth::getInstance();
|
$auth = Auth::getInstance();
|
||||||
$auth->authenticate();
|
|
||||||
if (! $this->request->isXmlHttpRequest() && $this->request->isApiRequest() && ! $auth->isAuthenticated()) {
|
if (! $this->request->isXmlHttpRequest() && $this->request->isApiRequest() && ! $auth->isAuthenticated()) {
|
||||||
$auth->authHttp();
|
$auth->authHttp();
|
||||||
}
|
}
|
||||||
|
@ -78,22 +78,6 @@ class Auth
|
|||||||
return new AuthChain();
|
return new AuthChain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Authenticate the user
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function authenticate()
|
|
||||||
{
|
|
||||||
if ($this->user === null) {
|
|
||||||
$this->authenticateFromSession();
|
|
||||||
}
|
|
||||||
if ($this->user === null && ! $this->authExternal()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get whether the user is authenticated
|
* Get whether the user is authenticated
|
||||||
*
|
*
|
||||||
@ -101,7 +85,14 @@ class Auth
|
|||||||
*/
|
*/
|
||||||
public function isAuthenticated()
|
public function isAuthenticated()
|
||||||
{
|
{
|
||||||
return $this->user !== null;
|
if ($this->user !== null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$this->authenticateFromSession();
|
||||||
|
if ($this->user === null && ! $this->authExternal()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAuthenticated(User $user, $persist = true)
|
public function setAuthenticated(User $user, $persist = true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user