mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Allow a user to change and remove his profile picture from user settings.
This commit is contained in:
parent
04b99cd247
commit
0063d360ce
4 changed files with 60 additions and 1 deletions
|
@ -245,6 +245,16 @@ class UserSettingsController extends AbstractController
|
|||
//$em->flush();
|
||||
//For some reason the avatar is not set as master picture attachment, so we do it again here
|
||||
$user->setMasterPictureAttachment($attachment);
|
||||
$page_need_reload = true;
|
||||
}
|
||||
|
||||
if ($form->getClickedButton() && 'remove_avatar' === $form->getClickedButton()->getName()) {
|
||||
//Remove the avatar attachment from the user if requested
|
||||
if ($user->getMasterPictureAttachment() !== null) {
|
||||
$em->remove($user->getMasterPictureAttachment());
|
||||
$user->setMasterPictureAttachment(null);
|
||||
$page_need_reload = true;
|
||||
}
|
||||
}
|
||||
|
||||
$em->flush();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue