Merge "Move some readonly around"
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 30 Jul 2012 22:16:43 +0000 (22:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 30 Jul 2012 22:16:43 +0000 (22:16 +0000)
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php

index a1c6fd2..167d4e2 100644 (file)
@@ -42,11 +42,13 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
        function execute( $par ) {
                global $wgAuth;
 
-               $this->checkReadOnly();
-
                $this->setHeaders();
                $this->outputHeader();
 
+               $out = $this->getOutput();
+               $out->disallowUserJs();
+               $out->addModules( 'mediawiki.special.changeemail' );
+
                if ( !$wgAuth->allowPropChange( 'emailaddress' ) ) {
                        $this->error( 'cannotchangeemail' );
                        return;
@@ -65,9 +67,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
                        return;
                }
 
-               $out = $this->getOutput();
-               $out->disallowUserJs();
-               $out->addModules( 'mediawiki.special.changeemail' );
+               $this->checkReadOnly();
 
                $this->mPassword = $request->getVal( 'wpPassword' );
                $this->mNewEmail = $request->getVal( 'wpNewEmail' );
index b30605b..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,6 +59,8 @@ class SpecialChangePassword extends UnlistedSpecialPage {
                        return;
                }
 
+               $this->checkReadOnly();
+
                if( $request->wasPosted() && $user->matchEditToken( $request->getVal( 'token' ) ) ) {
                        try {
                                $this->mDomain = $wgAuth->getDomain();