1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[feature/avatars] Support proper avatar deletion, stub ACP

Fixing avatar deletion in the UCP and ACP, and stubbing the ACP
configuration page. I'll admit I kind of got caught carried away, so
this really should be a couple separate commits.

PHPBB3-10018
This commit is contained in:
Cullen Walsh
2011-04-20 23:14:38 -07:00
committed by Cullen Walsh
parent 611a1d647a
commit 84099e5bc1
11 changed files with 130 additions and 81 deletions

View File

@@ -553,6 +553,39 @@ class ucp_profile
if ($config['allow_avatar'] && $auth->acl_get('u_chgavatar'))
{
$avatar_manager = new phpbb_avatar_manager($phpbb_root_path, $phpEx, $config, $cache->getDriver());
if (isset($_POST['av_delete']))
{
if (check_form_key('ucp_avatar'))
{
$result = array(
'user_avatar' => '',
'user_avatar_type' => '',
'user_avatar_width' => 0,
'user_avatar_height' => 0,
);
if ($driver = $avatar_manager->get_driver($user->data['user_avatar_type']))
{
$driver->delete($user->data);
}
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $result) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
else
{
$error[] = 'FORM_INVALID';
}
}
$avatar_drivers = $avatar_manager->get_valid_drivers();
sort($avatar_drivers);