* (bug 829) Fix URL-escaping on block success
[lhc/web/wiklou.git] / includes / SpecialLockdb.php
index 435a8dd..1635aa4 100644 (file)
@@ -1,14 +1,22 @@
 <?php
-
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/**
+ * Constructor
+ */
 function wfSpecialLockdb()
 {
-       global $wgUser, $wgOut, $wgRequest, $action;
+       global $wgUser, $wgOut, $wgRequest;
 
-       if ( ! $wgUser->isDeveloper() ) {
+       if ( ! $wgUser->isAllowed('siteadmin') ) {
                $wgOut->developerRequired();
                return;
        }
-
+       $action = $wgRequest->getVal( 'action' );
        $f = new DBLockForm();
 
        if ( "success" == $action ) { $f->showSuccess(); }
@@ -16,8 +24,13 @@ function wfSpecialLockdb()
        else { $f->showForm( "" ); }
 }
 
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class DBLockForm {
-       var $reason = "";
+       var $reason = '';
        
        function DBLockForm() {
                global $wgRequest;
@@ -27,7 +40,6 @@ class DBLockForm {
        function showForm( $err )
        {
                global $wgOut, $wgUser, $wgLang;
-               global $wpLockConfirm;
 
                $wgOut->setPagetitle( wfMsg( "lockdb" ) );
                $wgOut->addWikiText( wfMsg( "lockdbtext" ) );
@@ -42,26 +54,31 @@ class DBLockForm {
                $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>&nbsp;</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>&nbsp;</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;
 
@@ -84,8 +101,7 @@ class DBLockForm {
                $wgOut->redirect( $titleObj->getFullURL( "action=success" ) );
        }
 
-       function showSuccess()
-       {
+       function showSuccess() {
                global $wgOut, $wgUser;
 
                $wgOut->setPagetitle( wfMsg( "lockdb" ) );