Update to r32375 / bug 11874 -- !important may have whitespace between ! and important
[lhc/web/wiklou.git] / includes / SpecialResetpass.php
index b83375f..2ecd15b 100644 (file)
@@ -1,10 +1,15 @@
 <?php
 
+/** Constructor */
 function wfSpecialResetpass( $par ) {
        $form = new PasswordResetForm();
        $form->execute( $par );
 }
 
+/**
+ * Let users recover their password.
+ * @addtogroup SpecialPage
+ */
 class PasswordResetForm extends SpecialPage {
        function __construct( $name=null, $reset=null ) {
                if( $name !== null ) {
@@ -20,7 +25,7 @@ class PasswordResetForm extends SpecialPage {
        /**
         * Main execution point
         */
-       function execute( $par='' ) {
+       function execute( $par ) {
                global $wgUser, $wgAuth, $wgOut, $wgRequest;
                
                if( !$wgAuth->allowPasswordChange() ) {
@@ -38,7 +43,7 @@ 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',
@@ -69,6 +74,8 @@ class PasswordResetForm extends SpecialPage {
        
        function showForm() {
                global $wgOut, $wgUser, $wgRequest;
+
+               $wgOut->disallowUserJs();
                
                $self = SpecialPage::getTitleFor( 'Resetpass' );                
                $form  =
@@ -134,7 +141,7 @@ class PasswordResetForm extends SpecialPage {
        }
        
        /**
-        * @throws PasswordError
+        * @throws PasswordError when cannot set the new password because requirements not met.
         */
        function attemptReset( $newpass, $retype ) {
                $user = User::newFromName( $this->mName );
@@ -155,4 +162,4 @@ class PasswordResetForm extends SpecialPage {
        }
 }
 
-?>
+