summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialPreferences.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialPreferences.php')
-rw-r--r--includes/specials/SpecialPreferences.php16
1 files changed, 5 insertions, 11 deletions
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 );