summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialPreferences.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /includes/specials/SpecialPreferences.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
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 );