Fixed updating safety settings
This commit is contained in:
parent
89826a0be9
commit
4ecb3f3b81
2 changed files with 10 additions and 5 deletions
|
@ -245,11 +245,6 @@ class UserController
|
|||
|
||||
R::store($user);
|
||||
$this->context->transport->user = $user;
|
||||
if ($this->context->user->id == $user->id)
|
||||
{
|
||||
$this->context->user = $user;
|
||||
unset($_SESSION['user']);
|
||||
}
|
||||
$this->context->transport->success = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,16 @@ class Model_User extends RedBean_SimpleModel
|
|||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$context = \Chibi\Registry::getContext();
|
||||
if ($context->user->id == $this->id)
|
||||
{
|
||||
$context->user = $this;
|
||||
unset($_SESSION['user']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const SETTING_SAFETY = 1;
|
||||
|
|
Loading…
Reference in a new issue