46 private $passwordReset;
62 parent::__construct(
'PasswordReset',
'editmyprivateinfo' );
64 $this->passwordReset = $passwordReset;
72 return $this->passwordReset->isAllowed( $user )->isGood();
76 $status = Status::wrap( $this->passwordReset->isAllowed( $user ) );
77 if ( !$status->isGood() ) {
78 throw new ErrorPageError(
'internalerror', $status->getMessage() );
81 parent::checkExecutePermissions( $user );
89 $out->disallowUserJs();
90 parent::execute(
$par );
96 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
99 'default' => $this->
getRequest()->getSession()->suggestLoginUsername(),
100 'label-message' =>
'passwordreset-username',
103 if ( $this->
getUser()->isRegistered() ) {
104 $a[
'Username'][
'default'] = $this->
getUser()->getName();
108 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
111 'label-message' =>
'passwordreset-email',
130 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
133 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
137 $message = ( $i > 1 ) ?
'passwordreset-text-many' :
'passwordreset-text-one';
151 $username = $data[
'Username'] ??
null;
152 $email = $data[
'Email'] ??
null;
154 $this->method = $username ?
'username' :
'email';
155 $this->result = Status::wrap(
156 $this->passwordReset->execute( $this->getUser(), $username, $email ) );
158 if ( $this->result->hasMessage(
'actionthrottledtext' ) ) {
162 return $this->result;
173 $output->addWikiMsg(
'passwordreset-success' );
174 $output->addWikiMsg(
'passwordreset-success-details-generic',
179 $postVals = $this->
getRequest()->getPostValues();
180 if ( isset( $postVals[
'wpUsername'] ) && $postVals[
'wpUsername'] !==
'' ) {
181 $info .=
"* " . $this->
msg(
'passwordreset-username' ) .
' '
184 if ( isset( $postVals[
'wpEmail'] ) && $postVals[
'wpEmail'] !==
'' ) {
185 $info .=
"* " . $this->
msg(
'passwordreset-email' ) .
' '
188 $output->addWikiMsg(
'passwordreset-success-info', $info );
191 $output->returnToMain();
199 if ( !$this->passwordReset->isEnabled()->isGood() ) {
203 return parent::isListed();
215class_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 sub-page 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.