diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_groups.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_prune.php | 84 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/bbcode.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/functions_acp.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/functions_display.php | 31 | ||||
| -rw-r--r-- | phpBB/includes/functions_module.php | 8 | ||||
| -rw-r--r-- | phpBB/includes/functions_user.php | 15 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 50 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 157 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_groups.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 2 | 
12 files changed, 195 insertions, 170 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index c170c67d49..b36ea1a8d8 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -325,6 +325,10 @@ class acp_groups  					// This is normalised data, without the group_ prefix  					$avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); +					if (!isset($avatar_data['id'])) +					{ +						$avatar_data['id'] = 'g' . $group_id; +					}  				} @@ -379,7 +383,7 @@ class acp_groups  						}  						else  						{ -							$driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']); +							$driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']);  							if ($driver)  							{  								$driver->delete($avatar_data); diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 4234ec1505..5d9080b55b 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -331,23 +331,30 @@ class acp_prune  			$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';  		} -		$s_group_list = '<option value="0"></option>';  		$sql = 'SELECT group_id, group_name  			FROM ' . GROUPS_TABLE . '  			WHERE group_type <> ' . GROUP_SPECIAL . '  			ORDER BY group_name ASC';  		$result = $db->sql_query($sql); +		$s_group_list = '';  		while ($row = $db->sql_fetchrow($result))  		{  			$s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';  		}  		$db->sql_freeresult($result); +		if ($s_group_list) +		{ +			// Only prepend the "All groups" option if there are groups, +			// otherwise we don't want to display this option at all. +			$s_group_list = '<option value="0">' . $user->lang['PRUNE_USERS_GROUP_NONE'] . '</option>' . $s_group_list; +		} +  		$template->assign_vars(array(  			'U_ACTION'			=> $this->u_action,  			'S_ACTIVE_OPTIONS'	=> $s_find_active_time, -			'S_GROUP_LIST'      => $s_group_list, +			'S_GROUP_LIST'		=> $s_group_list,  			'S_COUNT_OPTIONS'	=> $s_find_count,  			'U_FIND_USERNAME'	=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users'),  		)); @@ -358,12 +365,12 @@ class acp_prune  	*/  	function get_prune_users(&$user_ids, &$usernames)  	{ -		global $user, $db; +		global $user, $db, $request;  		$users_by_name = request_var('users', '', true);  		$users_by_id = request_var('user_ids', array(0));  		$group_id = request_var('group_id', 0); -		$posts_on_queue = request_var('posts_on_queue', 0); +		$posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0);  		if ($users_by_name)  		{ @@ -450,8 +457,8 @@ class acp_prune  			}  		} -		// Protect the admin, do not prune if no options are given... -		if (!$where_sql) +		// If no search criteria were provided, go no further. +		if (!$where_sql && !$group_id && $posts_on_queue === false)  		{  			return;  		} @@ -468,34 +475,40 @@ class acp_prune  		}  		$db->sql_freeresult($result); -		// Do not prune founder members -		$sql = 'SELECT user_id, username -			FROM ' . USERS_TABLE . ' -			WHERE user_id <> ' . ANONYMOUS . ' -				AND user_type <> ' . USER_FOUNDER . " -			$where_sql"; -		$result = $db->sql_query($sql); +		// Protect the admin, do not prune if no options are given... +		if ($where_sql) +		{ +			// Do not prune founder members +			$sql = 'SELECT user_id, username +				FROM ' . USERS_TABLE . ' +				WHERE user_id <> ' . ANONYMOUS . ' +					AND user_type <> ' . USER_FOUNDER . " +				$where_sql"; +			$result = $db->sql_query($sql); -		$user_ids = $usernames = array(); +			$user_ids = $usernames = array(); -		while ($row = $db->sql_fetchrow($result)) -		{ -			// Do not prune bots and the user currently pruning. -			if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) +			while ($row = $db->sql_fetchrow($result))  			{ -				$user_ids[] = $row['user_id']; -				$usernames[$row['user_id']] = $row['username']; +				// Do not prune bots and the user currently pruning. +				if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) +				{ +					$user_ids[] = $row['user_id']; +					$usernames[$row['user_id']] = $row['username']; +				}  			} +			$db->sql_freeresult($result);  		} -		$db->sql_freeresult($result);  		if ($group_id)  		{  			$sql = 'SELECT u.user_id, u.username  				FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u  				WHERE ug.group_id = ' . (int) $group_id . ' -					AND ug.user_pending = 0 -					AND ' . $db->sql_in_set('ug.user_id', $user_ids, false, true) . ' +					AND ug.user_id <> ' . ANONYMOUS . ' +					AND u.user_type <> ' . USER_FOUNDER . ' +					AND ug.user_pending = 0 ' . +					((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '  					AND u.user_id = ug.user_id';  			$result = $db->sql_query($sql); @@ -505,28 +518,39 @@ class acp_prune  			$user_ids = $usernames = array();  			while ($row = $db->sql_fetchrow($result))  			{ -				$user_ids[] = $row['user_id']; -				$usernames[$row['user_id']] = $row['username']; +				// Do not prune bots and the user currently pruning. +				if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) +				{ +					$user_ids[] = $row['user_id']; +					$usernames[$row['user_id']] = $row['username']; +				}  			}  			$db->sql_freeresult($result);  		} -		if ($posts_on_queue) +		if ($posts_on_queue !== false)  		{  			$sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts  				FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u -				WHERE ' . $db->sql_in_set('p.poster_id', $user_ids, false, true) . ' +				WHERE u.user_id <> ' . ANONYMOUS . ' +					AND u.user_type <> ' . USER_FOUNDER . +					((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' +					AND p.post_visibility = ' . ITEM_UNAPPROVED . '  					AND u.user_id = p.poster_id  				GROUP BY p.poster_id  				HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue; -			$result = $db->sql_query($result); +			$result = $db->sql_query($sql);  			// same intersection logic as the above group ID portion  			$user_ids = $usernames = array();  			while ($row = $db->sql_fetchrow($result))  			{ -				$user_ids[] = $row['user_id']; -				$usernames[$row['user_id']] = $row['username']; +				// Do not prune bots and the user currently pruning. +				if ($row['user_id'] != $user->data['user_id'] && !in_array($row['user_id'], $bot_ids)) +				{ +					$user_ids[] = $row['user_id']; +					$usernames[$row['user_id']] = $row['username']; +				}  			}  			$db->sql_freeresult($result);  		} diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fbc1cc1f14..1a7bc2d186 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1775,7 +1775,7 @@ class acp_users  							}  							else  							{ -								$driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type']); +								$driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']);  								if ($driver)  								{  									$driver->delete($avatar_data); diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index c4076a0120..683fbf0fd2 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -362,7 +362,7 @@ class bbcode  						}  						// Replace {L_*} lang strings -						$bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl); +						$bbcode_tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl);  						if (!empty($rowset[$bbcode_id]['second_pass_replace']))  						{ @@ -466,7 +466,7 @@ class bbcode  			'email'					=> array('{EMAIL}'		=> '$1', '{DESCRIPTION}'	=> '$2')  		); -		$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); +		$tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);  		if (!empty($replacements[$tpl_name]))  		{ diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index b9210114ef..cb44ed2794 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -363,7 +363,9 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)  			if ($tpl_type[0] == 'select')  			{ -				$tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>'; +				$size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1; + +				$tpl = '<select id="' . $key . '" name="' . $name . '"' . (($size > 1) ? ' size="' . $size . '"' : '') . '>' . $return . '</select>';  			}  			else  			{ diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f03e4c01d0..0ff842ea6a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1167,7 +1167,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  					if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode)  					{  						$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); -						$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); +						$message = $user->lang['ERR_UNWATCHING']; + +						if (!$request->is_ajax()) +						{ +							$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>'); +						}  						trigger_error($message);  					} @@ -1177,8 +1182,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  					$db->sql_query($sql);  					$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); -					$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />'; -					$message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); +					$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)]; + +					if (!$request->is_ajax()) +					{ +						$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>'); +					}  					meta_refresh(3, $redirect_url);  					trigger_error($message);  				} @@ -1232,7 +1241,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  					if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode)  					{  						$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); -						$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); +						$message = $user->lang['ERR_WATCHING']; + +						if (!$request->is_ajax()) +						{ +							$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>'); +						}  						trigger_error($message);  					} @@ -1243,7 +1257,12 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,  					$db->sql_query($sql);  					$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); -					$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); +					$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)]; + +					if (!$request->is_ajax()) +					{ +						$message .= '<br /><br />' . $user->lang('RETURN_' . strtoupper($mode), '<a href="' . $redirect_url . '">', '</a>'); +					}  					meta_refresh(3, $redirect_url);  					trigger_error($message);  				} @@ -1445,6 +1464,8 @@ function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $php  	}  	$methods = compress::methods(); +	// Sort by preferred type. +	$methods = array_intersect(array('.zip', '.tar.bz2', '.tar.gz', '.tar'), $methods);  	$links = array();  	foreach ($methods as $method) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index dca720c36e..e1259eba12 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -528,12 +528,12 @@ class p_master  			* the style paths for the extension (the ext author can change them  			* if necessary).  			*/ -			$module_dir = explode('_', get_class($this->module)); +			$module_dir = explode('\\', get_class($this->module)); -			// 0 phpbb, 1 ext, 2 vendor, 3 extension name, ... -			if (isset($module_dir[3]) && $module_dir[1] === 'ext') +			// 0 vendor, 1 extension name, ... +			if (isset($module_dir[1]))  			{ -				$module_style_dir = 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/styles'; +				$module_style_dir = 'ext/' . $module_dir[0] . '/' . $module_dir[1] . '/styles';  				if (is_dir($phpbb_root_path . $module_style_dir))  				{ diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 30891c3fb5..dba6d3d6c2 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -213,7 +213,7 @@ function user_add($user_row, $cp_data = false)  		'user_occ'				=> '',  		'user_interests'		=> '',  		'user_avatar'			=> '', -		'user_avatar_type'		=> 0, +		'user_avatar_type'		=> '',  		'user_avatar_width'		=> 0,  		'user_avatar_height'	=> 0,  		'user_new_privmsg'		=> 0, @@ -281,8 +281,9 @@ function user_add($user_row, $cp_data = false)  			include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);  		} +		$cp = new custom_profile();  		$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . -			$db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data)); +			$db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));  		$db->sql_query($sql);  	} @@ -463,7 +464,7 @@ function user_delete($mode, $user_ids, $retain_username = true)  	$added_guest_posts = 0;  	foreach ($user_rows as $user_id => $user_row)  	{ -		if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == AVATAR_UPLOAD) +		if ($user_row['user_avatar'] && $user_row['user_avatar_type'] == 'avatar.driver.upload')  		{  			avatar_delete('user', $user_row);  		} @@ -2314,7 +2315,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow  		{  			$group_id = $db->sql_nextid(); -			if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD) +			if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == 'avatar.driver.upload')  			{  				group_correct_avatar($group_id, $sql_ary['group_avatar']);  			} @@ -2415,7 +2416,7 @@ function avatar_remove_db($avatar_name)  	$sql = 'UPDATE ' . USERS_TABLE . "  		SET user_avatar = '', -		user_avatar_type = 0 +		user_avatar_type = ''  		WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\'';  	$db->sql_query($sql);  } @@ -2825,7 +2826,7 @@ function remove_default_avatar($group_id, $user_ids)  	$sql = 'UPDATE ' . USERS_TABLE . "  		SET user_avatar = '', -			user_avatar_type = 0, +			user_avatar_type = '',  			user_avatar_width = 0,  			user_avatar_height = 0  		WHERE group_id = " . (int) $group_id . " @@ -3083,7 +3084,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal  		'group_colour'			=> 'string',  		'group_rank'			=> 'int',  		'group_avatar'			=> 'string', -		'group_avatar_type'		=> 'int', +		'group_avatar_type'		=> 'string',  		'group_avatar_width'	=> 'int',  		'group_avatar_height'	=> 'int',  	); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 7a22c31248..d9197da07e 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -219,7 +219,7 @@ class mcp_main  */  function lock_unlock($action, $ids)  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;  	if ($action == 'lock' || $action == 'unlock')  	{ @@ -256,6 +256,7 @@ function lock_unlock($action, $ids)  	unset($orig_ids);  	$redirect = request_var('redirect', build_url(array('action', 'quickmod'))); +	$redirect = reapply_sid($redirect);  	$s_hidden_fields = build_hidden_fields(array(  		$sql_id . '_list'	=> $ids, @@ -279,24 +280,22 @@ function lock_unlock($action, $ids)  		}  		$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; -	} -	else -	{ -		confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields); -	} -	$redirect = request_var('redirect', "index.$phpEx"); -	$redirect = reapply_sid($redirect); +		meta_refresh(2, $redirect); +		$message = $user->lang[$success_msg]; -	if (!$success_msg) -	{ -		redirect($redirect); +		if (!$request->is_ajax()) +		{ +			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); +		} +		trigger_error($message);  	}  	else  	{ -		meta_refresh(2, $redirect); -		trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); +		confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields);  	} + +	redirect($redirect);  }  /** @@ -304,7 +303,7 @@ function lock_unlock($action, $ids)  */  function change_topic_type($action, $topic_ids)  { -	global $auth, $user, $db, $phpEx, $phpbb_root_path; +	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;  	switch ($action)  	{ @@ -341,6 +340,7 @@ function change_topic_type($action, $topic_ids)  	}  	$redirect = request_var('redirect', build_url(array('action', 'quickmod'))); +	$redirect = reapply_sid($redirect);  	$s_hidden_fields = array(  		'topic_id_list'	=> $topic_ids, @@ -381,24 +381,22 @@ function change_topic_type($action, $topic_ids)  				add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']);  			}  		} -	} -	else -	{ -		confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields)); -	} -	$redirect = request_var('redirect', "index.$phpEx"); -	$redirect = reapply_sid($redirect); +		meta_refresh(2, $redirect); +		$message = $user->lang[$success_msg]; -	if (!$success_msg) -	{ -		redirect($redirect); +		if (!$request->is_ajax()) +		{ +			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); +		} +		trigger_error($message);  	}  	else  	{ -		meta_refresh(2, $redirect); -		trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); +		confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields));  	} + +	redirect($redirect);  }  /** diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index db461d07fa..0318bc5e15 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -576,6 +576,7 @@ class mcp_queue  		}  		$redirect = $request->variable('redirect', build_url(array('quickmod'))); +		$redirect = reapply_sid($redirect);  		$success_msg = $post_url = '';  		$approve_log = array(); @@ -678,6 +679,28 @@ class mcp_queue  					}  				}  			} + +			meta_refresh(3, $redirect); +			$message = $user->lang[$success_msg]; + +			if ($request->is_ajax()) +			{ +				$json_response = new \phpbb\json_response; +				$json_response->send(array( +					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], +					'MESSAGE_TEXT'		=> $message, +					'REFRESH_DATA'		=> null, +					'visible'			=> true, +				)); +			} +			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); + +			// If approving one post, also give links back to post... +			if (sizeof($post_info) == 1 && $post_url) +			{ +				$message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>'); +			} +			trigger_error($message);  		}  		else  		{ @@ -707,39 +730,7 @@ class mcp_queue  			confirm_box(false, strtoupper($action) . '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');  		} -		$redirect = $request->variable('redirect', "index.$phpEx"); -		$redirect = reapply_sid($redirect); - -		if (!$success_msg) -		{ -			redirect($redirect); -		} -		else -		{ -			meta_refresh(3, $redirect); - -			// If approving one post, also give links back to post... -			$add_message = ''; -			if (sizeof($post_info) == 1 && $post_url) -			{ -				$add_message = '<br /><br />' . sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'); -			} - -			$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . $add_message; - -			if ($request->is_ajax()) -			{ -				$json_response = new \phpbb\json_response; -				$json_response->send(array( -					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], -					'MESSAGE_TEXT'		=> $message, -					'REFRESH_DATA'		=> null, -					'visible'			=> true, -				)); -			} - -			trigger_error($message); -		} +		redirect($redirect);  	}  	/** @@ -762,6 +753,7 @@ class mcp_queue  		}  		$redirect = $request->variable('redirect', build_url(array('quickmod'))); +		$redirect = reapply_sid($redirect);  		$success_msg = $topic_url = '';  		$approve_log = array(); @@ -826,6 +818,28 @@ class mcp_queue  					}  				}  			} + +			meta_refresh(3, $redirect); +			$message = $user->lang[$success_msg]; + +			if ($request->is_ajax()) +			{ +				$json_response = new \phpbb\json_response; +				$json_response->send(array( +					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], +					'MESSAGE_TEXT'		=> $message, +					'REFRESH_DATA'		=> null, +					'visible'			=> true, +				)); +			} +			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); + +			// If approving one topic, also give links back to topic... +			if (sizeof($topic_info) == 1 && $topic_url) +			{ +				$message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>'); +			} +			trigger_error($message);  		}  		else  		{ @@ -855,39 +869,7 @@ class mcp_queue  			confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html');  		} -		$redirect = $request->variable('redirect', "index.$phpEx"); -		$redirect = reapply_sid($redirect); - -		if (!$success_msg) -		{ -			redirect($redirect); -		} -		else -		{ -			meta_refresh(3, $redirect); - -			// If approving one topic, also give links back to topic... -			$add_message = ''; -			if (sizeof($topic_info) == 1 && $topic_url) -			{ -				$add_message = '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $topic_url . '">', '</a>'); -			} - -			$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . $add_message; - -			if ($request->is_ajax()) -			{ -				$json_response = new \phpbb\json_response; -				$json_response->send(array( -					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], -					'MESSAGE_TEXT'		=> $message, -					'REFRESH_DATA'		=> null, -					'visible'			=> true, -				)); -			} - -			trigger_error($message); -		} +		redirect($redirect);  	}  	/** @@ -909,6 +891,7 @@ class mcp_queue  		}  		$redirect = $request->variable('redirect', build_url(array('t', 'mode', 'quickmod')) . "&mode=$mode"); +		$redirect = reapply_sid($redirect);  		$reason = $request->variable('reason', '', true);  		$reason_id = $request->variable('reason_id', 0);  		$success_msg = $additional_msg = ''; @@ -1151,6 +1134,22 @@ class mcp_queue  			{  				$success_msg .= '_DELETED_SUCCESS';  			} + +			meta_refresh(3, $redirect); +			$message = $user->lang[$success_msg]; + +			if ($request->is_ajax()) +			{ +				$json_response = new \phpbb\json_response; +				$json_response->send(array( +					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], +					'MESSAGE_TEXT'		=> $message, +					'REFRESH_DATA'		=> null, +					'visible'			=> false, +				)); +			} +			$message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); +			trigger_error($message);  		}  		else  		{ @@ -1199,30 +1198,6 @@ class mcp_queue  			confirm_box(false, $l_confirm_msg, $s_hidden_fields, $confirm_template);  		} -		$redirect = $request->variable('redirect', "index.$phpEx"); -		$redirect = reapply_sid($redirect); - -		if (!$success_msg) -		{ -			redirect($redirect); -		} -		else -		{ -			$message = $user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'); - -			if ($request->is_ajax()) -			{ -				$json_response = new \phpbb\json_response; -				$json_response->send(array( -					'MESSAGE_TITLE'		=> $user->lang['INFORMATION'], -					'MESSAGE_TEXT'		=> $message, -					'REFRESH_DATA'		=> null, -					'visible'			=> false, -				)); -			} - -			meta_refresh(3, $redirect); -			trigger_error($message); -		} +		redirect($redirect);  	}  } diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 716289eded..7c4bc8f617 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -509,7 +509,7 @@ class ucp_groups  								}  								else  								{ -									if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type'])) +									if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']))  									{  										$driver->delete($avatar_data);  									} diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index f7c6aca9e8..2252b2ea17 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -603,7 +603,7 @@ class ucp_profile  							}  							else  							{ -								if ($driver = $phpbb_avatar_manager->get_driver($user->data['user_avatar_type'])) +								if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']))  								{  									$driver->delete($avatar_data);  								}  | 
