public function execute() {
$username = $this->getArg( 0 );
$password = $this->getArg( 1 );
-
+
$this->output( wfWikiID() . ": Creating and promoting User:{$username}..." );
-
+
$user = User::newFromName( $username );
if ( !is_object( $user ) ) {
$this->error( "invalid username.", true );
# Insert the account into the database
$user->addToDatabase();
$user->saveSettings();
-
+
# Promote user
$user->addGroup( 'sysop' );
if ( $this->hasOption( 'bureaucrat' ) )
$user->addGroup( 'bureaucrat' );
-
+
# Increment site_stats.ss_users
$ssu = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
$ssu->doUpdate();
-
+
$this->output( "done.\n" );
}
}
$maintClass = "CreateAndPromote";
-require_once( DO_MAINTENANCE );
\ No newline at end of file
+require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file