Fixed issue caused by used of dangling variable on sessions page.
This commit is contained in:
parent
00d1d2922d
commit
9dd7156c79
2 changed files with 7 additions and 3 deletions
|
@ -11,7 +11,7 @@ if(!$msz->isLoggedIn()) {
|
||||||
$errors = [];
|
$errors = [];
|
||||||
$sessions = $msz->getSessions();
|
$sessions = $msz->getSessions();
|
||||||
$currentUser = $msz->getActiveUser();
|
$currentUser = $msz->getActiveUser();
|
||||||
$activeSessionToken = $authToken->getSessionToken();
|
$activeSessionId = $msz->getAuthInfo()->getSessionId();
|
||||||
|
|
||||||
while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
|
while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
|
||||||
$sessionId = (string)filter_input(INPUT_POST, 'session');
|
$sessionId = (string)filter_input(INPUT_POST, 'session');
|
||||||
|
@ -31,7 +31,7 @@ while($_SERVER['REQUEST_METHOD'] === 'POST' && CSRF::validateRequest()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$activeSessionKilled = $sessionInfo->getToken() === $activeSessionToken;
|
$activeSessionKilled = $sessionInfo->getId() === $activeSessionId;
|
||||||
$sessions->deleteSessions(sessionInfos: $sessionInfo);
|
$sessions->deleteSessions(sessionInfos: $sessionInfo);
|
||||||
$msz->createAuditLog('PERSONAL_SESSION_DESTROY', [$sessionInfo->getId()]);
|
$msz->createAuditLog('PERSONAL_SESSION_DESTROY', [$sessionInfo->getId()]);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ $sessionInfos = $sessions->getSessions(userInfo: $currentUser, pagination: $pagi
|
||||||
foreach($sessionInfos as $sessionInfo)
|
foreach($sessionInfos as $sessionInfo)
|
||||||
$sessionList[] = [
|
$sessionList[] = [
|
||||||
'info' => $sessionInfo,
|
'info' => $sessionInfo,
|
||||||
'active' => $sessionInfo->getToken() === $activeSessionToken,
|
'active' => $sessionInfo->getId() === $activeSessionId,
|
||||||
];
|
];
|
||||||
|
|
||||||
Template::render('settings.sessions', [
|
Template::render('settings.sessions', [
|
||||||
|
|
|
@ -56,6 +56,10 @@ class AuthInfo {
|
||||||
return $this->userInfo;
|
return $this->userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSessionId(): ?string {
|
||||||
|
return $this->sessionInfo?->getId();
|
||||||
|
}
|
||||||
|
|
||||||
public function getSessionInfo(): ?SessionInfo {
|
public function getSessionInfo(): ?SessionInfo {
|
||||||
return $this->sessionInfo;
|
return $this->sessionInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue