Index: trunk/phase3/includes/Article.php |
— | — | @@ -1208,7 +1208,7 @@ |
1209 | 1209 | public function showMissingArticle() { |
1210 | 1210 | global $wgOut, $wgRequest, $wgUser; |
1211 | 1211 | |
1212 | | - # Show info in user (talk) namespace. Does the user exist? |
| 1212 | + # Show info in user (talk) namespace. Does the user exist? Is he blocked? |
1213 | 1213 | if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) { |
1214 | 1214 | $parts = explode( '/', $this->mTitle->getText() ); |
1215 | 1215 | $rootPart = $parts[0]; |
— | — | @@ -1217,6 +1217,21 @@ |
1218 | 1218 | if ( $id == 0 && !$ip ) { # User does not exist |
1219 | 1219 | $wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1</div>", |
1220 | 1220 | array( 'userpage-userdoesnotexist-view', $rootPart ) ); |
| 1221 | + } else if (User::newFromId($id)->isBlocked()) { # Show log extract if the user is currently blocked |
| 1222 | + LogEventsList::showLogExtract( |
| 1223 | + $wgOut, |
| 1224 | + 'block', |
| 1225 | + $this->mTitle->getSubjectPage()->getPrefixedText(), |
| 1226 | + '', |
| 1227 | + array( |
| 1228 | + 'lim' => 1, |
| 1229 | + 'showIfEmpty' => false, |
| 1230 | + 'msgKey' => array( |
| 1231 | + 'sp-contributions-blocked-notice', |
| 1232 | + $this->mTitle->getSubjectPage()->getPrefixedText() # Support GENDER in notice |
| 1233 | + ) |
| 1234 | + ) |
| 1235 | + ); |
1221 | 1236 | } |
1222 | 1237 | } |
1223 | 1238 | wfRunHooks( 'ShowMissingArticle', array( $this ) ); |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -765,15 +765,31 @@ |
766 | 766 | $wgOut->wrapWikiMsg( "<div class='mw-editinginterface'>\n$1</div>", 'editinginterface' ); |
767 | 767 | } |
768 | 768 | |
769 | | - # Show a warning message when someone creates/edits a user (talk) page but the user does not exists |
| 769 | + # Show a warning message when someone creates/edits a user (talk) page but the user does not exist |
| 770 | + # Show log extract when the user is currently blocked |
770 | 771 | if ( $namespace == NS_USER || $namespace == NS_USER_TALK ) { |
771 | 772 | $parts = explode( '/', $this->mTitle->getText(), 2 ); |
772 | 773 | $username = $parts[0]; |
773 | 774 | $id = User::idFromName( $username ); |
774 | 775 | $ip = User::isIP( $username ); |
775 | | - if ( $id == 0 && !$ip ) { |
| 776 | + if ( $id == 0 && !$ip ) { # User does not exist |
776 | 777 | $wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1</div>", |
777 | 778 | array( 'userpage-userdoesnotexist', $username ) ); |
| 779 | + } else if (User::newFromId($id)->isBlocked()) { # Show log extract if the user is currently blocked |
| 780 | + LogEventsList::showLogExtract( |
| 781 | + $wgOut, |
| 782 | + 'block', |
| 783 | + $this->mTitle->getSubjectPage()->getPrefixedText(), |
| 784 | + '', |
| 785 | + array( |
| 786 | + 'lim' => 1, |
| 787 | + 'showIfEmpty' => false, |
| 788 | + 'msgKey' => array( |
| 789 | + 'sp-contributions-blocked-notice', |
| 790 | + $this->mTitle->getSubjectPage()->getPrefixedText() # Support GENDER in notice |
| 791 | + ) |
| 792 | + ) |
| 793 | + ); |
778 | 794 | } |
779 | 795 | } |
780 | 796 | # Try to add a custom edit intro, or use the standard one if this is not possible. |