mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/avatars
Conflicts: phpBB/install/database_update.php
This commit is contained in:
@@ -33,7 +33,7 @@ class mcp_pm_reports
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $auth, $db, $user, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpEx, $action;
|
||||
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
|
||||
@@ -89,6 +89,10 @@ class mcp_pm_reports
|
||||
trigger_error('NO_REPORT');
|
||||
}
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->mark_notifications_read_by_parent('report_pm', $report_id, $user->data['user_id']);
|
||||
|
||||
$pm_id = $report['pm_id'];
|
||||
$report_id = $report['report_id'];
|
||||
|
||||
|
@@ -33,7 +33,7 @@ class mcp_queue
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $auth, $db, $user, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpEx, $action;
|
||||
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
|
||||
@@ -78,12 +78,16 @@ class mcp_queue
|
||||
$post_id = request_var('p', 0);
|
||||
$topic_id = request_var('t', 0);
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
if ($topic_id)
|
||||
{
|
||||
$topic_info = get_topic_data(array($topic_id), 'm_approve');
|
||||
if (isset($topic_info[$topic_id]['topic_first_post_id']))
|
||||
{
|
||||
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
|
||||
|
||||
$phpbb_notifications->mark_notifications_read('topic_in_queue', $topic_id, $user->data['user_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,6 +95,8 @@ class mcp_queue
|
||||
}
|
||||
}
|
||||
|
||||
$phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']);
|
||||
|
||||
$post_info = get_post_data(array($post_id), 'm_approve', true);
|
||||
|
||||
if (!sizeof($post_info))
|
||||
@@ -451,7 +457,7 @@ function approve_post($post_id_list, $id, $mode)
|
||||
{
|
||||
global $db, $template, $user, $config;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
global $request;
|
||||
global $request, $phpbb_container;
|
||||
|
||||
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
|
||||
{
|
||||
@@ -597,54 +603,51 @@ function approve_post($post_id_list, $id, $mode)
|
||||
sync('forum', 'forum_id', array_keys($forum_id_list), true, true);
|
||||
unset($topic_id_list, $forum_id_list);
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
// Notify Poster?
|
||||
if ($notify_poster)
|
||||
{
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_data['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_approved' : 'post_approved';
|
||||
|
||||
$messenger->template($email_template, $post_data['user_lang']);
|
||||
|
||||
$messenger->to($post_data['user_email'], $post_data['username']);
|
||||
$messenger->im($post_data['user_jabber'], $post_data['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($post_data['username']),
|
||||
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
|
||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
|
||||
|
||||
'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
|
||||
'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
|
||||
);
|
||||
|
||||
$messenger->send($post_data['user_notify_type']);
|
||||
}
|
||||
}
|
||||
|
||||
$messenger->save_queue();
|
||||
|
||||
// Send out normal user notifications
|
||||
$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
// Handle notifications
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
|
||||
{
|
||||
// Forum Notifications
|
||||
user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
|
||||
$phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']);
|
||||
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'quote',
|
||||
'topic',
|
||||
), $post_data);
|
||||
|
||||
$phpbb_notifications->mark_notifications_read('quote', $post_data['post_id'], $user->data['user_id']);
|
||||
$phpbb_notifications->mark_notifications_read('topic', $post_data['topic_id'], $user->data['user_id']);
|
||||
|
||||
if ($notify_poster)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('approve_topic', $post_data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Topic Notifications
|
||||
user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
|
||||
$phpbb_notifications->delete_notifications('post_in_queue', $post_id);
|
||||
|
||||
$phpbb_notifications->add_notifications(array(
|
||||
'quote',
|
||||
'bookmark',
|
||||
'post',
|
||||
), $post_data);
|
||||
|
||||
$phpbb_notifications->mark_notifications_read(array(
|
||||
'quote',
|
||||
'bookmark',
|
||||
'post',
|
||||
),$post_data['post_id'], $user->data['user_id']);
|
||||
|
||||
if ($notify_poster)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('approve_post', $post_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,7 +737,7 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
{
|
||||
global $db, $template, $user, $config;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
global $request;
|
||||
global $request, $phpbb_container;
|
||||
|
||||
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
|
||||
{
|
||||
@@ -867,20 +870,29 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
}
|
||||
}
|
||||
|
||||
$messenger = new messenger();
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
|
||||
{
|
||||
$phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpbb_notifications->delete_notifications('post_in_queue', $post_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Notify Poster?
|
||||
if ($notify_poster)
|
||||
{
|
||||
$lang_reasons = array();
|
||||
|
||||
// Handle notifications
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_data['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$post_data['disapprove_reason'] = '';
|
||||
if (isset($disapprove_reason_lang))
|
||||
{
|
||||
// Okay we need to get the reason from the posters language
|
||||
@@ -906,33 +918,30 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
}
|
||||
}
|
||||
|
||||
$email_disapprove_reason = $lang_reasons[$post_data['user_lang']];
|
||||
$email_disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
|
||||
$post_data['disapprove_reason'] = $lang_reasons[$post_data['user_lang']];
|
||||
$post_data['disapprove_reason'] .= ($reason) ? "\n\n" . $reason : '';
|
||||
}
|
||||
|
||||
$email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_disapproved' : 'post_disapproved';
|
||||
|
||||
$messenger->template($email_template, $post_data['user_lang']);
|
||||
|
||||
$messenger->to($post_data['user_email'], $post_data['username']);
|
||||
$messenger->im($post_data['user_jabber'], $post_data['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($post_data['username']),
|
||||
'REASON' => htmlspecialchars_decode($email_disapprove_reason),
|
||||
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
|
||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])))
|
||||
);
|
||||
|
||||
$messenger->send($post_data['user_notify_type']);
|
||||
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
|
||||
{
|
||||
if ($notify_poster)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('disapprove_topic', $post_data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($notify_poster)
|
||||
{
|
||||
$phpbb_notifications->add_notifications('disapprove_post', $post_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($lang_reasons);
|
||||
}
|
||||
unset($post_info, $disapprove_reason, $email_disapprove_reason, $disapprove_reason_lang);
|
||||
|
||||
$messenger->save_queue();
|
||||
|
||||
if ($num_disapproved_topics)
|
||||
{
|
||||
$success_msg = ($num_disapproved_topics == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
|
||||
|
@@ -33,7 +33,7 @@ class mcp_reports
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $auth, $db, $user, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpEx, $action;
|
||||
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
|
||||
|
||||
@@ -87,6 +87,10 @@ class mcp_reports
|
||||
trigger_error('NO_REPORT');
|
||||
}
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->mark_notifications_read('report_post', $post_id, $user->data['user_id']);
|
||||
|
||||
if (!$report_id && $report['report_closed'])
|
||||
{
|
||||
trigger_error('REPORT_CLOSED');
|
||||
@@ -436,7 +440,7 @@ class mcp_reports
|
||||
function close_report($report_id_list, $mode, $action, $pm = false)
|
||||
{
|
||||
global $db, $template, $user, $config, $auth;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
global $phpEx, $phpbb_root_path, $phpbb_container;
|
||||
|
||||
$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
|
||||
$id_column = ($pm) ? 'pm_id' : 'post_id';
|
||||
@@ -622,11 +626,11 @@ function close_report($report_id_list, $mode, $action, $pm = false)
|
||||
}
|
||||
}
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
// Notify reporters
|
||||
if (sizeof($notify_reporters))
|
||||
{
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
foreach ($notify_reporters as $report_id => $reporter)
|
||||
{
|
||||
if ($reporter['user_id'] == ANONYMOUS)
|
||||
@@ -636,30 +640,25 @@ function close_report($report_id_list, $mode, $action, $pm = false)
|
||||
|
||||
$post_id = $reporter[$id_column];
|
||||
|
||||
$messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']);
|
||||
|
||||
$messenger->to($reporter['user_email'], $reporter['username']);
|
||||
$messenger->im($reporter['user_jabber'], $reporter['username']);
|
||||
|
||||
if ($pm)
|
||||
{
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($reporter['username']),
|
||||
'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']),
|
||||
'PM_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])),
|
||||
));
|
||||
$phpbb_notifications->add_notifications('report_pm_closed', array_merge($post_info[$post_id], array(
|
||||
'reporter' => $reporter['user_id'],
|
||||
'closer_id' => $user->data['user_id'],
|
||||
'from_user_id' => $post_info[$post_id]['author_id'],
|
||||
)));
|
||||
|
||||
$phpbb_notifications->delete_notifications('report_pm', $post_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($reporter['username']),
|
||||
'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']),
|
||||
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
|
||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
|
||||
);
|
||||
}
|
||||
$phpbb_notifications->add_notifications('report_post_closed', array_merge($post_info[$post_id], array(
|
||||
'reporter' => $reporter['user_id'],
|
||||
'closer_id' => $user->data['user_id'],
|
||||
)));
|
||||
|
||||
$messenger->send($reporter['user_notify_type']);
|
||||
$phpbb_notifications->delete_notifications('report_post', $post_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,8 +673,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
|
||||
|
||||
unset($notify_reporters, $post_info, $reports);
|
||||
|
||||
$messenger->save_queue();
|
||||
|
||||
$success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user