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
This commit is contained in:
Will Rossiter 2009-09-04 02:30:09 +00:00
parent d60fc2fdce
commit 13a1409bc6

View File

@ -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 {
}
?>
?>