From: Roan Kattouw Date: Tue, 14 Oct 2008 12:46:11 +0000 (+0000) Subject: (bug 15945) API: Use User::useRCPatrol() and useNPPatrol() rather than isAllowed... X-Git-Tag: 1.31.0-rc.0~44743 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=abd56027c8aa2e5bad40a335d035e3ac6cc16c54;p=lhc%2Fweb%2Fwiklou.git (bug 15945) API: Use User::useRCPatrol() and useNPPatrol() rather than isAllowed('patrol') in list=recentchanges --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b5cf6a145e..bac626d4a8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -325,6 +325,8 @@ The following extensions are migrated into MediaWiki 1.14: manipulation of legacy pages with invalid titles possible * (bug 15881) Empty or invalid parameters cause database errors * The maxage and smaxage parameters are now properly validated +* (bug 15945) list=recentchanges doesn't check $wgUseRCPatrol, $wgUseNPPatrol + and patrolmarks right === Languages updated in 1.14 === diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 81c3680059..6f87dff530 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -67,7 +67,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { public static function getPatrolToken($pageid, $title, $rc) { global $wgUser; - if(!$wgUser->isAllowed('patrol')) + if(!$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) return false; // The patrol token is always the same, let's exploit that @@ -138,7 +138,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { // Check permissions global $wgUser; - if((isset($show['patrolled']) || isset($show['!patrolled'])) && !$wgUser->isAllowed('patrol')) + if((isset($show['patrolled']) || isset($show['!patrolled'])) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied'); /* Add additional conditions to query depending upon parameters. */ @@ -183,7 +183,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { $this->fld_loginfo = isset($prop['loginfo']); global $wgUser; - if($this->fld_patrolled && !$wgUser->isAllowed('patrol')) + if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied'); /* Add fields to our query if they are specified as a needed parameter. */