Merge "improving comment re DateFormatter.php"
[lhc/web/wiklou.git] / includes / specials / SpecialChangePassword.php
index 2b88325..41b3b25 100644 (file)
@@ -37,7 +37,9 @@ class SpecialChangePassword extends UnlistedSpecialPage {
        function execute( $par ) {
                global $wgAuth;
 
-               $this->checkReadOnly();
+               $this->setHeaders();
+               $this->outputHeader();
+               $this->getOutput()->disallowUserJs();
 
                $request = $this->getRequest();
                $this->mUserName = trim( $request->getVal( 'wpName' ) );
@@ -46,10 +48,6 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                $this->mRetype = $request->getVal( 'wpRetype' );
                $this->mDomain = $request->getVal( 'wpDomain' );
 
-               $this->setHeaders();
-               $this->outputHeader();
-               $this->getOutput()->disallowUserJs();
-
                $user = $this->getUser();
                if( !$request->wasPosted() && !$user->isLoggedIn() ) {
                        $this->error( $this->msg( 'resetpass-no-info' )->text() );
@@ -61,12 +59,11 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                        return;
                }
 
+               $this->checkReadOnly();
+
                if( $request->wasPosted() && $user->matchEditToken( $request->getVal( 'token' ) ) ) {
                        try {
-                               if ( isset( $_SESSION['wsDomain'] ) ) {
-                                       $this->mDomain = $_SESSION['wsDomain'];
-                               }
-                               $wgAuth->setDomain( $this->mDomain );
+                               $this->mDomain = $wgAuth->getDomain();
                                if( !$wgAuth->allowPasswordChange() ) {
                                        $this->error( $this->msg( 'resetpass_forbidden' )->text() );
                                        return;