From: umherirrender Date: Tue, 2 Oct 2012 20:18:04 +0000 (+0200) Subject: Use User::getGroupsWithPermission X-Git-Tag: 1.31.0-rc.0~22198 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=9c7a84550b661a2c57df17897950ecd41b2f9ce0;p=lhc%2Fweb%2Fwiklou.git Use User::getGroupsWithPermission Change-Id: Iba44440600484b9f2525805a1c80df50d5335c1a --- diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 0278f72cad..bfaaab5498 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -218,24 +218,17 @@ class RebuildRecentchanges extends Maintenance { * DOCUMENT ME! */ private function rebuildRecentChangesTablePass4() { - global $wgGroupPermissions, $wgUseRCPatrol; + global $wgUseRCPatrol; $dbw = wfGetDB( DB_MASTER ); list( $recentchanges, $usergroups, $user ) = $dbw->tableNamesN( 'recentchanges', 'user_groups', 'user' ); - $botgroups = $autopatrolgroups = array(); - foreach ( $wgGroupPermissions as $group => $rights ) { - if ( isset( $rights['bot'] ) && $rights['bot'] ) { - $botgroups[] = $dbw->addQuotes( $group ); - } - if ( $wgUseRCPatrol && isset( $rights['autopatrol'] ) && $rights['autopatrol'] ) { - $autopatrolgroups[] = $dbw->addQuotes( $group ); - } - } + $botgroups = User::getGroupsWithPermission( 'bot' ); + $autopatrolgroups = $wgUseRCPatrol ? User::getGroupsWithPermission( 'autopatrol' ) : array(); # Flag our recent bot edits if ( !empty( $botgroups ) ) { - $botwhere = implode( ',', $botgroups ); + $botwhere = $dbw->makeList( $botgroups ); $botusers = array(); $this->output( "Flagging bot account edits...\n" ); @@ -259,7 +252,7 @@ class RebuildRecentchanges extends Maintenance { global $wgMiserMode; # Flag our recent autopatrolled edits if ( !$wgMiserMode && !empty( $autopatrolgroups ) ) { - $patrolwhere = implode( ',', $autopatrolgroups ); + $patrolwhere = $dbw->makeList( $autopatrolgroups ); $patrolusers = array(); $this->output( "Flagging auto-patrolled edits...\n" );