diff options
Diffstat (limited to 'app/Model/User.php')
-rw-r--r-- | app/Model/User.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/Model/User.php b/app/Model/User.php index 0e11422b..b093d55f 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -283,12 +283,7 @@ class User extends Base { $this->prepare($values); $result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($values); - - // If the user is connected refresh his session - if ($this->userSession->getId() == $values['id']) { - $this->userSession->initialize($this->getById($this->userSession->getId())); - } - + $this->userSession->refresh($values['id']); return $result; } @@ -327,6 +322,9 @@ class User extends Base { return $this->db->transaction(function (Database $db) use ($user_id) { + // Remove Avatar + $this->avatarFile->remove($user_id); + // All assigned tasks are now unassigned (no foreign key) if (! $db->table(Task::TABLE)->eq('owner_id', $user_id)->update(array('owner_id' => 0))) { return false; |