From 9c7109d59e8d603208da0fcae3060d731f09ea42 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 3 Nov 2009 15:03:14 +0000 Subject: [PATCH] This is not perfect... i know, but at least it gives out more information than a simple "this topic/post does not exist". ;) Related to r9971 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10253 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index 1c7cd95b81..f5d1346865 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -95,8 +95,8 @@ switch ($mode) FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE t.topic_id = $topic_id AND (f.forum_id = t.forum_id - OR f.forum_id = $forum_id) - AND t.topic_approved = 1"; + OR f.forum_id = $forum_id)" . + (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1'); break; case 'quote': @@ -125,7 +125,7 @@ switch ($mode) AND u.user_id = p.poster_id AND (f.forum_id = t.forum_id OR f.forum_id = $forum_id)" . - (($auth->acl_get('m_approve', $forum_id) && $mode != 'quote') ? '' : 'AND p.post_approved = 1'); + (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1'); break; case 'smilies': @@ -171,6 +171,13 @@ if (!$post_data) trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST'); } +// Not able to reply to unapproved posts/topics +// TODO: add more descriptive language key +if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved']))) +{ + trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED'); +} + if ($mode == 'popup') { upload_popup($post_data['forum_style']);