Removed User model from $_SESSION.
This commit is contained in:
parent
597a20deea
commit
f26726c6e9
16 changed files with 72 additions and 74 deletions
|
|
@ -3,7 +3,9 @@
|
|||
namespace PHPCensor;
|
||||
|
||||
use b8\Config;
|
||||
use b8\Store\Factory;
|
||||
use PHPCensor\Model\User;
|
||||
use PHPCensor\Store\UserStore;
|
||||
|
||||
class View
|
||||
{
|
||||
|
|
@ -85,4 +87,19 @@ class View
|
|||
|
||||
return $disableAuth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
*/
|
||||
protected function getUser()
|
||||
{
|
||||
if (empty($_SESSION['php-censor-user-id'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @var UserStore $userStore */
|
||||
$userStore = Factory::getStore('User');
|
||||
|
||||
return $userStore->getById($_SESSION['php-censor-user-id']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue