diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /includes/specials/SpecialLockdb.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (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/SpecialLockdb.php')
-rw-r--r-- | includes/specials/SpecialLockdb.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index aad3cea4..5c861b31 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -34,12 +34,13 @@ class SpecialLockdb 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; } @@ -57,7 +58,7 @@ class SpecialLockdb 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 { @@ -109,7 +110,10 @@ class SpecialLockdb extends SpecialPage { $this->showForm( wfMsg( 'locknoconfirm' ) ); return; } - $fp = @fopen( $wgReadOnlyFile, 'w' ); + + wfSuppressWarnings(); + $fp = fopen( $wgReadOnlyFile, 'w' ); + wfRestoreWarnings(); if ( false === $fp ) { # This used to show a file not found error, but the likeliest reason for fopen() @@ -119,8 +123,14 @@ class SpecialLockdb extends SpecialPage { return; } fwrite( $fp, $this->reason ); - fwrite( $fp, "\n<p>(by " . $wgUser->getName() . " at " . - $wgContLang->timeanddate( wfTimestampNow() ) . ")</p>\n" ); + $timestamp = wfTimestampNow(); + fwrite( $fp, "\n<p>" . wfMsgExt( + 'lockedbyandtime', + array( 'content', 'parsemag' ), + $wgUser->getName(), + $wgContLang->date( $timestamp ), + $wgContLang->time( $timestamp ) + ) . "</p>\n" ); fclose( $fp ); $wgOut->redirect( $this->getTitle()->getFullURL( 'action=success' ) ); |