mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 15:45:34 +02:00
Merge branch 'ticket/bantu/9451' into develop-olympus
* ticket/bantu/9451: [ticket/9451] Add optional $can_upload parameter to avatar_process_user().
This commit is contained in:
commit
c3db21bfa2
@ -1706,7 +1706,7 @@ class acp_users
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (avatar_process_user($error, $user_row))
|
||||
if (avatar_process_user($error, $user_row, $can_upload))
|
||||
{
|
||||
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_row['user_id']));
|
||||
}
|
||||
|
@ -2284,7 +2284,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
|
||||
/**
|
||||
* Uploading/Changing user avatar
|
||||
*/
|
||||
function avatar_process_user(&$error, $custom_userdata = false)
|
||||
function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
|
||||
{
|
||||
global $config, $phpbb_root_path, $auth, $user, $db;
|
||||
|
||||
@ -2323,7 +2323,10 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
||||
$avatar_select = basename(request_var('avatar_select', ''));
|
||||
|
||||
// Can we upload?
|
||||
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
|
||||
if (is_null($can_upload))
|
||||
{
|
||||
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
|
||||
}
|
||||
|
||||
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
|
||||
{
|
||||
|
@ -572,7 +572,7 @@ class ucp_profile
|
||||
{
|
||||
if (check_form_key('ucp_avatar'))
|
||||
{
|
||||
if (avatar_process_user($error))
|
||||
if (avatar_process_user($error, false, $can_upload))
|
||||
{
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
|
Loading…
x
Reference in New Issue
Block a user