fix: load user session when database is available

This commit is contained in:
Jay Trees 2024-05-11 18:31:43 +02:00
parent deb6810b56
commit b422805af4
2 changed files with 11 additions and 7 deletions

View file

@ -54,7 +54,6 @@ session_start(
); );
$user = User::getCurrent(); $user = User::getCurrent();
$user->loadFromSession();
/** /**
* Database * Database
@ -80,6 +79,11 @@ if (
* Options * Options
*/ */
$options = new Options($database); $options = new Options($database);
/**
* User session
*/
$user->loadFromSession();
} }
/** /**

View file

@ -259,12 +259,12 @@ class User
return false; return false;
} }
$database = new Database( global $database;
DATABASE_HOST,
DATABASE_NAME, if (false === $database) {
DATABASE_USER, return false;
DATABASE_PASSWORD }
);
$database->connect(); $database->connect();
$sessions = $database $sessions = $database