Add bug and comment for r35609: * (bug 13434) Show a warning when hash identical...
[lhc/web/wiklou.git] / includes / SpecialResetpass.php
index 3a93852..707b941 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @ingroup SpecialPage
+ */
 
 /** Constructor */
 function wfSpecialResetpass( $par ) {
@@ -8,7 +12,7 @@ function wfSpecialResetpass( $par ) {
 
 /**
  * Let users recover their password.
- * @addtogroup SpecialPage
+ * @ingroup SpecialPage
  */
 class PasswordResetForm extends SpecialPage {
        function __construct( $name=null, $reset=null ) {
@@ -21,18 +25,18 @@ class PasswordResetForm extends SpecialPage {
                        $this->mTemporaryPassword = $wgRequest->getVal( 'wpPassword' );
                }
        }
-       
+
        /**
         * Main execution point
         */
-       function execute( $par='' ) {
+       function execute( $par ) {
                global $wgUser, $wgAuth, $wgOut, $wgRequest;
-               
+
                if( !$wgAuth->allowPasswordChange() ) {
                        $this->error( wfMsg( 'resetpass_forbidden' ) );
                        return;
                }
-               
+
                if( $this->mName === null && !$wgRequest->wasPosted() ) {
                        $this->error( wfMsg( 'resetpass_missing' ) );
                        return;
@@ -43,8 +47,8 @@ class PasswordResetForm extends SpecialPage {
                        $retype = $wgRequest->getVal( 'wpRetype' );
                        try {
                                $this->attemptReset( $newpass, $retype );
-                               $wgOut->addWikiText( wfMsg( 'resetpass_success' ) );
-                               
+                               $wgOut->addWikiMsg( 'resetpass_success' );
+
                                $data = array(
                                        'action' => 'submitlogin',
                                        'wpName' => $this->mName,
@@ -56,7 +60,7 @@ class PasswordResetForm extends SpecialPage {
                                }
                                $login = new LoginForm( new FauxRequest( $data, true ) );
                                $login->execute();
-                               
+
                                return;
                        } catch( PasswordError $e ) {
                                $this->error( $e->getMessage() );
@@ -64,20 +68,20 @@ class PasswordResetForm extends SpecialPage {
                }
                $this->showForm();
        }
-       
+
        function error( $msg ) {
                global $wgOut;
                $wgOut->addHtml( '<div class="errorbox">' .
                        htmlspecialchars( $msg ) .
                        '</div>' );
        }
-       
+
        function showForm() {
                global $wgOut, $wgUser, $wgRequest;
 
                $wgOut->disallowUserJs();
-               
-               $self = SpecialPage::getTitleFor( 'Resetpass' );                
+
+               $self = SpecialPage::getTitleFor( 'Resetpass' );
                $form  =
                        '<div id="userloginForm">' .
                        wfOpenElement( 'form',
@@ -117,7 +121,7 @@ class PasswordResetForm extends SpecialPage {
                        '</div>';
                $wgOut->addHtml( $form );
        }
-       
+
        function pretty( $fields ) {
                $out = '';
                foreach( $fields as $list ) {
@@ -139,7 +143,7 @@ class PasswordResetForm extends SpecialPage {
                }
                return $out;
        }
-       
+
        /**
         * @throws PasswordError when cannot set the new password because requirements not met.
         */
@@ -148,18 +152,16 @@ class PasswordResetForm extends SpecialPage {
                if( $user->isAnon() ) {
                        throw new PasswordError( 'no such user' );
                }
-               
+
                if( !$user->checkTemporaryPassword( $this->mTemporaryPassword ) ) {
                        throw new PasswordError( wfMsg( 'resetpass_bad_temporary' ) );
                }
-               
+
                if( $newpass !== $retype ) {
                        throw new PasswordError( wfMsg( 'badretype' ) );
                }
-               
+
                $user->setPassword( $newpass );
                $user->saveSettings();
        }
 }
-
-?>