Let crazy people run updates on broken setups like 5.3.1
[lhc/web/wiklou.git] / maintenance / createAndPromote.php
index 566885c..391d122 100644 (file)
@@ -22,7 +22,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
 
 class CreateAndPromote extends Maintenance {
 
@@ -30,7 +30,8 @@ class CreateAndPromote extends Maintenance {
                parent::__construct();
                $this->mDescription = "Create a new user account with administrator rights";
                $this->addOption( "bureaucrat", "Grant the account bureaucrat rights" );
-               $this->addArgs( array( "username", "password" ) );
+               $this->addArg( "username", "Username of new user" );
+               $this->addArg( "password", "Password to set" );
        }
 
        public function execute() {
@@ -41,9 +42,9 @@ class CreateAndPromote extends Maintenance {
                
                $user = User::newFromName( $username );
                if( !is_object( $user ) ) {
-                       $this->error( "invalid username.\n", true );
+                       $this->error( "invalid username.", true );
                } elseif( 0 != $user->idForName() ) {
-                       $this->error( "account exists.\n", true );
+                       $this->error( "account exists.", true );
                }
 
                # Try to set the password