(bug 8701) Check database lock status when blocking/unblocking users
authorRob Church <robchurch@users.mediawiki.org>
Fri, 19 Jan 2007 21:32:49 +0000 (21:32 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 19 Jan 2007 21:32:49 +0000 (21:32 +0000)
RELEASE-NOTES
includes/SpecialBlockip.php
includes/SpecialIpblocklist.php

index 06d1638..f4ef84e 100644 (file)
@@ -121,6 +121,7 @@ lighter making things easier to read.
 * (bug 8136) Introduce 'ArticleUndelete' hook; see docs/hooks.txt for more info
 * (bug 8688) Handle underscores/spaces in Special:Blockip and Special:Ipblocklist
   in a consistent manner
+* (bug 8701) Check database lock status when blocking/unblocking users
 
 == Languages updated ==
 
index 1907c16..3213fa4 100644 (file)
 function wfSpecialBlockip( $par ) {
        global $wgUser, $wgOut, $wgRequest;
 
+       # Can't block when the database is locked
+       if( wfReadOnly() ) {
+               $wgOut->readOnlyPage();
+               return;
+       }
+
+       # Permission check
        if( !$wgUser->isAllowed( 'block' ) ) {
                $wgOut->permissionRequired( 'block' );
                return;
index 0953139..b90799f 100644 (file)
@@ -10,7 +10,7 @@
  */
 function wfSpecialIpblocklist() {
        global $wgUser, $wgOut, $wgRequest;
-
+       
        $ip = $wgRequest->getVal( 'wpUnblockAddress', $wgRequest->getVal( 'ip' ) );
        $id = $wgRequest->getVal( 'id' );
        $reason = $wgRequest->getText( 'wpUnblockReason' );
@@ -27,8 +27,18 @@ function wfSpecialIpblocklist() {
                        $wgOut->permissionRequired( 'block' );
                        return;
                }
+               # Can't unblock when the database is locked
+               if( wfReadOnly() ) {
+                       $wgOut->readOnlyPage();
+                       return;
+               }
                $ipu->doSubmit();
        } else if ( "unblock" == $action ) {
+               # Can't unblock when the database is locked
+               if( wfReadOnly() ) {
+                       $wgOut->readOnlyPage();
+                       return;
+               }
                $ipu->showForm( "" );
        } else {
                $ipu->showList( "" );