From 2257d20d116b83590cf82836f25828191659c93f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 5 May 2011 05:11:50 +0000 Subject: [PATCH] (bug 23495) Allow createAndPromote.php to create non-sysop users --- RELEASE-NOTES | 1 + maintenance/createAndPromote.php | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f5c5680e7a..46dc3ba96a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 8bff284a11..db25a2fe21 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -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 ); -- 2.20.1