(bug 23495) Allow createAndPromote.php to create non-sysop users
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 5 May 2011 05:11:50 +0000 (05:11 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 5 May 2011 05:11:50 +0000 (05:11 +0000)
RELEASE-NOTES
maintenance/createAndPromote.php

index f5c5680..46dc3ba 100644 (file)
@@ -126,6 +126,7 @@ production.
 * (bug 13879) Special:Emailuser asks for suitable target user if called without.
 * (bug 16956) IPTC and XMP metadata now extracted from images.
 * (bug 23816) A tracking category is now added for any pages with broken images.
+* (bug 23495) Allow createAndPromote.php to create non-sysop users
 
 === Bug fixes in 1.18 ===
 * (bug 23119) WikiError class and subclasses are now marked as deprecated.
index 8bff284..db25a2f 100644 (file)
@@ -28,7 +28,8 @@ class CreateAndPromote extends Maintenance {
 
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Create a new user account with administrator rights";
+               $this->mDescription = "Create a new user account";
+               $this->addOption( "sysop", "Grant the account sysop rights" );
                $this->addOption( "bureaucrat", "Grant the account bureaucrat rights" );
                $this->addArg( "username", "Username of new user" );
                $this->addArg( "password", "Password to set" );
@@ -59,9 +60,12 @@ class CreateAndPromote extends Maintenance {
                $user->saveSettings();
 
                # Promote user
-               $user->addGroup( 'sysop' );
-               if ( $this->hasOption( 'bureaucrat' ) )
+               if ( $this->hasOption( 'sysop' ) ) {
                        $user->addGroup( 'bureaucrat' );
+               }
+               if ( $this->hasOption( 'bureaucrat' ) ) {
+                       $user->addGroup( 'bureaucrat' );
+               }
 
                # Increment site_stats.ss_users
                $ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );