From 13a1409bc653c76bf5eb48531e4be4f53b3eb75d Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Fri, 4 Sep 2009 02:30:09 +0000 Subject: [PATCH] ENHANCEMENT: hide unmoderated page comments from the page comment RSS feed. Ticket #4477 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85731 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageComment.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/sitefeatures/PageComment.php b/code/sitefeatures/PageComment.php index 34f21ccc..408cc118 100755 --- a/code/sitefeatures/PageComment.php +++ b/code/sitefeatures/PageComment.php @@ -161,7 +161,8 @@ class PageComment extends DataObject { class PageComment_Controller extends Controller { function rss() { $parentcheck = isset($_REQUEST['pageid']) ? "\"ParentID\" = " . (int) $_REQUEST['pageid'] : "\"ParentID\" > 0"; - $comments = DataObject::get("PageComment", "$parentcheck AND NOT \"IsSpam\"", "\"Created\" DESC", "", 10); + $unmoderatedfilter = Permission::check('ADMIN') ? '' : "AND NOT \"NeedsModeration\""; + $comments = DataObject::get("PageComment", "$parentcheck AND NOT \"IsSpam\" $unmoderatedfilter", "\"Created\" DESC", "", 10); if(!isset($comments)) { $comments = new DataObjectSet(); } @@ -281,4 +282,4 @@ class PageComment_Controller extends Controller { } -?> \ No newline at end of file +?>