Fixed a problem when moving and adding the user's avatar in the registry

This commit is contained in:
Alfonso Saavedra "Son Link" 2024-12-19 17:04:01 +01:00
parent 0c473367d5
commit 182e3a63b0
No known key found for this signature in database
GPG key ID: D3594BCF897F74D8

View file

@ -420,8 +420,8 @@ class UsersModel extends BaseModel
//$builder->resetQuery();
// Move the file to it's new home
$filename = $user['username'] . '.' . $image->getExtension();
$image->move(FCPATH . '/img/users/', $filename);
$this->where('id', $id)->update(['img' => $filename]);
$image->move(ROOTPATH . '/public/img/users/', $filename);$image->move(ROOTPATH . '/public/img/users/', $filename, true);
$this->where('id', $id)->set(['img' => $filename])->update();
$response['ok'] = true;
}
}