r95891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95890‎ | r95891 | r95892 >
Date:17:46, 31 August 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r95586, r95605
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/InfoPage.css (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/SpecialViewUserLang.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/WikimediaIncubator.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaIncubator/WikimediaIncubator.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/InfoPage.css
@@ -50,6 +50,6 @@
5151 #ca-nstab-main a {
5252 color: black;
5353 }
54 -#siteNotice {
55 - border-bottom: 1px solid silver;
 54+.subpages {
 55+ display: none;
5656 }
\ No newline at end of file
Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/WikimediaIncubator.php
@@ -14,7 +14,7 @@
1515 'path' => __FILE__,
1616 'name' => 'Wikimedia Incubator',
1717 'author' => 'SPQRobin',
18 - 'version' => '4.2',
 18+ 'version' => '4.3.2',
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator',
2020 'descriptionmsg' => 'wminc-desc',
2121 );
@@ -64,8 +64,8 @@
6565 $wgGroupPermissions['test-sysop']['block'] = true;
6666 $wgGroupPermissions['test-sysop']['blockemail'] = true;
6767 $wgGroupPermissions['test-sysop']['rollback'] = true;
68 -$wgAddGroups['bureaucrat']['test-sysop'] = true;
69 -$wgRemoveGroups['bureaucrat']['test-sysop'] = true;
 68+$wgAddGroups['bureaucrat'][] = 'test-sysop';
 69+$wgRemoveGroups['bureaucrat'][] = 'test-sysop';
7070
7171 $wgExtensionMessagesFiles['WikimediaIncubator'] = $dir . 'WikimediaIncubator.i18n.php';
7272 $wgExtensionAliasesFiles['WikimediaIncubator'] = $dir . 'WikimediaIncubator.alias.php';
Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/SpecialViewUserLang.php
@@ -68,35 +68,38 @@
6969 */
7070 function showInfo( $target ) {
7171 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+ }
7276 $user = User::newFromName( $target );
7377 $name = $user->getName();
7478 $id = $user->getId();
7579 $langNames = Language::getLanguageNames();
7680 $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker;
7781 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 ? $usercode : 'none' );
 89+ if ( IncubatorTest::isContentProject( $userproject ) ) {
 90+ $testwiki = $linker->link( Title::newFromText( $prefix ) );
 91+ } elseif ( $prefix == $wmincProjectSite['short'] ) {
 92+ $testwiki = htmlspecialchars( $wmincProjectSite['name'] );
8093 } 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' );
10195 }
 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+ );
102105 }
103106 }
Index: branches/wmf/1.17wmf1/extensions/WikimediaIncubator/WikimediaIncubator.i18n.php
@@ -42,6 +42,7 @@
4343 'wminc-viewuserlang-user' => 'Username:',
4444 'wminc-viewuserlang-go' => 'Go',
4545 'wminc-userdoesnotexist' => 'The user "$1" does not exist.',
 46+ 'wminc-ip' => '"$1" is an IP address.',
4647
4748 # User groups
4849 'right-viewuserlang' => 'View [[Special:ViewUserLang|user language and test wiki]]',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95586(bug 30566) Show error message if an IP is given on Special:ViewUserLang...robin23:47, 26 August 2011
r95605* InfoPage CSS fixes...robin18:35, 27 August 2011

Status & tagging log