(bug 12859) Deprecate $wgRateLimitsExcludedGroups in favor of adding the 'noratelimit...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 3 Jun 2008 14:53:47 +0000 (14:53 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 3 Jun 2008 14:53:47 +0000 (14:53 +0000)
RELEASE-NOTES
config/index.php
includes/DefaultSettings.php
includes/User.php

index 3be863a..108ce30 100644 (file)
@@ -395,6 +395,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added md5 parameter to action=edit
 * (bug 14335) Logging in to unified account using API not possible
 * Added action=emailuser to send an email to a user
+* (bug 12859) Deprecate $wgRateLimitsExcludedGroups in favor of adding the
+  'noratelimit' user right.
 
 === Languages updated in 1.13 ===
 
index 52b4441..763d6c1 100644 (file)
@@ -597,6 +597,7 @@ print "<li style='font-weight:bold;color:green;font-size:110%'>Environment check
        $conf->RootUser = importPost( "RootUser", "root" );
        $conf->RootPW = importPost( "RootPW", "" );
        $useRoot = importCheck( 'useroot', false );
+       $createAdminSettings = importCheck('createadminsettings', false);
        $conf->LanguageCode = importPost( "LanguageCode", "en" );
 
        ## MySQL specific:
@@ -1109,13 +1110,35 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                }
                if(fwrite( $f, $localSettings ) ) {
                        fclose( $f );
-                       print "</li></ul><hr/>\n";
-                       writeSuccessMessage();
+                       print "</li>\n";
                } else {
                        fclose( $f );
                        die("<p class='error'>An error occured while writing the config/LocalSettings.php file. Check user rights and disk space then try again.</p>\n");
                        print "</li></ul>\n";
                }
+               
+               /* Create AdminSettings.php if we've enabled that */
+               if ( $createAdminSettings ){ 
+                       print "<li style=\"list-style: none\">\n";
+                       print "<p>Creating AdminSettings.php...</p>\n\n";
+                       $f = file_get_contents( '../AdminSettings.sample' );
+       
+                       if( $f == false ) {
+                               dieout( "<p>Couldn't write out AdminSettings.php. Check that the directory permissions are correct.</p>\n" );
+                       }
+                       
+                       $f = str_replace( 'wikiadmin', $conf->RootUser, $f );
+                       $f = str_replace( 'adminpass', $conf->RootPW, $f );
+                       
+                       if ( file_put_contents( 'AdminSettings.php', $f ) ) {
+                               print "</li>\n";
+                       } else {
+                               die("<p class='error'>An error occured while writing the config/AdminSettings.php file. Check user rights and disk space then try again.</p>\n");
+                               print "</li></ul>\n";
+                       }
+               }
+               print "</ul>\n<hr />";
+               writeSuccessMessage();
 
        } while( false );
 }
@@ -1383,6 +1406,16 @@ if( count( $errs ) ) {
                the database (if needed) or tables within it, please check the box and provide details
                of a superuser account, such as <strong>root</strong>, which does.
        </p>
+       <div class="config-input">
+               <label class="column">AdminSettings.php:</label>
+               <input type="checkbox" name="createadminsettings" id="createadminsettings" <?php if( $createAdminSettings ) { ?>checked="checked" <?php } ?>/>
+               &nbsp;<label for="useroot">Create AdminSettings.php</label>
+       </div>
+
+       <p class="config-desc">
+               If the superuser account above is specified, you can optionally create an AdminSettings.php
+               file. This is used for running the maintenance scripts.
+       </p>
 
        <?php database_switcher('mysql'); ?>
        <div class="config-input"><?php
index 28e9de0..6f6239b 100644 (file)
@@ -1135,10 +1135,12 @@ $wgGroupPermissions['sysop']['markbotedits']     = true;
 $wgGroupPermissions['sysop']['suppressredirect'] = true;
 $wgGroupPermissions['sysop']['apihighlimits']    = true;
 $wgGroupPermissions['sysop']['browsearchive']    = true;
+$wgGroupPermissions['sysop']['noratelimits']     = true;
 #$wgGroupPermissions['sysop']['mergehistory']     = true;
 
 // Permission to change users' group assignments
-$wgGroupPermissions['bureaucrat']['userrights']  = true;
+$wgGroupPermissions['bureaucrat']['userrights']   = true;
+$wgGroupPermissions['bureaucrat']['noratelimits'] = true;
 // Permission to change users' groups assignments across wikis
 #$wgGroupPermissions['bureaucrat']['userrights-interwiki'] = true;
 
@@ -2835,8 +2837,11 @@ $wgRateLimitLog = null;
 
 /**
  * Array of groups which should never trigger the rate limiter
+ * 
+ * @deprecated as of 1.13, use $wgGroupPermissions[]['noratelimit']
+ * instead.
  */
-$wgRateLimitsExcludedGroups = array( 'sysop', 'bureaucrat' );
+$wgRateLimitsExcludedGroups = array();
 
 /**
  * On Special:Unusedimages, consider images "used", if they are put
index 5a36eea..426f63c 100644 (file)
@@ -1101,8 +1101,7 @@ class User {
         * @return bool
         */
        public function isPingLimitable() {
-               global $wgRateLimitsExcludedGroups;
-               return array_intersect($this->getEffectiveGroups(), $wgRateLimitsExcludedGroups) == array();
+               return !$this->userCan('noratelimits');
        }
 
        /**