Move some readonly around
[lhc/web/wiklou.git] / includes / specials / SpecialChangeEmail.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' );