diff options
Diffstat (limited to 'phpBB/includes/ucp')
| -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_profile.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 43 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_zebra.php | 2 | 
6 files changed, 25 insertions, 46 deletions
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_profile.php b/phpBB/includes/ucp/ucp_profile.php index 8ae7acaa11..3f58ce20b4 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -658,10 +658,10 @@ class ucp_profile  							));  						}  					} -				} -				// Replace "error" strings with their real, localised form -				$error = $phpbb_avatar_manager->localize_errors($user, $error); +					// Replace "error" strings with their real, localised form +					$error = $phpbb_avatar_manager->localize_errors($user, $error); +				}  				$avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true); 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 . '  | 
