X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialUnlockdb.php;h=52025e535371abbec6831fd1172834a4fb0328d0;hb=2cdff4cf67b77a3a7bb54c656a05bfe8a529ae3d;hp=a10d1ee0a5ebda7f6e5966c12e30ffbde69c22d7;hpb=02547dac72e11c4ee5932e6418e22d3600df0926;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialUnlockdb.php b/includes/SpecialUnlockdb.php index a10d1ee0a5..52025e5353 100644 --- a/includes/SpecialUnlockdb.php +++ b/includes/SpecialUnlockdb.php @@ -1,8 +1,7 @@ isAllowed('siteadmin') ) { - $wgOut->developerRequired(); + if( !$wgUser->isAllowed( 'siteadmin' ) ) { + $wgOut->permissionRequired( 'siteadmin' ); return; } + $action = $wgRequest->getVal( 'action' ); $f = new DBUnlockForm(); @@ -30,14 +30,19 @@ function wfSpecialUnlockdb() { /** * - * @package MediaWiki - * @subpackage SpecialPage + * @addtogroup SpecialPage */ class DBUnlockForm { function showForm( $err ) { global $wgOut, $wgUser; + global $wgReadOnlyFile; + if( !file_exists( $wgReadOnlyFile ) ) { + $wgOut->addWikiText( wfMsg( 'databasenotlocked' ) ); + return; + } + $wgOut->setPagetitle( wfMsg( "unlockdb" ) ); $wgOut->addWikiText( wfMsg( "unlockdbtext" ) ); @@ -47,7 +52,7 @@ class DBUnlockForm { } $lc = htmlspecialchars( wfMsg( "unlockconfirm" ) ); $lb = htmlspecialchars( wfMsg( "unlockbtn" ) ); - $titleObj = Title::makeTitle( NS_SPECIAL, "Unlockdb" ); + $titleObj = SpecialPage::getTitleFor( "Unlockdb" ); $action = $titleObj->escapeLocalURL( "action=submit" ); $token = htmlspecialchars( $wgUser->editToken() ); @@ -87,7 +92,7 @@ END $wgOut->showFileDeleteError( $wgReadOnlyFile ); return; } - $titleObj = Title::makeTitle( NS_SPECIAL, "Unlockdb" ); + $titleObj = SpecialPage::getTitleFor( "Unlockdb" ); $success = $titleObj->getFullURL( "action=success" ); $wgOut->redirect( $success ); } @@ -102,4 +107,4 @@ END } } -?> +