48 parent::__construct(
'PasswordReset',
'editmyprivateinfo' );
50 $this->passwordReset = $passwordReset;
59 return $this->passwordReset->isAllowed( $user )->isGood();
63 $status = Status::wrap( $this->passwordReset->isAllowed( $user ) );
64 if ( !$status->isGood() ) {
65 throw new ErrorPageError(
'internalerror', $status->getMessage() );
68 parent::checkExecutePermissions( $user );
76 $out->disallowUserJs();
77 parent::execute(
$par );
84 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
87 'default' => $this->
getRequest()->getSession()->suggestLoginUsername(),
88 'label-message' =>
'passwordreset-username',
89 'excludetemp' =>
true,
92 if ( $this->
getUser()->isRegistered() ) {
93 $a[
'Username'][
'default'] = $this->
getUser()->getName();
97 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
100 'label-message' =>
'passwordreset-email',
120 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
123 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
127 $message = ( $i > 1 ) ?
'passwordreset-text-many' :
'passwordreset-text-one';
142 $username = $data[
'Username'] ??
null;
143 $email = $data[
'Email'] ??
null;
145 $result = Status::wrap(
146 $this->passwordReset->execute( $this->getUser(), $username, $email ) );
148 if ( $result->hasMessage(
'actionthrottledtext' ) ) {
163 $output->addWikiMsg(
'passwordreset-success' );
164 $output->addWikiMsg(
'passwordreset-success-details-generic',
169 $postVals = $this->
getRequest()->getPostValues();
170 if ( isset( $postVals[
'wpUsername'] ) && $postVals[
'wpUsername'] !==
'' ) {
171 $info .=
"* " . $this->
msg(
'passwordreset-username' ) .
' '
174 if ( isset( $postVals[
'wpEmail'] ) && $postVals[
'wpEmail'] !==
'' ) {
175 $info .=
"* " . $this->
msg(
'passwordreset-email' ) .
' '
178 $output->addWikiMsg(
'passwordreset-success-info', $info );
181 $output->returnToMain();
189 if ( !$this->passwordReset->isEnabled()->isGood() ) {
193 return parent::isListed();
206class_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.