From e89b5f65a4b2be00f28aa4b10b5edd63f307fe18 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 10 Sep 2007 06:00:45 +0000 Subject: [PATCH] * (bug 9611) Supply the blocker and reason for the cantcreateaccounttext message. --- RELEASE-NOTES | 2 ++ includes/SpecialUserlogin.php | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2a5da951f8..1f7822c6db 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -36,6 +36,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN translations * (bug 11211) Pass, as a parameter to the protectedpagetext interface message, the level of protection. +* (bug 9611) Supply the blocker and reason for the cantcreateaccounttext + message. === API changes in 1.12 === diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index f358c1fd72..b1cfa9a3ae 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -228,7 +228,7 @@ class LoginForm { return false; } - # Check anonymous user ($wgUser) limitations : + #Â Check anonymous user ($wgUser) limitations : if (!$wgUser->isAllowedToCreateAccount()) { $this->userNotPrivilegedMessage(); return false; @@ -596,7 +596,7 @@ class LoginForm { /** */ function userBlockedMessage() { - global $wgOut; + global $wgOut, $wgUser; # Let's be nice about this, it's likely that this feature will be used # for blocking large numbers of innocent people, e.g. range blocks on @@ -611,7 +611,10 @@ class LoginForm { $wgOut->setArticleRelated( false ); $ip = wfGetIP(); - $wgOut->addWikiText( wfMsg( 'cantcreateaccounttext', $ip ) ); + $blocker = User::whoIs($wgUser->mBlock->mBy); + $block_reason = $wgUser->mBlock->mReason; + + $wgOut->addWikiText( wfMsg( 'cantcreateaccounttext', $ip, $block_reason, $blocker ) ); $wgOut->returnToMain( false ); } -- 2.20.1