diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_board.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_database.php | 31 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_icons.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_users.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/acp/auth.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/captcha/captcha_gd.php | 15 | ||||
| -rw-r--r-- | phpBB/includes/captcha/captcha_gd_wave.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 27 | ||||
| -rw-r--r-- | phpBB/includes/functions_acp.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/functions_compress.php | 12 | ||||
| -rw-r--r-- | phpBB/includes/functions_content.php | 12 | ||||
| -rw-r--r-- | phpBB/includes/functions_convert.php | 42 | ||||
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_notifications.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 43 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_zebra.php | 2 | 
21 files changed, 133 insertions, 111 deletions
| diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 55459739ca..2282863746 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -748,7 +748,6 @@ class acp_attachments  						}  						$template->assign_vars(array( -							'PHPBB_ROOT_PATH'		=> $phpbb_root_path,  							'IMG_PATH'				=> $img_path,  							'ACTION'				=> $action,  							'GROUP_ID'				=> $group_id, diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 40dca53b76..10fbde8c9b 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -763,8 +763,8 @@ class acp_board  		global $user, $config;  		$act_ary = array( -		  'ACC_DISABLE' => USER_ACTIVATION_DISABLE, -		  'ACC_NONE' => USER_ACTIVATION_NONE, +			'ACC_DISABLE' => USER_ACTIVATION_DISABLE, +			'ACC_NONE' => USER_ACTIVATION_NONE,  		);  		if ($config['email_enable'])  		{ diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index fc08a5fb94..8afc3709b9 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -94,29 +94,29 @@ class acp_database  							case 'mysqli':  							case 'mysql4':  							case 'mysql': -								$extractor = new mysql_extractor($download, $store, $format, $filename, $time); +								$extractor = new mysql_extractor($format, $filename, $time, $download, $store);  							break;  							case 'sqlite': -								$extractor = new sqlite_extractor($download, $store, $format, $filename, $time); +								$extractor = new sqlite_extractor($format, $filename, $time, $download, $store);  							break;  							case 'postgres': -								$extractor = new postgres_extractor($download, $store, $format, $filename, $time); +								$extractor = new postgres_extractor($format, $filename, $time, $download, $store);  							break;  							case 'oracle': -								$extractor = new oracle_extractor($download, $store, $format, $filename, $time); +								$extractor = new oracle_extractor($format, $filename, $time, $download, $store);  							break;  							case 'mssql':  							case 'mssql_odbc':  							case 'mssqlnative': -								$extractor = new mssql_extractor($download, $store, $format, $filename, $time); +								$extractor = new mssql_extractor($format, $filename, $time, $download, $store);  							break;  							case 'firebird': -								$extractor = new firebird_extractor($download, $store, $format, $filename, $time); +								$extractor = new firebird_extractor($format, $filename, $time, $download, $store);  							break;  						} @@ -488,7 +488,7 @@ class base_extractor  	var $format;  	var $run_comp = false; -	function base_extractor($download = false, $store = false, $format, $filename, $time) +	function base_extractor($format, $filename, $time, $download = false, $store = false)  	{  		global $request; @@ -1607,16 +1607,17 @@ class mssql_extractor extends base_extractor  			return;  		} -		$sql = "SELECT * FROM $table_name"; -		$result_fields = $db->sql_query_limit($sql, 1); - -		$row = new result_mssqlnative($result_fields); -		$i_num_fields = $row->num_fields(); +		$sql = "SELECT COLUMN_NAME, DATA_TYPE +			FROM INFORMATION_SCHEMA.COLUMNS +			WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '" . $db->sql_escape($table_name) . "'"; +		$result_fields = $db->sql_query($sql); -		for ($i = 0; $i < $i_num_fields; $i++) +		$i_num_fields = 0; +		while ($row = $db->sql_fetchrow($result_fields))  		{ -			$ary_type[$i] = $row->field_type($i); -			$ary_name[$i] = $row->field_name($i); +			$ary_type[$i_num_fields] = $row['DATA_TYPE']; +			$ary_name[$i_num_fields] = $row['COLUMN_NAME']; +			$i_num_fields++;  		}  		$db->sql_freeresult($result_fields); diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 258aabcc0d..029f4b23c9 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1470,7 +1470,7 @@ class acp_forums  		/**  		* Event when we move content from one forum to another  		* -		* @event core.acp_manage_forums_move_children +		* @event core.acp_manage_forums_move_content  		* @var	int		from_id		If of the current parent forum  		* @var	int		to_id		If of the new parent forum  		* @var	bool	sync		Shall we sync the "to"-forum's data diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 5b23f9c3a0..658be4cc6b 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -307,7 +307,6 @@ class acp_icons  						'IMG_SRC'			=> $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],  						'IMG_PATH'			=> $img_path, -						'PHPBB_ROOT_PATH'	=> $phpbb_root_path,  						'CODE'				=> $default_row['code'],  						'EMOTION'			=> $default_row['emotion'], @@ -480,7 +479,7 @@ class acp_icons  							$icons_updated++;  						} - 					} +					}  				}  				$cache->destroy('_icons'); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 094d84de40..d5492d85a3 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -888,7 +888,11 @@ class acp_styles  	protected function list_style(&$style, $level)  	{  		// Mark row as shown -		if (!empty($style['_shown'])) return; +		if (!empty($style['_shown'])) +		{ +			return; +		} +  		$style['_shown'] = true;  		// Generate template variables diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 8853200ddc..fd9c17f171 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -396,6 +396,9 @@ class acp_users  							{  								if ($config['require_activation'] == USER_ACTIVATION_ADMIN)  								{ +									$phpbb_notifications = $phpbb_container->get('notification_manager'); +									$phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); +  									include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);  									$messenger = new messenger(false); @@ -647,8 +650,8 @@ class acp_users  								while ($row = $db->sql_fetchrow($result))  								{  									if ($topic_id_ary[$row['topic_id']][ITEM_APPROVED] == $row['topic_posts_approved'] -									 && $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved'] -									 && $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted']) +										&& $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved'] +										&& $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted'])  									{  										$move_topic_ary[] = $row['topic_id'];  									} diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index f5f90fb5b8..a023bced0a 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -506,7 +506,7 @@ class auth_admin extends \phpbb\auth\auth  						'FORUM_ID'			=> $forum_id)  					); -					$this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); +					$this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);  					unset($content_array[$ug_id]);  				} @@ -593,7 +593,7 @@ class auth_admin extends \phpbb\auth\auth  						'FORUM_ID'			=> $forum_id)  					); -					$this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); +					$this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, ($mode == 'view'), $show_trace);  				}  				unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]); @@ -1099,7 +1099,7 @@ class auth_admin extends \phpbb\auth\auth  	* Assign category to template  	* used by display_mask()  	*/ -	function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view) +	function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)  	{  		global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container; diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index f58b590c4b..ab45aa9db6 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -26,7 +26,6 @@ class captcha  	var $width = 360;  	var $height = 96; -  	/**  	* Create the image containing $code with a seed of $seed  	*/ @@ -69,7 +68,6 @@ class captcha  			$bounding_boxes[$i] = $box;  		} -   		// Redistribute leftover x-space  		$offset = array();  		for ($i = 0; $i < $code_len; ++$i) @@ -99,12 +97,12 @@ class captcha  				imagedashedline($img, mt_rand($x -3, $x + 3), mt_rand(0, 4), mt_rand($x -3, $x + 3), mt_rand($this->height - 5, $this->height), $current_colour);  			}  		} +  		if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid']))  		{  			$this->wave($img);  		} -		 -		 +  		if ($config['captcha_gd_3d_noise'])  		{  			$xoffset = mt_rand(0,9); @@ -122,11 +120,12 @@ class captcha  				$dimm = $bounding_boxes[$i];  				$xoffset += ($offset[$i] - $dimm[0]);  				$yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]); -	  +  				$noise[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);  				$xoffset += $dimm[2];  			}  		} +  		$xoffset = 5;  		for ($i = 0; $i < $code_len; ++$i)  		{ @@ -137,14 +136,17 @@ class captcha  			$characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);  			$xoffset += $dimm[2];  		} +  		if ($config['captcha_gd_wave'])  		{  			$this->wave($img);  		} +  		if ($config['captcha_gd_foreground_noise'])  		{  			$this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours);  		} +  		// Send image  		header('Content-Type: image/png');  		header('Cache-control: no-cache, no-store'); @@ -233,7 +235,6 @@ class captcha  		imagesetthickness($img, 1);  	} -  	function captcha_noise_bg_bitmaps()  	{		  		return array( @@ -292,7 +293,7 @@ class captcha  			),  		));  	} -	 +  	/**  	* Return bitmaps  	*/ diff --git a/phpBB/includes/captcha/captcha_gd_wave.php b/phpBB/includes/captcha/captcha_gd_wave.php index e19f54f777..185352dd4e 100644 --- a/phpBB/includes/captcha/captcha_gd_wave.php +++ b/phpBB/includes/captcha/captcha_gd_wave.php @@ -86,7 +86,7 @@ class captcha  		$fontcolors[0] = imagecolorallocate($img, mt_rand(0, 120), mt_rand(0, 120), mt_rand(0, 120)); - 		$colors = array(); +		$colors = array();  		$minr = mt_rand(20, 30);  		$ming = mt_rand(20, 30); @@ -184,7 +184,7 @@ class captcha  			for ($x = 1; $x <= $full_x; ++$x)  			{ -				$cur_height		= $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, 1, $x_grid, $y_grid); +				$cur_height		= $this->wave_height($x, $y, $subdivision_factor) + $this->grid_height($x, $y, $x_grid, $y_grid, 1);  				// height is a z-factor, not a y-factor  				$offset			= $cur_height - $prev_height; @@ -264,7 +264,7 @@ class captcha  		return ((sin($x / (3 * $factor)) + sin($y / (3 * $factor))) * 10 * $tweak);  	} -	function grid_height($x, $y, $factor = 1, $x_grid, $y_grid) +	function grid_height($x, $y, $x_grid, $y_grid, $factor = 1)  	{  		return ((!($x % ($x_grid * $factor)) || !($y % ($y_grid * $factor))) ? 3 : 0);  	} diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ad5e3c05ce..35fa785616 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1318,18 +1318,12 @@ function phpbb_timezone_select($user, $default = '', $truncate = false)  			$tz_dates .= '<option value="' . $timezone['offest'] . ' - ' . $timezone['current'] . '"' . $selected . '>' . $timezone['offest'] . ' - ' . $timezone['current'] . '</option>';  		} -		if (isset($user->lang['timezones'][$timezone['tz']])) +		$label = $timezone['tz']; +		if (isset($user->lang['timezones'][$label]))  		{ -			$title = $label = $user->lang['timezones'][$timezone['tz']]; -		} -		else -		{ -			// No label, we'll figure one out -			$bits = explode('/', str_replace('_', ' ', $timezone['tz'])); - -			$label = implode(' - ', $bits); -			$title = $timezone['offest'] . ' - ' . $label; +			$label = $user->lang['timezones'][$label];  		} +		$title = $timezone['offest'] . ' - ' . $label;  		if ($truncate)  		{ @@ -1478,7 +1472,6 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $  			$sql = 'SELECT forum_id  				FROM ' . FORUMS_TRACK_TABLE . "  				WHERE user_id = {$user->data['user_id']} -					AND mark_time < $post_time  					AND " . $db->sql_in_set('forum_id', $forum_id);  			$result = $db->sql_query($sql); @@ -5597,14 +5590,14 @@ function garbage_collection()  	global $cache, $db;  	global $phpbb_dispatcher; -	/** -	* Unload some objects, to free some memory, before we finish our task -	* -	* @event core.garbage_collection -	* @since 3.1-A1 -	*/  	if (!empty($phpbb_dispatcher))  	{ +		/** +		* Unload some objects, to free some memory, before we finish our task +		* +		* @event core.garbage_collection +		* @since 3.1-A1 +		*/  		$phpbb_dispatcher->dispatch('core.garbage_collection');  	} diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index c83bc1f7a6..b9210114ef 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -67,7 +67,8 @@ function adm_page_header($page_title)  		'SID'					=> $SID,  		'_SID'					=> $_SID,  		'SESSION_ID'			=> $user->session_id, -		'ROOT_PATH'				=> $phpbb_admin_path, +		'ROOT_PATH'				=> $phpbb_root_path, +		'ADMIN_ROOT_PATH'		=> $phpbb_admin_path,  		'U_LOGOUT'				=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),  		'U_ADM_LOGOUT'			=> append_sid("{$phpbb_admin_path}index.$phpEx", 'action=admlogout'), diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index c79a31930e..39a1b2ad21 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -46,7 +46,7 @@ class compress  		if (is_file($phpbb_root_path . $src))  		{ -			$this->data($src_path, file_get_contents("$phpbb_root_path$src"), false, stat("$phpbb_root_path$src")); +			$this->data($src_path, file_get_contents("$phpbb_root_path$src"), stat("$phpbb_root_path$src"), false);  		}  		else if (is_dir($phpbb_root_path . $src))  		{ @@ -86,7 +86,7 @@ class compress  						continue;  					} -					$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file")); +					$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), stat("$phpbb_root_path$src$path$file"), false);  				}  			}  		} @@ -109,7 +109,7 @@ class compress  			return false;  		} -		$this->data($filename, file_get_contents($src), false, stat($src)); +		$this->data($filename, file_get_contents($src), stat($src), false);  		return true;  	} @@ -123,7 +123,7 @@ class compress  		$stat[4] = $stat[5] = 0;  		$stat[7] = strlen($src);  		$stat[9] = time(); -		$this->data($name, $src, false, $stat); +		$this->data($name, $src, $stat, false);  		return true;  	} @@ -395,7 +395,7 @@ class compress_zip extends compress  	/**  	* Create the structures ... note we assume version made by is MSDOS  	*/ -	function data($name, $data, $is_dir = false, $stat) +	function data($name, $data, $stat, $is_dir = false)  	{  		$name = str_replace('\\', '/', $name);  		$name = $this->unique_filename($name); @@ -669,7 +669,7 @@ class compress_tar extends compress  	/**  	* Create the structures  	*/ -	function data($name, $data, $is_dir = false, $stat) +	function data($name, $data, $stat, $is_dir = false)  	{  		$name = $this->unique_filename($name);  		$this->wrote = true; diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index c5347ef262..8122b87e4b 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -481,6 +481,16 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text  * For parsing custom parsed text to be stored within the database.  * This function additionally returns the uid and bitfield that needs to be stored.  * Expects $text to be the value directly from request_var() and in it's non-parsed form +*  +* @param string $text The text to be replaced with the parsed one +* @param string $uid The BBCode uid for this parse +* @param string $bitfield The BBCode bitfield for this parse +* @param int $flags The allow_bbcode, allow_urls and allow_smilies compiled into a single integer. +* @param bool $allow_bbcode If BBCode is allowed (i.e. if BBCode is parsed) +* @param bool $allow_urls If urls is allowed +* @param bool $allow_smilies If smilies are allowed +* +* @return array	An array of string with the errors that occurred while parsing  */  function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)  { @@ -542,7 +552,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb  	$vars = array('text', 'uid', 'bitfield', 'flags');  	extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars))); -	return; +	return $message_parser->warn_msg;  }  /** diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index a34a193f60..3eeecd038d 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -823,7 +823,7 @@ function get_avatar_dim($src, $axis, $func = false, $arg1 = false, $arg2 = false  		break;  		case AVATAR_REMOTE: -			 // see notes on this functions usage and (hopefully) model $func to avoid this accordingly +			// see notes on this functions usage and (hopefully) model $func to avoid this accordingly  			return get_remote_avatar_dim($src, $axis);  		break; @@ -1117,7 +1117,7 @@ function words_unique(&$words)  * Adds a user to the specified group and optionally makes them a group leader  * This function does not create the group if it does not exist and so should only be called after the groups have been created  */ -function add_user_group($group_id, $user_id, $group_leader=false) +function add_user_group($group_id, $user_id, $group_leader = false)  {  	global $convert, $phpbb_root_path, $config, $user, $db; @@ -1297,7 +1297,7 @@ function restore_config($schema)  				$src_ary = $schema['array_name'];  				$config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';  			} -   		} +		}  		if ($config_value !== '')  		{ @@ -1719,7 +1719,7 @@ function add_default_groups()  		'GUESTS'			=> array('', 0, 0),  		'REGISTERED'		=> array('', 0, 0),  		'REGISTERED_COPPA'	=> array('', 0, 0), -		'GLOBAL_MODERATORS'	=> array('00AA00', 1, 0), +		'GLOBAL_MODERATORS'	=> array('00AA00', 2, 0),  		'ADMINISTRATORS'	=> array('AA0000', 1, 1),  		'BOTS'				=> array('9E8DA7', 0, 0),  		'NEWLY_REGISTERED'		=> array('', 0, 0), @@ -1748,7 +1748,7 @@ function add_default_groups()  			'group_type'			=> GROUP_SPECIAL,  			'group_colour'			=> (string) $data[0],  			'group_legend'			=> (int) $data[1], -			'group_founder_manage'	=> (int) $data[2] +			'group_founder_manage'	=> (int) $data[2],  		);  	} @@ -1758,6 +1758,38 @@ function add_default_groups()  	}  } +function add_groups_to_teampage() +{ +	global $db; + +	$teampage_groups = array( +		'ADMINISTRATORS'	=> 1, +		'GLOBAL_MODERATORS'	=> 2, +	); + +	$sql = 'SELECT * +		FROM ' . GROUPS_TABLE . ' +		WHERE ' . $db->sql_in_set('group_name', array_keys($teampage_groups)); +	$result = $db->sql_query($sql); + +	$teampage_ary = array(); +	while ($row = $db->sql_fetchrow($result)) +	{ +		$teampage_ary[] = array( +			'group_id'				=> (int) $row['group_id'], +			'teampage_name'			=> '', +			'teampage_position'		=> (int) $teampage_groups[$row['group_name']], +			'teampage_parent'		=> 0, +		); +	} +	$db->sql_freeresult($result); + +	if (sizeof($teampage_ary)) +	{ +		$db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_ary); +	} +} +  /**  * Sync post count. We might need to do this in batches. diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 5b343e616e..6ceeb50330 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1414,7 +1414,7 @@ class smtp_class  		$result = false;  		$stream_meta = stream_get_meta_data($this->socket); -		if (socket_set_blocking($this->socket, 1)); +		if (socket_set_blocking($this->socket, 1))  		{  			$result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);  			socket_set_blocking($this->socket, (int) $stream_meta['blocked']); diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 898dacd831..2a94acbe02 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -27,7 +27,7 @@ class ucp_activate  	function main($id, $mode)  	{  		global $config, $phpbb_root_path, $phpEx; -		global $db, $user, $auth, $template; +		global $db, $user, $auth, $template, $phpbb_container;  		$user_id = request_var('u', 0);  		$key = request_var('k', ''); @@ -108,6 +108,9 @@ class ucp_activate  		if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)  		{ +			$phpbb_notifications = $phpbb_container->get('notification_manager'); +			$phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); +  			include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);  			$messenger = new messenger(false); diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 145963837c..5a896c31b0 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -78,9 +78,9 @@ class ucp_notifications  					trigger_error($message);  				} -				$this->output_notification_methods('notification_methods', $phpbb_notifications, $template, $user); +				$this->output_notification_methods($phpbb_notifications, $template, $user, 'notification_methods'); -				$this->output_notification_types($subscriptions, 'notification_types', $phpbb_notifications, $template, $user); +				$this->output_notification_types($subscriptions, $phpbb_notifications, $template, $user, 'notification_types');  				$this->tpl_name = 'ucp_notifications';  				$this->page_title = 'UCP_NOTIFICATION_OPTIONS'; @@ -162,12 +162,13 @@ class ucp_notifications  	/**  	* Output all the notification types to the template  	* -	* @param string $block +	* @param array $subscriptions Array containing global subscriptions  	* @param \phpbb\notification\manager $phpbb_notifications  	* @param \phpbb\template\template $template  	* @param \phpbb\user $user +	* @param string $block  	*/ -	public function output_notification_types($subscriptions, $block = 'notification_types', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user) +	public function output_notification_types($subscriptions, \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_types')  	{  		$notification_methods = $phpbb_notifications->get_subscription_methods(); @@ -209,12 +210,12 @@ class ucp_notifications  	/**  	* Output all the notification methods to the template  	* -	* @param string $block  	* @param \phpbb\notification\manager $phpbb_notifications  	* @param \phpbb\template\template $template  	* @param \phpbb\user $user +	* @param string $block  	*/ -	public function output_notification_methods($block = 'notification_methods', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user) +	public function output_notification_methods(\phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_methods')  	{  		$notification_methods = $phpbb_notifications->get_subscription_methods(); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 625da23736..9393e65f3c 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -269,7 +269,7 @@ function view_folder($id, $mode, $folder_id, $folder)  				// There is the chance that all recipients of the message got deleted. To avoid creating  				// exports without recipients, we add a bogus "undisclosed recipient".  				if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && -				    !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u']))) +					!(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))  				{  					$address[$message_id]['u'] = array();  					$address[$message_id]['u']['to'] = array(); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 1f9ab23326..1641c6eef1 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -379,41 +379,16 @@ class ucp_register  					}  					$messenger->send(NOTIFY_EMAIL); +				} -					if ($config['require_activation'] == USER_ACTIVATION_ADMIN) -					{ -						// Grab an array of user_id's with a_user permissions ... these users can activate a user -						$admin_ary = $auth->acl_get_list(false, 'a_user', false); -						$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); - -						// Also include founders -						$where_sql = ' WHERE user_type = ' . USER_FOUNDER; - -						if (sizeof($admin_ary)) -						{ -							$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); -						} - -						$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type -							FROM ' . USERS_TABLE . ' ' . -							$where_sql; -						$result = $db->sql_query($sql); - -						while ($row = $db->sql_fetchrow($result)) -						{ -							$messenger->template('admin_activate', $row['user_lang']); -							$messenger->set_addresses($row); - -							$messenger->assign_vars(array( -								'USERNAME'			=> htmlspecialchars_decode($data['username']), -								'U_USER_DETAILS'	=> "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id", -								'U_ACTIVATE'		=> "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") -							); - -							$messenger->send($row['user_notify_type']); -						} -						$db->sql_freeresult($result); -					} +				if ($config['require_activation'] == USER_ACTIVATION_ADMIN) +				{ +					$phpbb_notifications = $phpbb_container->get('notification_manager'); +					$phpbb_notifications->add_notifications('admin_activate_user', array( +						'user_id'		=> $user_id, +						'user_actkey'	=> $user_row['user_actkey'], +						'user_regdate'	=> $user_row['user_regdate'], +					));  				}  				// Perform account linking if necessary diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 6bb3cdc145..090f9bf34c 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -64,7 +64,7 @@ class ucp_zebra  						* @var	array	user_ids	User ids we remove  						* @since 3.1-A1  						*/ -						$vars = array('user_ids'); +						$vars = array('mode', 'user_ids');  						extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));  						$sql = 'DELETE FROM ' . ZEBRA_TABLE . ' | 
