X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=2072d7b54d6062ae60e43569c4ad0bac7704f844;hb=3ea30167fbbcb684370eb436a017cd42cc092fad;hp=1872716fb5c4eef67624b3e8cbcc9126134f7f76;hpb=1e3c2e5904d628c001a8d65909b135ea9bf042aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 1872716fb5..2072d7b54d 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -31,7 +31,7 @@ require_once __DIR__ . '/Maintenance.php'; * @ingroup Maintenance */ class CreateAndPromote extends Maintenance { - private static $permitRoles = [ 'sysop', 'bureaucrat', 'bot' ]; + private static $permitRoles = [ 'sysop', 'bureaucrat', 'interface-admin', 'bot' ]; public function __construct() { parent::__construct(); @@ -63,15 +63,15 @@ class CreateAndPromote extends Maintenance { $user = User::newFromName( $username ); if ( !is_object( $user ) ) { - $this->error( "invalid username.", true ); + $this->fatalError( "invalid username." ); } $exists = ( 0 !== $user->idForName() ); if ( $exists && !$force ) { - $this->error( "Account exists. Perhaps you want the --force option?", true ); + $this->fatalError( "Account exists. Perhaps you want the --force option?" ); } elseif ( !$exists && !$password ) { - $this->error( "Argument required!", false ); + $this->error( "Argument required!" ); $this->maybeHelp( true ); } elseif ( $exists ) { $inGroups = $user->getGroups(); @@ -133,7 +133,7 @@ class CreateAndPromote extends Maintenance { $user->saveSettings(); } } catch ( PasswordError $pwe ) { - $this->error( $pwe->getText(), true ); + $this->fatalError( $pwe->getText() ); } } @@ -150,5 +150,5 @@ class CreateAndPromote extends Maintenance { } } -$maintClass = "CreateAndPromote"; +$maintClass = CreateAndPromote::class; require_once RUN_MAINTENANCE_IF_MAIN;