From 51b13edc9d726661b51d73de1f92d0a0ff0bc11f Mon Sep 17 00:00:00 2001 From: vdigital Date: Sat, 9 Dec 2006 08:57:43 +0000 Subject: 0000597: Unvalidated comments are displayed on public side Just add a comment filter to avoid showing unvalidated comment to non admin people. git-svn-id: http://piwigo.org/svn/trunk@1646 68402e56-0260-453c-a942-63ccdbb3a9ee --- comments.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'comments.php') diff --git a/comments.php b/comments.php index 4d9ca26db..9469cdf6a 100644 --- a/comments.php +++ b/comments.php @@ -299,6 +299,13 @@ else $start = 0; } +// Comments_validation is required and is not admin => Only validated +$comment_fltr = ''; +if ( $conf['comments_validation'] and !is_admin() ) +{ + $comment_fltr = 'AND com.validated = \'true\''; +} + $query = ' SELECT COUNT(DISTINCT(id)) FROM '.IMAGE_CATEGORY_TABLE.' AS ic @@ -308,6 +315,7 @@ SELECT COUNT(DISTINCT(id)) AND '.$page['cat_clause'].' AND '.$page['author_clause'].' AND '.$page['keyword_clause'].' + '.$comment_fltr.' AND '.$page['status_clause']; if ($user['forbidden_categories'] != '') { @@ -354,6 +362,7 @@ SELECT com.id AS comment_id AND '.$page['cat_clause'].' AND '.$page['author_clause'].' AND '.$page['keyword_clause'].' + '.$comment_fltr.' AND '.$page['status_clause']; if ($user['forbidden_categories'] != '') { -- cgit v1.2.3