Page MenuHomeMiraheze
Paste P165

(An Untitled Masterwork)
ActivePublic

Authored by Paladox on Jan 3 2019, 03:10.
Tags
None
Referenced Files
F876645: raw.txt
Jan 3 2019, 03:10
Subscribers
None
class ScriptMira extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "";
}
public function execute() {
global $wgDBname;
$wikiDB = wfGetDB( DB_MASTER );
$pageTitle = $wikiDB->select(
'user',
'user_name',
[],
__METHOD__
);
if ( !$pageTitle || !is_object( $pageTitle ) ) {
throw new MWException( '$pageId was not set to a valid array.' );
}
foreach ( $pageTitle as $id ) {
$page_title = $id->user_name;
$this->output("Creating local user account for {$page_title}\n");
exec( "/usr/bin/php /srv/mediawiki/w/extensions/CentralAuth/maintenance/createLocalAccount.php --wiki=metawiki \"{$page_title}\"");
exec( "/usr/bin/php /srv/mediawiki/w/extensions/CentralAuth/maintenance/createLocalAccount.php --wiki=loginwiki \"{$page_title}\"");
}
}
}

Event Timeline