Go to the documentation of this file.
80 return strtolower( $this->
getName() );
99 $onSubmit = [ $this,
'onSubmit' ];
101 if ( $this->reauthPostData ) {
106 $oldRequest, $this->reauthPostData + $oldRequest->getQueryValues(),
true
111 $onSubmit =
function () {
122 $form->setSubmitCallback( $onSubmit );
130 if ( !$headerMsg->isDisabled() ) {
131 $form->addHeaderText( $headerMsg->parseAsBlock() );
134 $form->addPreText( $this->
preText() );
135 $form->addPostText( $this->
postText() );
137 if ( $form->getMethod() ==
'post' ) {
139 $params = array_diff_key(
140 $this->
getRequest()->getQueryValues(), [
'title' =>
null ] );
141 $form->addHiddenField(
'redirectparams',
wfArrayToCgi( $params ) );
157 abstract public function onSubmit( array $data );
185 if ( $form->show() ) {
209 if ( $block && $block->isSitewide() ) {
242 $this->reauthPostData = $data;
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
getFormFields()
Get an HTMLForm descriptor array.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
requiresUnblock()
Whether this action cannot be executed by a blocked user.
onSubmit(array $data)
Process the form on POST submission.
getForm()
Get the HTMLForm to control behavior.
Show an error when the user tries to do something whilst blocked.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
requiresWrite()
Whether this action requires the wiki not to be locked.
setParameter( $par)
Maybe do something interesting with the subpage parameter.
Special page which uses an HTMLForm to handle processing.
preText()
Add pre-text to the form.
getName()
Get the name of this Special Page.
postText()
Add post-text to the form.
getMessagePrefix()
Get message prefix for HTMLForm.
An IContextSource implementation which will inherit context from another source but allow individual ...
array null $reauthPostData
POST data preserved across re-authentication.
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
execute( $par)
Basic SpecialPage workflow: get a form, send it to the user; get some data back,.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
getBlock( $fromReplica=true)
Get the block affecting the user, or null if the user is not blocked.
getContext()
Gets the context this SpecialPage is executed in.
string null $par
The sub-page of the special page.
getDisplayFormat()
Get display format for the form.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
setReauthPostData(array $data)
Preserve POST data across reauthentication.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....