database auth adapter - session fix

This commit is contained in:
Milos Stojanovic
2022-05-25 11:54:04 +02:00
parent 3d008e4e7f
commit 24e2702350

View File

@@ -60,7 +60,7 @@ class Database implements Service, AuthInterface
->fetch('SELECT * FROM users WHERE username = ?', $user->getUsername()) ->fetch('SELECT * FROM users WHERE username = ?', $user->getUsername())
; ;
if ($ret && $hash == $ret->password) { if ($ret && $hash == $ret->password.$ret->permissions.$ret->homedir.$ret->role) {
return $user; return $user;
} }
@@ -76,7 +76,7 @@ class Database implements Service, AuthInterface
if ($ret && $this->verifyPassword($password, $ret->password)) { if ($ret && $this->verifyPassword($password, $ret->password)) {
$user = $this->mapToUserObject($ret); $user = $this->mapToUserObject($ret);
$this->store($user); $this->store($user);
$this->session->set(self::SESSION_HASH, $ret->password); $this->session->set(self::SESSION_HASH, $ret->password.$ret->permissions.$ret->homedir.$ret->role);
return true; return true;
} }