$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();
$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();
$user->resetOptions();
$user->saveSettings();
- $url = SpecialPage::getTitleFor( 'Preferences' )->getFullURL( 'success' );
+ $url = $this->getTitle()->getFullURL( 'success' );
$this->getOutput()->redirect( $url );