45 parent::__construct(
'PasswordReset',
'editmyprivateinfo' );
47 $this->passwordReset = $passwordReset;
56 return $this->passwordReset->isAllowed( $user )->isGood();
60 $status = Status::wrap( $this->passwordReset->isAllowed( $user ) );
61 if ( !$status->isGood() ) {
62 throw new ErrorPageError(
'internalerror', $status->getMessage() );
65 parent::checkExecutePermissions( $user );
73 $out->disallowUserJs();
74 parent::execute(
$par );
81 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
84 'default' => $this->
getRequest()->getSession()->suggestLoginUsername(),
85 'label-message' =>
'passwordreset-username',
86 'excludetemp' =>
true,
89 if ( $this->
getUser()->isRegistered() ) {
90 $a[
'Username'][
'default'] = $this->
getUser()->getName();
94 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
97 'label-message' =>
'passwordreset-email',
117 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
120 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
124 $message = ( $i > 1 ) ?
'passwordreset-text-many' :
'passwordreset-text-one';
139 $username = $data[
'Username'] ??
null;
140 $email = $data[
'Email'] ??
null;
142 $result = Status::wrap(
143 $this->passwordReset->execute( $this->getUser(), $username, $email ) );
145 if ( $result->hasMessage(
'actionthrottledtext' ) ) {
160 $output->addWikiMsg(
'passwordreset-success' );
161 $output->addWikiMsg(
'passwordreset-success-details-generic',
166 $postVals = $this->
getRequest()->getPostValues();
167 if ( isset( $postVals[
'wpUsername'] ) && $postVals[
'wpUsername'] !==
'' ) {
168 $info .=
"* " . $this->
msg(
'passwordreset-username' ) .
' '
171 if ( isset( $postVals[
'wpEmail'] ) && $postVals[
'wpEmail'] !==
'' ) {
172 $info .=
"* " . $this->
msg(
'passwordreset-email' ) .
' '
175 $output->addWikiMsg(
'passwordreset-success-info', $info );
178 $output->returnToMain();
186 if ( !$this->passwordReset->isEnabled()->isGood() ) {
190 return parent::isListed();
203class_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.
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.
Show an error when the user hits a rate limit.