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

@ -56,7 +56,7 @@ class UserController extends Controller
public function profile()
{
/** @var User $user */
$user = $_SESSION['php-censor-user'];
$user = $this->getUser();
if ($this->request->getMethod() == 'POST') {
$name = $this->getParam('name', null);
@ -73,8 +73,7 @@ class UserController extends Controller
$perPage = null;
}
$_SESSION['php-censor-user'] = $this->userService->updateUser($user, $name, $email, $password, null, $language, $perPage);
$user = $_SESSION['php-censor-user'];
$user = $this->userService->updateUser($user, $name, $email, $password, null, $language, $perPage);
$this->view->updated = 1;
}