Merge "resourceloader: Add getConfig() method to ResourceLoaderContext"
[lhc/web/wiklou.git] / maintenance / createAndPromote.php
index d3efca6..24ab3d2 100644 (file)
@@ -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();
@@ -66,7 +66,7 @@ class CreateAndPromote extends Maintenance {
                        $this->fatalError( "invalid username." );
                }
 
-               $exists = ( 0 !== $user->idForName() );
+               $exists = ( $user->idForName() !== 0 );
 
                if ( $exists && !$force ) {
                        $this->fatalError( "Account exists. Perhaps you want the --force option?" );