MediaWiki  master
invalidateBotPasswords.php
Go to the documentation of this file.
1 <?php
24 require_once __DIR__ . '/Maintenance.php';
25 
32  public function __construct() {
33  parent::__construct();
34  $this->addOption( "user", "The username to operate on", false, true );
35  $this->addOption( "userid", "The user id to operate on", false, true );
36  $this->addDescription( "Invalidate a user's bot passwords" );
37  }
38 
39  public function execute() {
40  $user = $this->validateUserOption( "A \"user\" or \"userid\" must be set to invalidate the bot passwords for" );
41 
43 
44  if ( $res ) {
45  $this->output( "Bot passwords invalidated for " . $user->getName() . "\n" );
46  } else {
47  $this->output( "No bot passwords invalidated for " . $user->getName() . "\n" );
48  }
49  }
50 }
51 
52 $maintClass = InvalidateBotPasswords::class;
53 require_once RUN_MAINTENANCE_IF_MAIN;
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:329
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:59
InvalidateBotPasswords
Maintenance script to invalidate the bot passwords of a given user.
Definition: invalidateBotPasswords.php:31
$res
$res
Definition: testCompression.php:57
$maintClass
$maintClass
Definition: invalidateBotPasswords.php:52
Maintenance\addOption
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
Definition: Maintenance.php:249
InvalidateBotPasswords\__construct
__construct()
Default constructor.
Definition: invalidateBotPasswords.php:32
Maintenance\validateUserOption
validateUserOption( $errorMsg)
Definition: Maintenance.php:1660
BotPassword\invalidateAllPasswordsForUser
static invalidateAllPasswordsForUser( $username)
Invalidate all passwords for a user, by name.
Definition: BotPassword.php:289
InvalidateBotPasswords\execute
execute()
Do the actual work.
Definition: invalidateBotPasswords.php:39
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:435