addDescription( 'Script to update single TOTP keys to multi-key environment' ); $this->requireExtension( 'OATHAuth' ); } public function execute() { global $wgOATHAuthDatabase; $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase ); $dbw = $lb->getConnectionRef( DB_PRIMARY, [], $wgOATHAuthDatabase ); if ( !UpdateTables::switchTOTPToMultipleKeys( $dbw ) ) { $this->error( "Failed to update TOTP keys.\n", 1 ); } $this->output( "Done.\n" ); } } $maintClass = UpdateTOTPToMultipleKeys::class; require_once RUN_MAINTENANCE_IF_MAIN;