mirror of
https://github.com/flarum/core.git
synced 2025-08-01 14:10:37 +02:00
@@ -42,7 +42,9 @@ class DeleteAvatarHandler
|
||||
// Make sure the current user is allowed to edit the user profile.
|
||||
// This will let admins and the user themselves pass through, and
|
||||
// throw an exception otherwise.
|
||||
$user->assertCan($actor, 'edit');
|
||||
if ($actor->id !== $user->id) {
|
||||
$user->assertCan($actor, 'edit');
|
||||
}
|
||||
|
||||
$avatarPath = $user->avatar_path;
|
||||
$user->changeAvatarPath(null);
|
||||
|
@@ -48,7 +48,9 @@ class UploadAvatarHandler
|
||||
// Make sure the current user is allowed to edit the user profile.
|
||||
// This will let admins and the user themselves pass through, and
|
||||
// throw an exception otherwise.
|
||||
$user->assertCan($actor, 'edit');
|
||||
if ($actor->id !== $user->id) {
|
||||
$user->assertCan($actor, 'edit');
|
||||
}
|
||||
|
||||
$tmpFile = tempnam(sys_get_temp_dir(), 'avatar');
|
||||
$command->file->moveTo($tmpFile);
|
||||
|
Reference in New Issue
Block a user