From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/specials/SpecialUnlockdb.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'includes/specials/SpecialUnlockdb.php') diff --git a/includes/specials/SpecialUnlockdb.php b/includes/specials/SpecialUnlockdb.php index c71b554b..95ad0bf5 100644 --- a/includes/specials/SpecialUnlockdb.php +++ b/includes/specials/SpecialUnlockdb.php @@ -33,12 +33,13 @@ class SpecialUnlockdb extends SpecialPage { } public function execute( $par ) { - global $wgUser, $wgOut, $wgRequest; + global $wgUser, $wgRequest; $this->setHeaders(); - if( !$wgUser->isAllowed( 'siteadmin' ) ) { - $wgOut->permissionRequired( 'siteadmin' ); + # Permission check + if( !$this->userCanExecute( $wgUser ) ) { + $this->displayRestrictionError(); return; } @@ -48,7 +49,7 @@ class SpecialUnlockdb extends SpecialPage { if ( $action == 'success' ) { $this->showSuccess(); - } else if ( $action == 'submit' && $wgRequest->wasPosted() && + } elseif ( $action == 'submit' && $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { $this->doSubmit(); } else { @@ -104,7 +105,12 @@ class SpecialUnlockdb extends SpecialPage { $this->showForm( wfMsg( 'locknoconfirm' ) ); return; } - if ( @!unlink( $wgReadOnlyFile ) ) { + + wfSuppressWarnings(); + $res = unlink( $wgReadOnlyFile ); + wfRestoreWarnings(); + + if ( !$res ) { $wgOut->showFileDeleteError( $wgReadOnlyFile ); return; } -- cgit v1.2.3-54-g00ecf