Upload via GUI (360 Dateien)
This commit is contained in:
@@ -52,7 +52,9 @@ function staff_login(array $staff): void
|
||||
session_regenerate_id(true);
|
||||
$_SESSION['staff_id'] = $staff['id'];
|
||||
$_SESSION['staff_last_activity'] = time();
|
||||
$_SESSION['staff_login_at'] = time();
|
||||
staff_touch_activity(get_db(), (int) $staff['id']);
|
||||
login_guard_success($staff, 'web');
|
||||
}
|
||||
|
||||
function staff_logout(): void
|
||||
@@ -77,6 +79,11 @@ function current_staff(): ?array
|
||||
$stmt = get_db()->prepare('SELECT * FROM staff WHERE id = ? AND is_active = 1');
|
||||
$stmt->execute([$_SESSION['staff_id']]);
|
||||
$staff = $stmt->fetch();
|
||||
// „Das war ich nicht“ (Anmelde-Wächter): ältere Browser-Sitzungen dieses Kontos sind ungültig
|
||||
if ($staff && login_guard_session_revoked((int) $staff['id'])) {
|
||||
unset($_SESSION['staff_id']);
|
||||
return null;
|
||||
}
|
||||
return $cache = ($staff ?: null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user