55 parent::__construct(
'PasswordReset',
'editmyprivateinfo' );
64 return $this->passwordReset->isAllowed( $user )->isGood();
73 parent::checkExecutePermissions( $user );
77 $resetRoutes = $this->
getConfig()->get(
'PasswordResetRoutes' );
79 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
82 'label-message' =>
'passwordreset-username',
85 if ( $this->
getUser()->isLoggedIn() ) {
86 $a[
'Username'][
'default'] = $this->
getUser()->getName();
90 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
93 'label-message' =>
'passwordreset-email',
97 if ( $this->
getUser()->isAllowed(
'passwordreset' ) ) {
100 'label-message' =>
'passwordreset-capture',
101 'help-message' =>
'passwordreset-capture-help',
113 $resetRoutes = $this->
getConfig()->get(
'PasswordResetRoutes' );
118 if ( isset( $resetRoutes[
'username'] ) && $resetRoutes[
'username'] ) {
121 if ( isset( $resetRoutes[
'email'] ) && $resetRoutes[
'email'] ) {
125 $message = ( $i > 1 ) ?
'passwordreset-text-many' :
'passwordreset-text-one';
141 if ( isset( $data[
'Capture'] ) && !$this->
getUser()->isAllowed(
'passwordreset' ) ) {
147 $username = isset( $data[
'Username'] ) ? $data[
'Username'] : null;
148 $email = isset( $data[
'Email'] ) ? $data[
'Email'] : null;
149 $capture = !empty( $data[
'Capture'] );
151 $this->method =
$username ?
'username' :
'email';
153 $this->passwordReset->execute( $this->getUser(),
$username, $email, $capture ) );
154 if ( $capture && $this->
result->isOK() ) {
155 $this->passwords = $this->
result->getValue();
158 if ( $this->
result->hasMessage(
'actionthrottledtext' ) ) {
166 if ( $this->
getUser()->isAllowed(
'passwordreset' ) && $this->passwords ) {
169 if ( $this->
result->isGood() ) {
170 $this->
getOutput()->addWikiMsg(
'passwordreset-emailsent-capture2',
171 count( $this->passwords ) );
173 $this->
getOutput()->addWikiMsg(
'passwordreset-emailerror-capture2',
174 $this->
result->getMessage(),
key( $this->passwords ), count( $this->passwords ) );
178 foreach ( $this->passwords
as $username => $pwd ) {
180 htmlspecialchars(
$username, ENT_QUOTES )
181 . $this->
msg(
'colon-separator' )->
text()
182 . htmlspecialchars( $pwd, ENT_QUOTES )
188 if ( $this->method ===
'email' ) {
189 $this->
getOutput()->addWikiMsg(
'passwordreset-emailsentemail' );
191 $this->
getOutput()->addWikiMsg(
'passwordreset-emailsentusername' );
202 if ( $this->passwordReset->isAllowed( $this->getUser() )->isGood() ) {
203 return parent::isListed();
static closeElement($element)
Returns "</$element>".
the array() calling protocol came about after MediaWiki 1.4rc1.
static wrap($sv)
Succinct helper method to wrap a StatusValue.
PasswordReset $passwordReset
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
string[] $passwords
Temporary storage for the passwords which have been sent out, keyed by username.
msg()
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
Special page which uses an HTMLForm to handle processing.
alterForm(HTMLForm $form)
checkExecutePermissions(User $user)
userCanExecute(User $user)
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
static openElement($element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
An error page which can definitely be safely rendered using the OutputPage.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
This directory hold several benchmarking scripts used as a proof of speed or to track PHP performances over time To get somehow accurate result
Special page for requesting a password reset email.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Helper class for the password reset functionality shared by the web UI and the API.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
onSubmit(array $data)
Process the form.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
this hook is for auditing only or null if authentication failed before getting that far $username
getUser()
Shortcut to get the User executing this instance.
getConfig()
Shortcut to get main config object.
Show an error when a user tries to do something they do not have the necessary permissions for...
isListed()
Hide the password reset page if resets are disabled.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
getRequest()
Get the WebRequest being used for this instance.
Show an error when the user hits a rate limit.