summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUnlockdb.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /includes/specials/SpecialUnlockdb.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/specials/SpecialUnlockdb.php')
-rw-r--r--includes/specials/SpecialUnlockdb.php16
1 files changed, 11 insertions, 5 deletions
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;
}