new non-stub Indonesian language file
[mediawiki.git] / includes / SpecialUnlockdb.php
blob80ce71bd06c9c388c088f0729efc7ce0233d1232
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
11 function wfSpecialUnlockdb() {
12 global $wgUser, $wgOut, $wgRequest;
14 if ( ! $wgUser->isDeveloper() ) {
15 $wgOut->developerRequired();
16 return;
18 $action = $wgRequest->getText( 'action' );
19 $f = new DBUnlockForm();
21 if ( "success" == $action ) { $f->showSuccess(); }
22 else if ( "submit" == $action ) { $f->doSubmit(); }
23 else { $f->showForm( "" ); }
26 /**
28 * @package MediaWiki
29 * @subpackage SpecialPage
31 class DBUnlockForm {
32 function showForm( $err )
34 global $wgOut, $wgUser, $wgLang;
36 $wgOut->setPagetitle( wfMsg( "unlockdb" ) );
37 $wgOut->addWikiText( wfMsg( "unlockdbtext" ) );
39 if ( "" != $err ) {
40 $wgOut->setSubtitle( wfMsg( "formerror" ) );
41 $wgOut->addHTML( "<p><font color='red' size='+1'>{$err}</font>\n" );
43 $lc = wfMsg( "unlockconfirm" );
44 $lb = wfMsg( "unlockbtn" );
45 $titleObj = Title::makeTitle( NS_SPECIAL, "Unlockdb" );
46 $action = $titleObj->escapeLocalURL( "action=submit" );
48 $wgOut->addHTML( "<p>
49 <form id=\"unlockdb\" method=\"post\" action=\"{$action}\">
50 <table border=0><tr>
51 <td align=right>
52 <input type=checkbox name=\"wpLockConfirm\">
53 </td>
54 <td align=\"left\">{$lc}<td>
55 </tr><tr>
56 <td>&nbsp;</td><td align=left>
57 <input type=submit name=\"wpLock\" value=\"{$lb}\">
58 </td></tr></table>
59 </form>\n" );
63 function doSubmit() {
64 global $wgOut, $wgUser, $wgLang;
65 global $wgRequest, $wgReadOnlyFile;
67 $wpLockConfirm = $wgRequest->getCheck( 'wpLockConfirm' );
68 if ( ! $wpLockConfirm ) {
69 $this->showForm( wfMsg( "locknoconfirm" ) );
70 return;
72 if ( ! unlink( $wgReadOnlyFile ) ) {
73 $wgOut->fileDeleteError( $wgReadOnlyFile );
74 return;
76 $titleObj = Title::makeTitle( NS_SPECIAL, "Unlockdb" );
77 $success = $titleObj->getFullURL( "action=success" );
78 $wgOut->redirect( $success );
81 function showSuccess() {
82 global $wgOut, $wgUser;
83 global $ip;
85 $wgOut->setPagetitle( wfMsg( "unlockdb" ) );
86 $wgOut->setSubtitle( wfMsg( "unlockdbsuccesssub" ) );
87 $wgOut->addWikiText( wfMsg( "unlockdbsuccesstext", $ip ) );