<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+/**
+ * Constructor
+ */
function wfSpecialLockdb()
{
global $wgUser, $wgOut, $wgRequest;
- if ( ! $wgUser->isDeveloper() ) {
+ if ( ! $wgUser->isAllowed('siteadmin') ) {
$wgOut->developerRequired();
return;
}
- $action = $wgRequest->getText( 'action' );
+ $action = $wgRequest->getVal( 'action' );
$f = new DBLockForm();
if ( "success" == $action ) { $f->showSuccess(); }
else { $f->showForm( "" ); }
}
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class DBLockForm {
- var $reason = "";
+ var $reason = '';
function DBLockForm() {
global $wgRequest;
$titleObj = Title::makeTitle( NS_SPECIAL, "Lockdb" );
$action = $titleObj->escapeLocalURL( "action=submit" );
- $wgOut->addHTML( "<p>
-<form id=\"lockdb\" method=\"post\" action=\"{$action}\">
+ $wgOut->addHTML( <<<END
+<form id="lockdb" method="post" action="{$action}">
{$elr}:
-<textarea name=\"wpLockReason\" rows=10 cols=60 wrap=virtual>
-</textarea>
-<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>
-</form>\n" );
+<textarea name="wpLockReason" rows="10" cols="60" wrap="virtual"></textarea>
+<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>
+</form>
+END
+);
}
- function doSubmit()
- {
+ function doSubmit() {
global $wgOut, $wgUser, $wgLang, $wgRequest;
global $wgReadOnlyFile;
$wgOut->redirect( $titleObj->getFullURL( "action=success" ) );
}
- function showSuccess()
- {
+ function showSuccess() {
global $wgOut, $wgUser;
$wgOut->setPagetitle( wfMsg( "lockdb" ) );