From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/specials/SpecialPreferences.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'includes/specials/SpecialPreferences.php') diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index ecee0bb7..cea00fa6 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -37,14 +37,7 @@ class SpecialPreferences extends SpecialPage { $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. - $user = $this->getUser(); - if ( $user->isAnon() ) { - throw new ErrorPageError( - 'prefsnologin', - 'prefsnologintext', - array( $this->getTitle()->getPrefixedDBkey() ) - ); - } + $this->requireLogin( 'prefsnologintext2' ); $this->checkReadOnly(); if ( $par == 'reset' ) { @@ -62,7 +55,7 @@ class SpecialPreferences extends SpecialPage { ); } - $htmlForm = Preferences::getFormObject( $user, $this->getContext() ); + $htmlForm = Preferences::getFormObject( $this->getUser(), $this->getContext() ); $htmlForm->setSubmitCallback( array( 'Preferences', 'tryUISubmit' ) ); $htmlForm->show(); @@ -76,10 +69,11 @@ class SpecialPreferences extends SpecialPage { $this->getOutput()->addWikiMsg( 'prefs-reset-intro' ); $context = new DerivativeContext( $this->getContext() ); - $context->setTitle( $this->getTitle( 'reset' ) ); // Reset subpage + $context->setTitle( $this->getPageTitle( 'reset' ) ); // Reset subpage $htmlForm = new HTMLForm( array(), $context, 'prefs-restore' ); $htmlForm->setSubmitTextMsg( 'restoreprefs' ); + $htmlForm->setSubmitDestructive(); $htmlForm->setSubmitCallback( array( $this, 'submitReset' ) ); $htmlForm->suppressReset(); @@ -95,7 +89,7 @@ class SpecialPreferences extends SpecialPage { $user->resetOptions( 'all', $this->getContext() ); $user->saveSettings(); - $url = $this->getTitle()->getFullURL( 'success' ); + $url = $this->getPageTitle()->getFullURL( 'success' ); $this->getOutput()->redirect( $url ); -- cgit v1.2.3-54-g00ecf