Added avatar image upload
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user