Go to the documentation of this file.
24 parent::__construct(
'DisableOATHForUser',
'oathauth-disable-for-user' );
46 $form->
getOutput()->setPageTitle( $this->
msg(
'oathauth-disable-for-user' ) );
69 parent::checkExecutePermissions( $user );
82 'label-message' =>
'oathauth-enteruser',
89 'label-message' =>
'oathauth-enterreason',
104 if ( $user && $user->getId() === 0 ) {
105 return [
'oathauth-user-not-found' ];
107 $oathUser = $this->userRepo->findByUser( $user );
109 if ( !( $oathUser->getModule() instanceof
IModule ) ||
110 !$oathUser->getModule()->isEnabled( $oathUser ) ) {
111 return [
'oathauth-user-not-does-not-have-oath-enabled' ];
114 if ( $this->
getUser()->pingLimiter(
'disableoath', 0 ) ) {
116 return [
'oathauth-throttled', Message::durationParam( 60 ) ];
119 $oathUser->disable();
120 $this->userRepo->remove( $oathUser, $this->
getRequest()->getIP() );
123 $logEntry->setPerformer( $this->
getUser() );
124 $logEntry->setTarget( $user->getUserPage() );
125 $logEntry->setComment( $formData[
'reason'] );
129 'OATHAuth disabled for {usertarget} by {user} from {clientip}', [
131 'usertarget' => $formData[
'user'],
140 $this->
getOutput()->addWikiMsg(
'oathauth-disabledoath' );
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Show an error when the user tries to do something whilst blocked.
getOutput()
Get the OutputPage being used for this instance.
Redirect a user to the login page.
Special page which uses an HTMLForm to handle processing.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getName()
Get the name of this Special Page.
Exceptions for config failures.
getUser()
Shortcut to get the User executing this instance.
requireLogin( $reasonMsg='exception-nologin-text', $titleMsg='exception-nologin')
If the user is not logged in, throws UserNotLoggedIn error.
getRequest()
Get the WebRequest being used for this instance.
Class for creating new log entries and inserting them into the database.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...