mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-19 06:51:33 +02:00
[ticket/12822] Add method for deleting avatars and use confirm_box
The method will take care of the actual deletion process in the avatar manager. Additionally, we'll be using a confirm box while deleting the avatar to prevent users from accidentally deleting their avatars. PHPBB3-12822
This commit is contained in:
@@ -331,6 +331,28 @@ class acp_groups
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->is_set_post('avatar_delete'))
|
||||
{
|
||||
if (confirm_box(true))
|
||||
{
|
||||
$avatar_data['id'] = substr($avatar_data['id'], 1);
|
||||
$phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_');
|
||||
|
||||
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
|
||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array(
|
||||
'avatar_delete' => true,
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'g' => $group_id,
|
||||
'action' => $action))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Did we submit?
|
||||
if ($update)
|
||||
{
|
||||
|
Reference in New Issue
Block a user