Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -548,6 +548,7 @@ |
549 | 549 | 'noarticletextanon', |
550 | 550 | 'userpage-userdoesnotexist', |
551 | 551 | 'userpage-userdoesnotexist-view', |
| 552 | + 'blocked-notice-logextract', |
552 | 553 | 'clearyourcache', |
553 | 554 | 'usercssyoucanpreview', |
554 | 555 | 'userjsyoucanpreview', |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1212,23 +1212,23 @@ |
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]; |
1216 | | - $id = User::idFromName( $rootPart ); |
| 1216 | + $user = User::newFromName( $rootPart, false /* allow IP users*/ ); |
1217 | 1217 | $ip = User::isIP( $rootPart ); |
1218 | | - if ( $id == 0 && !$ip ) { # User does not exist |
| 1218 | + if ( !$user->isLoggedIn() && !$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 |
| 1221 | + } else if ( $user->isBlocked() ) { # Show log extract if the user is currently blocked |
1222 | 1222 | LogEventsList::showLogExtract( |
1223 | 1223 | $wgOut, |
1224 | 1224 | 'block', |
1225 | | - $this->mTitle->getSubjectPage()->getPrefixedText(), |
| 1225 | + $user->getUserPage()->getPrefixedText(), |
1226 | 1226 | '', |
1227 | 1227 | array( |
1228 | 1228 | 'lim' => 1, |
1229 | 1229 | 'showIfEmpty' => false, |
1230 | 1230 | 'msgKey' => array( |
1231 | | - 'sp-contributions-blocked-notice', |
1232 | | - $this->mTitle->getSubjectPage()->getPrefixedText() # Support GENDER in notice |
| 1231 | + 'blocked-notice-logextract', |
| 1232 | + $user->getName() # Support GENDER in notice |
1233 | 1233 | ) |
1234 | 1234 | ) |
1235 | 1235 | ); |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -779,23 +779,23 @@ |
780 | 780 | if ( $namespace == NS_USER || $namespace == NS_USER_TALK ) { |
781 | 781 | $parts = explode( '/', $this->mTitle->getText(), 2 ); |
782 | 782 | $username = $parts[0]; |
783 | | - $id = User::idFromName( $username ); |
| 783 | + $user = User::newFromName( $username, false /* allow IP users*/ ); |
784 | 784 | $ip = User::isIP( $username ); |
785 | | - if ( $id == 0 && !$ip ) { # User does not exist |
| 785 | + if ( !$user->isLoggedIn() && !$ip ) { # User does not exist |
786 | 786 | $wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1</div>", |
787 | 787 | array( 'userpage-userdoesnotexist', $username ) ); |
788 | | - } else if (User::newFromId($id)->isBlocked()) { # Show log extract if the user is currently blocked |
| 788 | + } else if ( $user->isBlocked() ) { # Show log extract if the user is currently blocked |
789 | 789 | LogEventsList::showLogExtract( |
790 | 790 | $wgOut, |
791 | 791 | 'block', |
792 | | - $this->mTitle->getSubjectPage()->getPrefixedText(), |
| 792 | + $user->getUserPage()->getPrefixedText(), |
793 | 793 | '', |
794 | 794 | array( |
795 | 795 | 'lim' => 1, |
796 | 796 | 'showIfEmpty' => false, |
797 | 797 | 'msgKey' => array( |
798 | | - 'sp-contributions-blocked-notice', |
799 | | - $this->mTitle->getSubjectPage()->getPrefixedText() # Support GENDER in notice |
| 798 | + 'blocked-notice-logextract', |
| 799 | + $user->getName() # Support GENDER in notice |
800 | 800 | ) |
801 | 801 | ) |
802 | 802 | ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1264,6 +1264,8 @@ |
1265 | 1265 | 'userpage-userdoesnotexist' => 'User account "$1" is not registered. |
1266 | 1266 | Please check if you want to create/edit this page.', |
1267 | 1267 | 'userpage-userdoesnotexist-view' => 'User account "$1" is not registered.', |
| 1268 | +'blocked-notice-logextract' => 'This user is currently blocked. |
| 1269 | +The latest block log entry is provided below for reference:', |
1268 | 1270 | 'clearyourcache' => "'''Note: After saving, you may have to bypass your browser's cache to see the changes.''' |
1269 | 1271 | '''Mozilla / Firefox / Safari:''' hold ''Shift'' while clicking ''Reload'', or press either ''Ctrl-F5'' or ''Ctrl-R'' (''Command-R'' on a Macintosh); |
1270 | 1272 | '''Konqueror: '''click ''Reload'' or press ''F5''; |