Nexus upgrade design and refresh
This commit is contained in:
@@ -32,7 +32,11 @@ function user_theme(): string
|
||||
$stmt->execute(['id' => $clientId]);
|
||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$theme = is_array($row) ? (string)($row['theme'] ?? '') : '';
|
||||
return $theme !== '' ? $theme : 'light';
|
||||
return match ($theme) {
|
||||
'dark', 'night' => 'night',
|
||||
'light', 'day', '' => 'day',
|
||||
default => $theme,
|
||||
};
|
||||
}
|
||||
|
||||
function set_user_theme(string $theme): void
|
||||
@@ -64,14 +68,12 @@ function current_module_name(): ?string
|
||||
|
||||
function auth_enabled(): bool
|
||||
{
|
||||
return app()->config()->authEnabled;
|
||||
return app()->auth()->isEnabled();
|
||||
}
|
||||
|
||||
function auth_user(): ?array
|
||||
{
|
||||
$session = app()->session();
|
||||
$session->start();
|
||||
return $_SESSION['auth_user'] ?? null;
|
||||
return app()->auth()->user();
|
||||
}
|
||||
|
||||
function auth_display_name(): string
|
||||
|
||||
Reference in New Issue
Block a user