summaryrefslogtreecommitdiff
path: root/maintenance/createAndPromote.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/createAndPromote.php')
-rw-r--r--maintenance/createAndPromote.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php
index 8bff284a..0d7de9a9 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( 'sysop' );
+ }
+ if ( $this->hasOption( 'bureaucrat' ) ) {
$user->addGroup( 'bureaucrat' );
+ }
# Increment site_stats.ss_users
$ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );