Index: trunk/extensions/ContactPage/SpecialContact.php |
— | — | @@ -52,6 +52,26 @@ |
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
| 56 | + // Blocked users cannot use the contact form. |
| 57 | + if ( $wgUser->isBlocked() ) { |
| 58 | + $wgOut->setPageTitle( wfMsg( 'blockedtitle' ) ); |
| 59 | + $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
| 60 | + $wgOut->setArticleRelated( false ); |
| 61 | + |
| 62 | + $ip = wfGetIP(); |
| 63 | + $blocker = User::whoIs( $wgUser->mBlock->mBy ); |
| 64 | + $blockReason = $wgUser->mBlock->mReason; |
| 65 | + |
| 66 | + if ( strval( $blockReason ) === '' ) { |
| 67 | + $blockReason = wfMsg( 'blockednoreason' ); |
| 68 | + } |
| 69 | + |
| 70 | + $wgOut->addWikiMsg( 'blockedtext', $ip, $blockReason, $blocker ); |
| 71 | + $wgOut->returnToMain( false ); |
| 72 | + |
| 73 | + return; |
| 74 | + } |
| 75 | + |
56 | 76 | $f = new EmailContactForm( $nu ); |
57 | 77 | |
58 | 78 | if ( 'success' == $action ) { |