(bug 15945) API: Use User::useRCPatrol() and useNPPatrol() rather than isAllowed...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 14 Oct 2008 12:46:11 +0000 (12:46 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 14 Oct 2008 12:46:11 +0000 (12:46 +0000)
RELEASE-NOTES
includes/api/ApiQueryRecentChanges.php

index b5cf6a1..bac626d 100644 (file)
@@ -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
   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 ===
 
 
 === Languages updated in 1.14 ===
 
index 81c3680..6f87dff 100644 (file)
@@ -67,7 +67,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
        public static function getPatrolToken($pageid, $title, $rc)
        {
                global $wgUser;
        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
                        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;
                        
                        // 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. */
                                $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;
                        $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. */
                                $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. */