|
@@ -39,7 +39,9 @@ function getCurrentUser(): ?array
|
|
|
function requireLogin(): void
|
|
function requireLogin(): void
|
|
|
{
|
|
{
|
|
|
if (!isLoggedIn()) {
|
|
if (!isLoggedIn()) {
|
|
|
- header('Location: /login/login.php');
|
|
|
|
|
|
|
+ $current = $_SERVER['REQUEST_URI'] ?? '';
|
|
|
|
|
+ $redirect = $current !== '' ? '?redirect=' . urlencode($current) : '';
|
|
|
|
|
+ header('Location: /login/login.php' . $redirect);
|
|
|
exit;
|
|
exit;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|