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 = 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue