Added $wgAutopromoteOnceLogInRC variable (bug 29655)
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 12 Jul 2011 00:09:37 +0000 (00:09 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 12 Jul 2011 00:09:37 +0000 (00:09 +0000)
includes/DefaultSettings.php
includes/User.php

index b7b5030..77975f3 100644 (file)
@@ -3566,6 +3566,12 @@ $wgAutopromoteOnce = array(
        'onView' => array()
 );
 
+/*
+ * Put user rights log entries for autopromotion in recent changes?
+ * @since 1.18
+ */
+$wgAutopromoteOnceLogInRC = true;
+
 /**
  * $wgAddGroups and $wgRemoveGroups can be used to give finer control over who
  * can assign which groups at Special:Userrights.  Example configuration:
index b0dcc00..d93efa8 100644 (file)
@@ -1138,6 +1138,8 @@ class User {
         * @see $wgAutopromoteOnce
         */
        public function addAutopromoteOnceGroups( $event ) {
+               global $wgAutopromoteOnceLogInRC;
+
                $toPromote = array();
                if ( $this->getId() ) {
                        $toPromote = Autopromote::getAutopromoteOnceGroups( $this, $event );
@@ -1148,7 +1150,7 @@ class User {
                                }
                                $newGroups = array_merge( $oldGroups, $toPromote ); // all groups
 
-                               $log = new LogPage( 'rights', false /* not in RC */ );
+                               $log = new LogPage( 'rights', $wgAutopromoteOnceLogInRC /* in RC? */ );
                                $log->addEntry( 'autopromote',
                                        $this->getUserPage(),
                                        '', // no comment