X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Frebuildrecentchanges.php;h=bfaaab5498daae30e47d2eacd2f060f4e8ca7be4;hb=0d76bceabd9ed9dadc249d59ef78a2cc4bc4f82d;hp=5caa0a8fc0c2ccac58a3a47fb1a6faf1bccbee0d;hpb=a38bde74e124f6736202aab8b4842b4db4aa02ce;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 5caa0a8fc0..bfaaab5498 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -23,7 +23,7 @@ * @todo Document */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); /** * Maintenance script that rebuilds recent changes from scratch. @@ -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" );