Go to the documentation of this file.
40 parent::__construct(
'ChangePassword',
'editmyprivateinfo' );
54 parent::checkExecutePermissions(
$user );
67 $this->mPreTextMessage = $msg;
76 $this->mOldPassMsg = $msg;
80 global $wgCookieExpiration;
86 if ( !isset( $oldpassMsg ) ) {
87 $oldpassMsg =
$user->isLoggedIn() ?
'oldpassword' :
'resetpass-temp-password';
93 'label-message' =>
'username',
94 'default' => $request->getVal(
'wpName',
$user->getName() ),
98 'label-message' => $oldpassMsg,
100 'NewPassword' =>
array(
101 'type' =>
'password',
102 'label-message' =>
'newpassword',
105 'type' =>
'password',
106 'label-message' =>
'retypenew',
110 if ( !$this->
getUser()->isLoggedIn() ) {
114 $fields[
'LoginOnChangeToken'] =
array(
116 'label' =>
'Change Password Token',
121 $extraFields =
array();
123 foreach ( $extraFields
as $extra ) {
128 'label-message' => $label,
129 'default' => $default,
133 if ( !
$user->isLoggedIn() ) {
134 $fields[
'Remember'] =
array(
136 'label' => $this->
msg(
'remembermypassword' )
137 ->numParams( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) )
139 'default' => $request->getVal(
'wpRemember' ),
147 $form->setId(
'mw-resetpass-form' );
148 $form->setTableId(
'mw-resetpass-table' );
149 $form->setWrapperLegendMsg(
'resetpass_header' );
150 $form->setSubmitTextMsg(
152 ?
'resetpass-submit-loggedin'
155 $form->addButton(
'wpCancel', $this->
msg(
'resetpass-submit-cancel' )->
text() );
157 if ( $this->mPreTextMessage instanceof Message ) {
158 $form->addPreText( $this->mPreTextMessage->parseAsBlock() );
160 $form->addHiddenFields(
161 $this->
getRequest()->getValues(
'wpName',
'wpDomain',
'returnto',
'returntoquery' ) );
169 if ( $request->getCheck(
'wpLoginToken' ) ) {
174 if ( !$this->
getUser()->isLoggedIn()
182 if ( $request->getCheck(
'wpCancel' ) ) {
184 if ( !$titleObj instanceof
Title ) {
187 $query = $request->getVal(
'returntoquery' );
194 $this->mUserName = $request->getVal(
'wpName', $this->
getUser()->
getName() );
195 $this->mDomain = $wgAuth->getDomain();
197 if ( !$wgAuth->allowPasswordChange() ) {
198 throw new ErrorPageError(
'changepassword',
'resetpass_forbidden' );
201 $this->
attemptReset( $data[
'Password'], $data[
'NewPassword'], $data[
'Retype'] );
205 return $e->getMessage();
210 if ( $this->
getUser()->isLoggedIn() ) {
212 "<div class=\"successbox\">\n$1\n</div>",
213 'changepassword-success'
221 'action' =>
'submitlogin',
222 'wpName' => $this->mUserName,
223 'wpDomain' => $this->mDomain,
224 'wpLoginToken' => $token,
225 'wpPassword' => $request->getVal(
'wpNewPassword' ),
226 ) + $request->getValues(
'wpRemember',
'returnto',
'returntoquery' );
229 $login->execute(
null );
237 global $wgPasswordAttemptThrottle;
239 $isSelf = ( $this->mUserName === $this->
getUser()->getName() );
250 if ( $newpass !== $retype ) {
256 if ( $throttleCount ===
true ) {
259 ->params( $lang->formatDuration( $wgPasswordAttemptThrottle[
'seconds'] ) )
265 if ( !
$user->checkTemporaryPassword( $oldpass ) && !
$user->checkPassword( $oldpass ) ) {
271 if ( $oldpass === $newpass ) {
284 if ( $throttleCount ) {
289 $user->setPassword( $newpass );
301 $user->resetPasswordExpiration();
302 $user->saveSettings();
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getOutput()
Get the OutputPage being used for this instance.
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
execute( $par)
Main execution point.
static newMainPage()
Create a new Title for the Main Page.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
Thrown by User::setPassword() on error.
Special page which uses an HTMLForm to handle processing.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getLanguage()
Shortcut to get user's language.
getName()
Get the name of this Special Page.
requireLogin( $reasonMsg=null, $titleMsg=null)
If the user is not logged in, throws UserNotLoggedIn error.
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
setOldPasswordMessage( $msg)
Set a message at the top of the Change Password form.
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 account incomplete & $abortMsg
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
getFormFields()
Get an HTMLForm descriptor array.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
getContext()
Gets the context this SpecialPage is executed in.
Let users recover their password.
Allows to change the fields on the form that will be generated $name
msg()
Wrapper around wfMessage that sets the current context.
string $par
The sub-page of the special page.
listed( $x=null)
Get or set whether this special page is listed in Special:SpecialPages.
getRequest()
Get the WebRequest being used for this instance.
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 account $user
attemptReset( $oldpass, $newpass, $retype)
Represents a title within MediaWiki.
setChangeMessage(Message $msg)
Set a message at the top of the Change Password form.
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
requiresUnblock()
Whether this action cannot be executed by a blocked user.
An error page which can definitely be safely rendered using the OutputPage.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
onSubmit(array $data)
Process the form on POST submission.