diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /includes/specials/SpecialPasswordReset.php | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/specials/SpecialPasswordReset.php')
-rw-r--r-- | includes/specials/SpecialPasswordReset.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/includes/specials/SpecialPasswordReset.php b/includes/specials/SpecialPasswordReset.php index 62731e98..efb57657 100644 --- a/includes/specials/SpecialPasswordReset.php +++ b/includes/specials/SpecialPasswordReset.php @@ -65,6 +65,9 @@ class SpecialPasswordReset extends FormSpecialPage { 'type' => 'text', 'label-message' => 'passwordreset-username', ); + if( $this->getUser()->isLoggedIn() ) { + $a['Username']['default'] = $this->getUser()->getName(); + } } if ( isset( $wgPasswordResetRoutes['email'] ) && $wgPasswordResetRoutes['email'] ) { @@ -95,7 +98,7 @@ class SpecialPasswordReset extends FormSpecialPage { } public function alterForm( HTMLForm $form ) { - $form->setSubmitText( wfMessage( "mailmypassword" ) ); + $form->setSubmitTextMsg( 'mailmypassword' ); } protected function preText() { @@ -110,7 +113,7 @@ class SpecialPasswordReset extends FormSpecialPage { if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { $i++; } - return wfMessage( 'passwordreset-pretext', $i )->parseAsBlock(); + return $this->msg( 'passwordreset-pretext', $i )->parseAsBlock(); } /** @@ -151,7 +154,7 @@ class SpecialPasswordReset extends FormSpecialPage { $method = 'email'; $res = wfGetDB( DB_SLAVE )->select( 'user', - '*', + User::selectFields(), array( 'user_email' => $data['Email'] ), __METHOD__ ); @@ -234,12 +237,12 @@ class SpecialPasswordReset extends FormSpecialPage { $password = $user->randomPassword(); $user->setNewpassword( $password ); $user->saveSettings(); - $passwords[] = wfMessage( 'passwordreset-emailelement', $user->getName(), $password - )->inLanguage( $userLanguage )->plain(); // We'll escape the whole thing later + $passwords[] = $this->msg( 'passwordreset-emailelement', $user->getName(), $password + )->inLanguage( $userLanguage )->text(); // We'll escape the whole thing later } $passwordBlock = implode( "\n\n", $passwords ); - $this->email = wfMessage( $msg )->inLanguage( $userLanguage ); + $this->email = $this->msg( $msg )->inLanguage( $userLanguage ); $this->email->params( $username, $passwordBlock, @@ -248,7 +251,7 @@ class SpecialPasswordReset extends FormSpecialPage { round( $wgNewPasswordExpiry / 86400 ) ); - $title = wfMessage( 'passwordreset-emailtitle' ); + $title = $this->msg( 'passwordreset-emailtitle' ); $this->result = $firstUser->sendMail( $title->escaped(), $this->email->escaped() ); |