Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.i18n.php |
— | — | @@ -42,6 +42,7 @@ |
43 | 43 | 'wminc-viewuserlang-user' => 'Username:', |
44 | 44 | 'wminc-viewuserlang-go' => 'Go', |
45 | 45 | 'wminc-userdoesnotexist' => 'The user "$1" does not exist.', |
| 46 | + 'wminc-ip' => '"$1" is an IP address.', |
46 | 47 | |
47 | 48 | # User groups |
48 | 49 | 'right-viewuserlang' => 'View [[Special:ViewUserLang|user language and test wiki]]', |
Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | 'path' => __FILE__, |
16 | 16 | 'name' => 'Wikimedia Incubator', |
17 | 17 | 'author' => 'SPQRobin', |
18 | | - 'version' => '4.3', |
| 18 | + 'version' => '4.3.1', |
19 | 19 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
20 | 20 | 'descriptionmsg' => 'wminc-desc', |
21 | 21 | ); |
Index: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php |
— | — | @@ -68,35 +68,38 @@ |
69 | 69 | */ |
70 | 70 | function showInfo( $target ) { |
71 | 71 | global $wgOut, $wmincPref, $wmincProjectSite; |
| 72 | + if( User::isIP( $target ) ) { |
| 73 | + # show error if it is an IP address |
| 74 | + return $wgOut->addHTML( Xml::span( wfMsg( 'wminc-ip', $target ), 'error' ) ); |
| 75 | + } |
72 | 76 | $user = User::newFromName( $target ); |
73 | 77 | $name = $user->getName(); |
74 | 78 | $id = $user->getId(); |
75 | 79 | $langNames = Language::getLanguageNames(); |
76 | 80 | $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
77 | 81 | if ( $user == null || $id == 0 ) { |
78 | | - // show error if a user with that name does not exist |
79 | | - $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); |
| 82 | + # show error if a user with that name does not exist |
| 83 | + return $wgOut->addHTML( Xml::span( wfMsg( 'wminc-userdoesnotexist', $target ), 'error' ) ); |
| 84 | + } |
| 85 | + $userproject = $user->getOption( $wmincPref . '-project' ); |
| 86 | + $userproject = ( $userproject ? $userproject : 'none' ); |
| 87 | + $usercode = $user->getOption( $wmincPref . '-code' ); |
| 88 | + $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); |
| 89 | + if ( IncubatorTest::isContentProject( $userproject ) ) { |
| 90 | + $testwiki = $linker->link( Title::newFromText( $prefix ) ); |
| 91 | + } elseif ( $prefix == $wmincProjectSite['short'] ) { |
| 92 | + $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); |
80 | 93 | } else { |
81 | | - $userproject = $user->getOption( $wmincPref . '-project' ); |
82 | | - $userproject = ( $userproject ? $userproject : 'none' ); |
83 | | - $usercode = $user->getOption( $wmincPref . '-code' ); |
84 | | - $prefix = IncubatorTest::displayPrefix( $userproject, $usercode ); |
85 | | - if ( IncubatorTest::isContentProject( $userproject ) ) { |
86 | | - $testwiki = $linker->link( Title::newFromText( $prefix ) ); |
87 | | - } elseif ( $prefix == $wmincProjectSite['short'] ) { |
88 | | - $testwiki = htmlspecialchars( $wmincProjectSite['name'] ); |
89 | | - } else { |
90 | | - $testwiki = wfMsgHtml( 'wminc-testwiki-none' ); |
91 | | - } |
92 | | - $wgOut->addHtml( |
93 | | - Xml::openElement( 'ul' ) . |
94 | | - '<li>' . wfMsgHtml( 'username' ) . ' ' . |
95 | | - $linker->userLink( $id, $name ) . $linker->userToolLinks( $id, $name, true ) . '</li>' . |
96 | | - '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . |
97 | | - ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . |
98 | | - '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . |
99 | | - Xml::closeElement( 'ul' ) |
100 | | - ); |
| 94 | + $testwiki = wfMsgHtml( 'wminc-testwiki-none' ); |
101 | 95 | } |
| 96 | + $wgOut->addHtml( |
| 97 | + Xml::openElement( 'ul' ) . |
| 98 | + '<li>' . wfMsgHtml( 'username' ) . ' ' . |
| 99 | + $linker->userLink( $id, $name ) . $linker->userToolLinks( $id, $name, true ) . '</li>' . |
| 100 | + '<li>' . wfMsgHtml( 'loginlanguagelabel', $langNames[$user->getOption( 'language' )] . |
| 101 | + ' (' . $user->getOption( 'language' ) . ')' ) . '</li>' . |
| 102 | + '<li>' . wfMsgHtml( 'wminc-testwiki' ) . ' ' . $testwiki . '</li>' . |
| 103 | + Xml::closeElement( 'ul' ) |
| 104 | + ); |
102 | 105 | } |
103 | 106 | } |