* (bug 9611) Supply the blocker and reason for the cantcreateaccounttext message.
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 10 Sep 2007 06:00:45 +0000 (06:00 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 10 Sep 2007 06:00:45 +0000 (06:00 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php

index 2a5da95..1f7822c 100644 (file)
@@ -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 ===
 
index f358c1f..b1cfa9a 100644 (file)
@@ -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 );
        }