diff options
author | vdigital <vdigital@piwigo.org> | 2006-12-09 08:57:43 +0000 |
---|---|---|
committer | vdigital <vdigital@piwigo.org> | 2006-12-09 08:57:43 +0000 |
commit | 51b13edc9d726661b51d73de1f92d0a0ff0bc11f (patch) | |
tree | 94330fcfa94fcc45dcb60ca93c2093ceca9bbfd7 | |
parent | 262ee7d11954930a47a8cf359be91c554de36db8 (diff) |
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
-rw-r--r-- | comments.php | 9 |
1 files changed, 9 insertions, 0 deletions
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'] != '') { |