diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 03ca9994fc..f42101067e 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -426,7 +426,7 @@ function approve_post($post_id_list, $id, $mode)
// If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1
$total_topics = $total_posts = 0;
- $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = array();
+ $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
$update_forum_information = false;
@@ -455,8 +455,14 @@ function approve_post($post_id_list, $id, $mode)
$total_topics++;
$forum_topics_posts[$post_data['forum_id']]['forum_topics']++;
}
-
$topic_approve_sql[] = $post_data['topic_id'];
+
+ $approve_log[] = array(
+ 'type' => 'topic',
+ 'post_subject' => $post_data['post_subject'],
+ 'forum_id' => $post_data['forum_id'],
+ 'topic_id' => $post_data['topic_id'],
+ );
}
else
{
@@ -465,6 +471,13 @@ function approve_post($post_id_list, $id, $mode)
$topic_replies_sql[$post_data['topic_id']] = 0;
}
$topic_replies_sql[$post_data['topic_id']]++;
+
+ $approve_log[] = array(
+ 'type' => 'post',
+ 'post_subject' => $post_data['post_subject'],
+ 'forum_id' => $post_data['forum_id'],
+ 'topic_id' => $post_data['topic_id'],
+ );
}
if ($post_data['forum_id'])
@@ -514,6 +527,11 @@ function approve_post($post_id_list, $id, $mode)
$db->sql_query($sql);
}
+ foreach ($approve_log as $log_data)
+ {
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']);
+ }
+
if (sizeof($topic_replies_sql))
{
foreach ($topic_replies_sql as $topic_id => $num_replies)
@@ -703,7 +721,7 @@ function disapprove_post($post_id_list, $id, $mode)
// If Post -> topic_replies_real -= 1
$num_disapproved = 0;
- $forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = array();
+ $forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = $disapprove_log = array();
foreach ($post_info as $post_id => $post_data)
{
@@ -715,6 +733,9 @@ function disapprove_post($post_id_list, $id, $mode)
}
// Topic or Post. ;)
+ /**
+ * @todo this probably is a different method than the one used by delete_posts, does this cause counter inconsistency?
+ */
if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id)
{
if ($post_data['forum_id'])
@@ -726,6 +747,13 @@ function disapprove_post($post_id_list, $id, $mode)
$forum_topics_real[$post_data['forum_id']]++;
$num_disapproved++;
}
+
+ $disapprove_log[] = array(
+ 'type' => 'topic',
+ 'post_subject' => $post_data['post_subject'],
+ 'forum_id' => $post_data['forum_id'],
+ 'topic_id' => 0, // useless to log a topic id, as it will be deleted
+ );
}
else
{
@@ -734,11 +762,20 @@ function disapprove_post($post_id_list, $id, $mode)
$topic_replies_real_sql[$post_data['topic_id']] = 0;
}
$topic_replies_real_sql[$post_data['topic_id']]++;
+
+ $disapprove_log[] = array(
+ 'type' => 'post',
+ 'post_subject' => $post_data['post_subject'],
+ 'forum_id' => $post_data['forum_id'],
+ 'topic_id' => $post_data['topic_id'],
+ );
}
$post_disapprove_sql[] = $post_id;
}
+ unset($post_data);
+
if (sizeof($forum_topics_real))
{
foreach ($forum_topics_real as $forum_id => $topics_real)
@@ -770,6 +807,11 @@ function disapprove_post($post_id_list, $id, $mode)
// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
delete_posts('post_id', $post_disapprove_sql);
+
+ foreach ($disapprove_log as $log_data)
+ {
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED', $log_data['post_subject'], $disapprove_reason);
+ }
}
unset($post_disapprove_sql, $topic_replies_real_sql);
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 9080dcdc76..267289542c 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -513,6 +513,11 @@ function close_report($report_id_list, $mode, $action)
}
unset($close_report_posts, $close_report_topics);
+ foreach ($reports as $report)
+ {
+ add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+ }
+
$messenger = new messenger();
// Notify reporters
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index c7283fe935..a1c6d8678c 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -463,11 +463,17 @@ $lang = array_merge($lang, array(
'LOG_LOCK_POST' => 'Locked post
» %s',
'LOG_MERGE' => 'Merged posts into topic
» %s',
'LOG_MOVE' => 'Moved topic
» from %s',
+ 'LOG_POST_APPROVED' => 'Approved post
» %s',
+ 'LOG_POST_DISAPPROVED' => 'Disapproved post “%1$s” with the following reason
%2$s',
'LOG_POST_EDITED' => 'Edited post “%1$s” written by “%3$s”
» Link to post: %2$s',
+ 'LOG_REPORT_CLOSED' => 'Closed report
» %s',
+ 'LOG_REPORT_DELETED' => 'Deleted report
» %s',
'LOG_SPLIT_DESTINATION' => 'Moved splitted posts
» to %s',
'LOG_SPLIT_SOURCE' => 'Splitted posts
» from %s',
'LOG_TOPIC_DELETED' => 'Deleted topic
» %s',
+ 'LOG_TOPIC_APPROVED' => 'Approved topic
» %s',
+ 'LOG_TOPIC_DISAPPROVED' => 'Disapproved topic “%1$s” with the following reason
%2$s',
'LOG_TOPIC_RESYNC' => 'Resynchronised topic counters
» %s',
'LOG_TOPIC_TYPE_CHANGED' => 'Changed topic type
» %s',
'LOG_UNLOCK' => 'Unlocked topic
» %s',