mirror of
https://github.com/phpbb/phpbb.git
synced 2025-10-12 07:24:31 +02:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/9704] Fix minor typo in coding guidelines. [ticket/9690] Add forthcoming Bing Bot to list of recognized bots [ticket/9451] Add optional $can_upload parameter to avatar_process_user(). [ticket/9593] A readme file for unit tests and running unit tests. [ticket/9570] Changed "system" to "guest" timezone in ACP, added explanation. [ticket/9589] Added sample nginx configuration file for phpbb.
This commit is contained in:
@@ -58,7 +58,7 @@ class acp_board
|
||||
'board_disable_msg' => false,
|
||||
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
|
||||
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
|
||||
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
|
||||
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
@@ -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>');
|
||||
|
Reference in New Issue
Block a user