diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-12-15 18:02:47 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-12-15 18:02:47 +0100 |
commit | 396b28f3d881f5debd888ba9bb9b47c2d478a76f (patch) | |
tree | 10d6e1a721ee4ef69def34a57f02d7eb3fc9e31e /includes/SpecialUnlockdb.php | |
parent | 0be4d3ccf6c4fe98a72704f9463ecdea2ee5e615 (diff) |
update to Mediawiki 1.13.3; some cleanups
Diffstat (limited to 'includes/SpecialUnlockdb.php')
-rw-r--r-- | includes/SpecialUnlockdb.php | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/includes/SpecialUnlockdb.php b/includes/SpecialUnlockdb.php deleted file mode 100644 index 74b794dd..00000000 --- a/includes/SpecialUnlockdb.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -/** - * - * @addtogroup SpecialPage - */ - -/** - * - */ -function wfSpecialUnlockdb() { - global $wgUser, $wgOut, $wgRequest; - - if( !$wgUser->isAllowed( 'siteadmin' ) ) { - $wgOut->permissionRequired( 'siteadmin' ); - return; - } - - $action = $wgRequest->getVal( 'action' ); - $f = new DBUnlockForm(); - - if ( "success" == $action ) { - $f->showSuccess(); - } else if ( "submit" == $action && $wgRequest->wasPosted() && - $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { - $f->doSubmit(); - } else { - $f->showForm( "" ); - } -} - -/** - * - * @addtogroup SpecialPage - */ -class DBUnlockForm { - function showForm( $err ) - { - global $wgOut, $wgUser; - - global $wgReadOnlyFile; - if( !file_exists( $wgReadOnlyFile ) ) { - $wgOut->addWikiMsg( 'databasenotlocked' ); - return; - } - - $wgOut->setPagetitle( wfMsg( "unlockdb" ) ); - $wgOut->addWikiMsg( "unlockdbtext" ); - - if ( "" != $err ) { - $wgOut->setSubtitle( wfMsg( "formerror" ) ); - $wgOut->addHTML( '<p class="error">' . htmlspecialchars( $err ) . "</p>\n" ); - } - $lc = htmlspecialchars( wfMsg( "unlockconfirm" ) ); - $lb = htmlspecialchars( wfMsg( "unlockbtn" ) ); - $titleObj = SpecialPage::getTitleFor( "Unlockdb" ); - $action = $titleObj->escapeLocalURL( "action=submit" ); - $token = htmlspecialchars( $wgUser->editToken() ); - - $wgOut->addHTML( <<<END - -<form id="unlockdb" method="post" action="{$action}"> -<table border="0"> - <tr> - <td align="right"> - <input type="checkbox" name="wpLockConfirm" /> - </td> - <td align="left">{$lc}</td> - </tr> - <tr> - <td> </td> - <td align="left"> - <input type="submit" name="wpLock" value="{$lb}" /> - </td> - </tr> -</table> -<input type="hidden" name="wpEditToken" value="{$token}" /> -</form> -END -); - - } - - function doSubmit() { - global $wgOut, $wgRequest, $wgReadOnlyFile; - - $wpLockConfirm = $wgRequest->getCheck( 'wpLockConfirm' ); - if ( ! $wpLockConfirm ) { - $this->showForm( wfMsg( "locknoconfirm" ) ); - return; - } - if ( @! unlink( $wgReadOnlyFile ) ) { - $wgOut->showFileDeleteError( $wgReadOnlyFile ); - return; - } - $titleObj = SpecialPage::getTitleFor( "Unlockdb" ); - $success = $titleObj->getFullURL( "action=success" ); - $wgOut->redirect( $success ); - } - - function showSuccess() { - global $wgOut; - global $ip; - - $wgOut->setPagetitle( wfMsg( "unlockdb" ) ); - $wgOut->setSubtitle( wfMsg( "unlockdbsuccesssub" ) ); - $wgOut->addWikiMsg( "unlockdbsuccesstext", $ip ); - } -} - - |