Merge "Remove broken test."
[lhc/web/wiklou.git] / includes / specials / SpecialPreferences.php
index 38ae223..c6b2bb6 100644 (file)
@@ -39,12 +39,9 @@ class SpecialPreferences extends SpecialPage {
 
                $user = $this->getUser();
                if ( $user->isAnon() ) {
-                       $out->showErrorPage( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
-                       return;
-               }
-               if ( wfReadOnly() ) {
-                       throw new ReadOnlyError;
+                       throw new ErrorPageError( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
                }
+               $this->checkReadOnly();
 
                if ( $par == 'reset' ) {
                        $this->showResetForm();
@@ -71,7 +68,7 @@ class SpecialPreferences extends SpecialPage {
 
                $htmlForm = new HTMLForm( array(), $this->getContext(), 'prefs-restore' );
 
-               $htmlForm->setSubmitText( wfMsg( 'restoreprefs' ) );
+               $htmlForm->setSubmitTextMsg( 'restoreprefs' );
                $htmlForm->setTitle( $this->getTitle( 'reset' ) );
                $htmlForm->setSubmitCallback( array( $this, 'submitReset' ) );
                $htmlForm->suppressReset();
@@ -84,7 +81,7 @@ class SpecialPreferences extends SpecialPage {
                $user->resetOptions();
                $user->saveSettings();
 
-               $url = SpecialPage::getTitleFor( 'Preferences' )->getFullURL( 'success' );
+               $url = $this->getTitle()->getFullURL( 'success' );
 
                $this->getOutput()->redirect( $url );