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->loadFromSession();
/**
* Database
@ -80,6 +79,11 @@ if (
* Options
*/
$options = new Options($database);
/**
* User session
*/
$user->loadFromSession();
}
/**

View file

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