aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_profile.php
diff options
context:
space:
mode:
authorCullen Walsh <ckwalsh@phpbb.com>2011-04-20 23:14:38 -0700
committerCullen Walsh <ckwalsh@cullenwalsh.com>2012-03-18 22:20:45 +0000
commit84099e5bc1f452e1a4643fd78658929875ab1eee (patch)
treef89caba7c98587128009218f37f50630d585e83b /phpBB/includes/ucp/ucp_profile.php
parent611a1d647a3a63013df472b469bf1f3e6e7bd657 (diff)
downloadforums-84099e5bc1f452e1a4643fd78658929875ab1eee.tar
forums-84099e5bc1f452e1a4643fd78658929875ab1eee.tar.gz
forums-84099e5bc1f452e1a4643fd78658929875ab1eee.tar.bz2
forums-84099e5bc1f452e1a4643fd78658929875ab1eee.tar.xz
forums-84099e5bc1f452e1a4643fd78658929875ab1eee.zip
[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
Diffstat (limited to 'phpBB/includes/ucp/ucp_profile.php')
-rw-r--r--phpBB/includes/ucp/ucp_profile.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index a712547bd1..222d9e0af4 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -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);