fix: load user session when database is available
This commit is contained in:
parent
deb6810b56
commit
b422805af4
2 changed files with 11 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue