aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2009-06-19 22:03:19 +0000
committerJoas Schilling <nickvergessen@gmx.de>2009-06-19 22:03:19 +0000
commitd85a5ad036b2088fe742de29d9464678d2e19e23 (patch)
tree9bbd990b2baea05723f64cbcc26ecd39669bf464 /phpBB/includes/ucp
parent6e884de00060c3632e1e7fa25c84c4e602fd46e8 (diff)
downloadforums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.gz
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.bz2
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.xz
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.zip
Fix bug #46785 - Hide avatars if type disabled and give global option to turn on/off
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9632 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_profile.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 572235696e..e2a9699acc 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -578,9 +578,20 @@ class ucp_profile
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
+ if (!$config['allow_avatar'] && $user->data['user_avatar_type'])
+ {
+ $error[] = $user->lang['AVATAR_NOT_ALLOWED'];
+ }
+ else if ((($user->data['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
+ (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
+ (($user->data['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
+ {
+ $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
+ }
+
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
+ 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true),
'AVATAR_SIZE' => $config['avatar_filesize'],
'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
@@ -590,11 +601,11 @@ class ucp_profile
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
));
- if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
+ if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
{
avatar_gallery($category, $avatar_select, 4);
}
- else
+ else if ($config['allow_avatar'])
{
$avatars_enabled = ($can_upload || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;