diff options
Diffstat (limited to 'phpBB/includes/mcp')
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_ban.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_logs.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_main.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_notes.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_pm_reports.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_queue.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_reports.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/info/mcp_warn.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_ban.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 10 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 10 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 25 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_notes.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_pm_reports.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 10 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 93 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 23 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 10 | ||||
| -rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 133 | 
20 files changed, 322 insertions, 142 deletions
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php index a3a1e0ef9a..4aedbc8558 100644 --- a/phpBB/includes/mcp/info/mcp_ban.php +++ b/phpBB/includes/mcp/info/mcp_ban.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_ban_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php index fc30a600c0..c6482c1255 100644 --- a/phpBB/includes/mcp/info/mcp_logs.php +++ b/phpBB/includes/mcp/info/mcp_logs.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_logs_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php index 705715cbeb..81ccdbd1cd 100644 --- a/phpBB/includes/mcp/info/mcp_main.php +++ b/phpBB/includes/mcp/info/mcp_main.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_main_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php index a77b461bbd..4b8c255fe2 100644 --- a/phpBB/includes/mcp/info/mcp_notes.php +++ b/phpBB/includes/mcp/info/mcp_notes.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_notes_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php index d530a917cb..8670b71084 100644 --- a/phpBB/includes/mcp/info/mcp_pm_reports.php +++ b/phpBB/includes/mcp/info/mcp_pm_reports.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_pm_reports_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php index 68cac5abd2..556c3902b0 100644 --- a/phpBB/includes/mcp/info/mcp_queue.php +++ b/phpBB/includes/mcp/info/mcp_queue.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_queue_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php index cb6962a1d5..31fee19d79 100644 --- a/phpBB/includes/mcp/info/mcp_reports.php +++ b/phpBB/includes/mcp/info/mcp_reports.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_reports_info  {  	function module() diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php index d5ac1eedbf..d85499f280 100644 --- a/phpBB/includes/mcp/info/mcp_warn.php +++ b/phpBB/includes/mcp/info/mcp_warn.php @@ -1,15 +1,16 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ -/** -* @package module_install -*/  class mcp_warn_info  {  	function module() diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 925d0878fc..d9ee53fe30 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -15,9 +19,6 @@ if (!defined('IN_PHPBB'))  	exit;  } -/** -* @package mcp -*/  class mcp_ban  {  	var $u_action; diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index b4f7f4d70a..8d2d70bd3b 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index aee43c471d..04206a6fcd 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index be4f7c5650..a0c1bc02ec 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_logs  * Handling warning the users -* @package mcp  */  class mcp_logs  { diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 6b2e9266b3..9d1afb7dc5 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_main  * Handling mcp actions -* @package mcp  */  class mcp_main  { @@ -120,7 +123,7 @@ class mcp_main  					trigger_error('NO_TOPIC_SELECTED');  				} -				mcp_delete_topic($topic_ids, $soft_delete, ($soft_delete) ? $request->variable('delete_reason', '', true) : ''); +				mcp_delete_topic($topic_ids, $soft_delete, $request->variable('delete_reason', '', true));  			break;  			case 'delete_post': @@ -137,7 +140,7 @@ class mcp_main  					trigger_error('NO_POST_SELECTED');  				} -				mcp_delete_post($post_ids, $soft_delete, ($soft_delete) ? $request->variable('delete_reason', '', true) : ''); +				mcp_delete_post($post_ids, $soft_delete, $request->variable('delete_reason', '', true));  			break;  			case 'restore_topic': @@ -784,12 +787,12 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''  					$return = $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), $soft_delete_reason);  					if (!empty($return))  					{ -						add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); +						add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);  					}  				}  				else  				{ -					add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); +					add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);  				}  			}  		} @@ -823,7 +826,6 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''  			'S_TOPIC_MODE'			=> true,  			'S_ALLOWED_DELETE'		=> $auth->acl_get('m_delete', $forum_id),  			'S_ALLOWED_SOFTDELETE'	=> $auth->acl_get('m_softdelete', $forum_id), -			'S_DELETE_REASON'		=> $auth->acl_get('m_softdelete', $forum_id),  		));  		$l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS'; @@ -944,7 +946,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  		foreach ($approve_log as $row)  		{  			$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; -			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username); +			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);  		}  		$topic_id = $request->variable('t', 0); @@ -987,7 +989,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  		foreach ($post_data as $id => $row)  		{  			$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; -			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username); +			add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);  		}  		// Now delete the posts, topics and forums are automatically resync'ed @@ -1060,7 +1062,6 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',  			'S_SOFTDELETED'			=> $only_softdeleted,  			'S_ALLOWED_DELETE'		=> $auth->acl_get('m_delete', $forum_id),  			'S_ALLOWED_SOFTDELETE'	=> $auth->acl_get('m_softdelete', $forum_id), -			'S_DELETE_REASON'		=> $auth->acl_get('m_softdelete', $forum_id),  		));  		$l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS'; diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index be8e09b0c3..465ee63a98 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_notes  * Displays notes about a user -* @package mcp  */  class mcp_notes  { diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index b0a06dd6ce..7e39c157c1 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_reports  * Handling the reports queue -* @package mcp  */  class mcp_pm_reports  { diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 5925575577..d2cc5d285e 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index a71bc997e9..5dd39dbf0f 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_queue  * Handling the moderation queue -* @package mcp  */  class mcp_queue  { @@ -578,6 +581,7 @@ class mcp_queue  		$redirect = reapply_sid($redirect);  		$success_msg = $post_url = '';  		$approve_log = array(); +		$num_topics = 0;  		$s_hidden_fields = build_hidden_fields(array(  			'i'				=> $id, @@ -634,11 +638,6 @@ class mcp_queue  				$phpbb_content_visibility->set_post_visibility(ITEM_APPROVED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '', isset($topic_data['first_post']), isset($topic_data['last_post']));  			} -			if (sizeof($post_info) >= 1) -			{ -				$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS'; -			} -  			foreach ($approve_log as $log_data)  			{  				add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_POST_' . strtoupper($action) . 'D', $log_data['post_subject']); @@ -656,21 +655,32 @@ class mcp_queue  					if (!$post_data['topic_posts_approved'])  					{  						$phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']); +						 +						if ($post_data['post_visibility'] == ITEM_UNAPPROVED) +						{ +							$phpbb_notifications->add_notifications(array('topic'), $post_data); +						} +						if ($post_data['post_visibility'] != ITEM_APPROVED) +						{ +							$num_topics++; +						}  					} -					$phpbb_notifications->delete_notifications('post_in_queue', $post_id); - -					// Only add notifications, if we are not reapproving post -					// When the topic was already approved, but was edited and -					// now needs re-approval, we don't want to notify the users -					// again. -					if ($post_data['post_visibility'] == ITEM_UNAPPROVED) +					else  					{ -						$phpbb_notifications->add_notifications(array( -							'quote', -							'bookmark', -							'post', -						), $post_data); +						// Only add notifications, if we are not reapproving post +						// When the topic was already approved, but was edited and +						// now needs re-approval, we don't want to notify the users +						// again. +						if ($post_data['post_visibility'] == ITEM_UNAPPROVED) +						{ +							$phpbb_notifications->add_notifications(array( +								'bookmark', +								'post', +							), $post_data); +						}  					} +					$phpbb_notifications->add_notifications(array('quote'), $post_data); +					$phpbb_notifications->delete_notifications('post_in_queue', $post_id);  					$phpbb_notifications->mark_notifications_read(array(  						'quote', @@ -686,11 +696,27 @@ class mcp_queue  							continue;  						} -						$phpbb_notifications->add_notifications('approve_post', $post_data); +						if (!$post_data['topic_posts_approved']) +						{ +							$phpbb_notifications->add_notifications('approve_post', $post_data); +						} +						else +						{ +							$phpbb_notifications->add_notifications('approve_topic', $post_data); +						}  					}  				}  			} +			if ($num_topics >= 1) +			{ +				$success_msg = ($num_topics == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS'; +			} +			else +			{ +				$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS'; +			} +  			meta_refresh(3, $redirect);  			$message = $user->lang[$success_msg]; @@ -721,14 +747,14 @@ class mcp_queue  			{  				foreach ($post_info as $post_data)  				{ -					if ($post_data['poster_id'] == ANONYMOUS) +					if (!$post_data['topic_posts_approved'])  					{ -						continue; +						$num_topics++;  					} -					else + +					if (!$show_notify && $post_data['poster_id'] != ANONYMOUS)  					{  						$show_notify = true; -						break;  					}  				}  			} @@ -738,7 +764,18 @@ class mcp_queue  				'S_' . strtoupper($action)	=> true,  			)); -			confirm_box(false, strtoupper($action) . '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); +			// Create the confirm box message +			$action_msg = strtoupper($action); +			$num_posts = sizeof($post_id_list) - $num_topics; +			if ($num_topics > 0 && $num_posts <= 0) +			{ +				$action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S'); +			} +			else +			{ +				$action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'); +			} +			confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html');  		}  		redirect($redirect); @@ -834,7 +871,7 @@ class mcp_queue  						'post_subject'	=> $topic_data['topic_title'],  						'post_time'		=> $topic_data['topic_time'],  						'poster_id'		=> $topic_data['topic_poster'], -						'username'		=> $topic_data['topic_first_poster_name'], +						'post_username'	=> $topic_data['topic_first_poster_name'],  					));  					$phpbb_notifications->delete_notifications('topic_in_queue', $topic_id); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 5681b83212..f045fd018f 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_reports  * Handling the reports queue -* @package mcp  */  class mcp_reports  { @@ -143,6 +146,13 @@ class mcp_reports  				}  				$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false; +				$message = generate_text_for_display( +					$report['reported_post_text'], +					$report['reported_post_uid'], +					$report['reported_post_bitfield'], +					$parse_post_flags, +					false +				);  				$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text'])); @@ -152,6 +162,7 @@ class mcp_reports  						FROM ' . ATTACHMENTS_TABLE . '  						WHERE post_msg_id = ' . $post_id . '  							AND in_message = 0 +							AND filetime <= ' . (int) $report['report_time'] . '  						ORDER BY filetime DESC';  					$result = $db->sql_query($sql); @@ -164,7 +175,7 @@ class mcp_reports  					if (sizeof($attachments))  					{  						$update_count = array(); -						parse_attachments($post_info['forum_id'], $report['reported_post_text'], $attachments, $update_count); +						parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);  					}  					// Display not already displayed Attachments for this post, we already parsed them. ;) @@ -224,7 +235,7 @@ class mcp_reports  					'REPORTER_NAME'				=> get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),  					'U_VIEW_REPORTER_PROFILE'	=> get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), -					'POST_PREVIEW'			=> generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], $parse_post_flags, false), +					'POST_PREVIEW'			=> $message,  					'POST_SUBJECT'			=> ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],  					'POST_DATE'				=> $user->format_date($post_info['post_time']),  					'POST_IP'				=> $post_info['poster_ip'], diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 48efa330d4..51802f1e4d 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 4275182d26..fb47522644 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -1,9 +1,13 @@  <?php  /**  * -* @package mcp -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file.  *  */ @@ -18,7 +22,6 @@ if (!defined('IN_PHPBB'))  /**  * mcp_warn  * Handling warning the users -* @package mcp  */  class mcp_warn  { @@ -187,7 +190,7 @@ class mcp_warn  	function mcp_warn_post_view($action)  	{  		global $phpEx, $phpbb_root_path, $config; -		global $template, $db, $user, $auth; +		global $template, $db, $user, $auth, $phpbb_dispatcher;  		$post_id = request_var('p', 0);  		$forum_id = request_var('f', 0); @@ -264,16 +267,65 @@ class mcp_warn  		{  			if (check_form_key('mcp_warn'))  			{ -				add_warning($user_row, $warning, $notify, $post_id); -				$msg = $user->lang['USER_WARNING_ADDED']; +				$s_mcp_warn_post = true; + +				/** +				* Event for before warning a user for a post. +				* +				* @event core.mcp_warn_post_before +				* @var array	user_row		The entire user row +				* @var string	warning			The warning message +				* @var bool		notify			If true, we notify the user for the warning +				* @var int		post_id			The post id for which the warning is added +				* @var bool		s_mcp_warn_post If true, we add the warning else we omit it +				* @since 3.1.0-b4 +				*/ +				$vars = array( +						'user_row', +						'warning', +						'notify', +						'post_id', +						's_mcp_warn_post', +				); +				extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_before', compact($vars))); + +				if ($s_mcp_warn_post) +				{ +					add_warning($user_row, $warning, $notify, $post_id); +					$message = $user->lang['USER_WARNING_ADDED']; + +					/** +					* Event for after warning a user for a post. +					* +					* @event core.mcp_warn_post_after +					* @var array	user_row	The entire user row +					* @var string	warning		The warning message +					* @var bool		notify		If true, the user was notified for the warning +					* @var int		post_id		The post id for which the warning is added +					* @var string	message		Message displayed to the moderator +					* @since 3.1.0-b4 +					*/ +					$vars = array( +							'user_row', +							'warning', +							'notify', +							'post_id', +							'message', +					); +					extract($phpbb_dispatcher->trigger_event('core.mcp_warn_post_after', compact($vars))); +				}  			}  			else  			{ -				$msg = $user->lang['FORM_INVALID']; +				$message = $user->lang['FORM_INVALID']; +			} + +			if (!empty($message)) +			{ +				$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); +				meta_refresh(2, $redirect); +				trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));  			} -			$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); -			meta_refresh(2, $redirect); -			trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));  		}  		// OK, they didn't submit a warning so lets build the page for them to do so @@ -318,7 +370,7 @@ class mcp_warn  	function mcp_warn_user_view($action)  	{  		global $phpEx, $phpbb_root_path, $config, $module; -		global $template, $db, $user, $auth; +		global $template, $db, $user, $auth, $phpbb_dispatcher;  		$user_id = request_var('u', 0);  		$username = request_var('username', '', true); @@ -376,16 +428,61 @@ class mcp_warn  		{  			if (check_form_key('mcp_warn'))  			{ -				add_warning($user_row, $warning, $notify); -				$msg = $user->lang['USER_WARNING_ADDED']; +				$s_mcp_warn_user = true; + +				/** +				* Event for before warning a user from MCP. +				* +				* @event core.mcp_warn_user_before +				* @var array	user_row		The entire user row +				* @var string	warning			The warning message +				* @var bool		notify			If true, we notify the user for the warning +				* @var bool		s_mcp_warn_user If true, we add the warning else we omit it +				* @since 3.1.0-b4 +				*/ +				$vars = array( +						'user_row', +						'warning', +						'notify', +						's_mcp_warn_user', +				); +				extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_before', compact($vars))); + +				if ($s_mcp_warn_user) +				{ +					add_warning($user_row, $warning, $notify); +					$message = $user->lang['USER_WARNING_ADDED']; + +					/** +					* Event for after warning a user from MCP. +					* +					* @event core.mcp_warn_user_after +					* @var array	user_row	The entire user row +					* @var string	warning		The warning message +					* @var bool		notify		If true, the user was notified for the warning +					* @var string	message		Message displayed to the moderator +					* @since 3.1.0-b4 +					*/ +					$vars = array( +							'user_row', +							'warning', +							'notify', +							'message', +					); +					extract($phpbb_dispatcher->trigger_event('core.mcp_warn_user_after', compact($vars))); +				}  			}  			else  			{ -				$msg = $user->lang['FORM_INVALID']; +				$message = $user->lang['FORM_INVALID']; +			} + +			if (!empty($message)) +			{ +				$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); +				meta_refresh(2, $redirect); +				trigger_error($message . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));  			} -			$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); -			meta_refresh(2, $redirect); -			trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));  		}  		// Generate the appropriate user information for the user we are looking at  | 
