31 parent::__construct(
'PasswordReset',
'editmyprivateinfo' );
33 $this->passwordReset = $passwordReset;
43return $this->passwordReset->isAllowed( $user )->isGood();
47 $status = Status::wrap( $this->passwordReset->isAllowed( $user ) );
48if ( !$status->isGood() ) {
52 parent::checkExecutePermissions( $user );
60 $out->disallowUserJs();
61 parent::execute(
$par );
68if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
71'default' => $this->
getRequest()->getSession()->suggestLoginUsername(),
72'label-message' =>
'passwordreset-username',
76if ( $this->
getUser()->isRegistered() ) {
77 $a[
'Username'][
'default'] = $this->
getUser()->getName();
81if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
84'label-message' =>
'passwordreset-email',
104if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
107if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
111 $message = ( $i > 1 ) ?
'passwordreset-text-many' :
'passwordreset-text-one';
126 $username = $data[
'Username'] ??
null;
127 $email = $data[
'Email'] ??
null;
129 $result = Status::wrap(
130 $this->passwordReset->execute( $this->getUser(), $username, $email ) );
132if ( $result->hasMessage(
'actionthrottledtext' ) ) {
136// Show a message on the successful processing of the form. 137// This doesn't necessarily mean a reset email was sent. 138if ( $result->isGood() ) {
141// Information messages. 142 $output->addWikiMsg(
'passwordreset-success' );
143 $output->addWikiMsg(
'passwordreset-success-details-generic',
146// Confirmation of what the user has just submitted. 149 $info .=
"* " . $this->
msg(
'passwordreset-username' ) .
' ' 153 $info .=
"* " . $this->
msg(
'passwordreset-email' ) .
' ' 156 $output->addWikiMsg(
'passwordreset-success-info', $info );
158// Add a return to link to the main page. 159 $output->returnToMain();
170if ( !$this->passwordReset->isEnabled()->isGood() ) {
174return parent::isListed();
187class_alias( SpecialPasswordReset::class,
'SpecialPasswordReset' );
wfEscapeWikiText( $input)
Escapes the given text so that it may be output using addWikiText() without any linking,...
An error page which can definitely be safely rendered using the OutputPage.
Show an error when the user hits a rate limit.
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusabl...
setHeaderHtml( $html, $section=null)
Set header HTML, inside the form.
setSubmitTextMsg( $msg)
Set the text for the submit button to a message.
addHiddenFields(array $fields)
Add an array of hidden fields to the output Array values are discarded for security reasons (per WebR...
setSubmitDestructive()
Identify that the submit button in the form has a destructive action.
A class containing constants representing the names of configuration variables.
const PasswordReminderResendTime
Name constant for the PasswordReminderResendTime setting, for use with Config::get()
const PasswordResetRoutes
Name constant for the PasswordResetRoutes setting, for use with Config::get()
Special page which uses an HTMLForm to handle processing.
string null $par
The subpage of the special page.
getUser()
Shortcut to get the User executing this instance.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
Special page for requesting a password reset email.
isListed()
Hide the password reset page if resets are disabled.
onSubmit(array $data)
Process the form.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
userCanExecute(User $user)
Checks if the given user (identified by an object) can execute this special page (as defined by $mRes...
doesWrites()
Indicates whether POST requests to this special page require write access to the wiki....
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
getFormFields()
Get an HTMLForm descriptor array.array
getDisplayFormat()
Get display format for the form.See HTMLForm documentation for available values.1....
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
__construct(PasswordReset $passwordReset)
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Password reset helper for functionality shared by the web UI and the API.
User class for the MediaWiki software.