From: Rob Church Date: Fri, 19 Jan 2007 21:32:49 +0000 (+0000) Subject: (bug 8701) Check database lock status when blocking/unblocking users X-Git-Tag: 1.31.0-rc.0~54294 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=217c8f104763e8e01312602c394d71c5532e5fb8;p=lhc%2Fweb%2Fwiklou.git (bug 8701) Check database lock status when blocking/unblocking users --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 06d163881b..f4ef84ecde 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 1907c164ad..3213fa45e4 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -12,6 +12,13 @@ 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; diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index 09531390b6..b90799f4c1 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -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( "" );