diff options
| author | Frederic Guillot <fred@kanboard.net> | 2016-03-26 14:43:41 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2016-03-26 14:43:41 -0400 |
| commit | 820c929ab38273c80d0930e2e6140dd7676ba4df (patch) | |
| tree | 3944047e41d14077f7e5e8c0d50856b360a22567 /app/Model/User.php | |
| parent | e71f37238c82f01cd02d6d7343b42328d9603d14 (diff) | |
Added avatar image upload
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; |
