aboutsummaryrefslogtreecommitdiffstats
path: root/comments.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-24 20:22:21 +0000
committernikrou <nikrou@piwigo.org>2010-06-24 20:22:21 +0000
commitfb1d1c43d6c098d677eb630de51a0e0a6d24bbf1 (patch)
tree4eadb6ba0f1f0428e10765c1f795cecee60f5b12 /comments.php
parent4b4293ffffb62d8df2191c4626240c3d735fae44 (diff)
Bug 1735 fixed : amend commit 6596
Need to add permissions filter to retrieve categories git-svn-id: http://piwigo.org/svn/trunk@6601 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--comments.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/comments.php b/comments.php
index 2aaeb1fbf..cda791ca6 100644
--- a/comments.php
+++ b/comments.php
@@ -367,7 +367,7 @@ SELECT com.id AS comment_id,
com.content,
com.validated
FROM '.IMAGE_CATEGORY_TABLE.' AS ic
- LEFT JOIN '.COMMENTS_TABLE.' AS com
+ INNER JOIN '.COMMENTS_TABLE.' AS com
ON ic.image_id = com.image_id
LEFT JOIN '.USERS_TABLE.' As u
ON u.'.$conf['user_fields']['id'].' = com.author_id
@@ -418,6 +418,15 @@ SELECT c.id, name, permalink, uppercats, com.id as comment_id
ON c.id=ic.category_id
LEFT JOIN '.COMMENTS_TABLE.' AS com
ON ic.image_id=com.image_id
+ '.get_sql_condition_FandF
+ (
+ array
+ (
+ 'forbidden_categories' => 'c.id',
+ 'visible_categories' => 'c.id'
+ ),
+ 'WHERE'
+ ).'
;';
$categories = hash_from_query($query, 'comment_id');