Removed User model from $_SESSION.

This commit is contained in:
Dmitry Khomutov 2018-02-17 11:59:02 +07:00
commit f26726c6e9
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
16 changed files with 72 additions and 74 deletions

View file

@ -32,11 +32,8 @@ class Application extends b8\Application
$user = b8\Store\Factory::getStore('User')->getByPrimaryKey($_SESSION['php-censor-user-id']);
if ($user) {
$_SESSION['php-censor-user'] = $user;
return true;
}
unset($_SESSION['php-censor-user-id']);
}
return false;
@ -158,11 +155,9 @@ class Application extends b8\Application
$defaultUserId = (integer)$config->get('php-censor.security.default_user_id', 1);
if ($disableAuth && $defaultUserId) {
$user = b8\Store\Factory::getStore('User')
->getByPrimaryKey($defaultUserId);
$user = b8\Store\Factory::getStore('User')->getByPrimaryKey($defaultUserId);
if ($user) {
$_SESSION['php-censor-user'] = $user;
return true;
}
}