From 217c8f104763e8e01312602c394d71c5532e5fb8 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 19 Jan 2007 21:32:49 +0000 Subject: [PATCH] (bug 8701) Check database lock status when blocking/unblocking users --- RELEASE-NOTES | 1 + includes/SpecialBlockip.php | 7 +++++++ includes/SpecialIpblocklist.php | 12 +++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) 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( "" ); -- 2.20.1