r90855 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90854‎ | r90855 | r90856 >
Date:21:44, 26 June 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Follow-up r90749: use a new 'autopromote' action for the autopromote rights log entries. Removed the 'rightsautocomment' msg.
Modified paths:
  • /trunk/phase3/includes/Autopromote.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1142,8 +1142,8 @@
11431143 'rightslog',
11441144 'rightslogtext',
11451145 'rightslogentry',
 1146+ 'rightslogentry-autopromote',
11461147 'rightsnone',
1147 - 'rightsautocomment',
11481148 ),
11491149 'action' => array(
11501150 'action-read',
Index: trunk/phase3/includes/User.php
@@ -1128,9 +1128,9 @@
11291129 $newGroups = array_merge( $oldGroups, $toPromote ); // all groups
11301130
11311131 $log = new LogPage( 'rights', false /* not in RC */ );
1132 - $log->addEntry( 'rights',
 1132+ $log->addEntry( 'autopromote',
11331133 $this->getUserPage(),
1134 - wfMsgForContent( 'rightsautocomment' ),
 1134+ '', // no comment
11351135 array( implode( ', ', $oldGroups ), implode( ', ', $newGroups ) )
11361136 );
11371137 }
Index: trunk/phase3/includes/DefaultSettings.php
@@ -4846,34 +4846,35 @@
48474847 * Extensions with custom log types may add to this array.
48484848 */
48494849 $wgLogActions = array(
4850 - 'block/block' => 'blocklogentry',
4851 - 'block/unblock' => 'unblocklogentry',
4852 - 'block/reblock' => 'reblock-logentry',
4853 - 'protect/protect' => 'protectedarticle',
4854 - 'protect/modify' => 'modifiedarticleprotection',
4855 - 'protect/unprotect' => 'unprotectedarticle',
4856 - 'protect/move_prot' => 'movedarticleprotection',
4857 - 'rights/rights' => 'rightslogentry',
4858 - 'rights/disable' => 'disableaccount-logentry',
4859 - 'delete/delete' => 'deletedarticle',
4860 - 'delete/restore' => 'undeletedarticle',
4861 - 'delete/revision' => 'revdelete-logentry',
4862 - 'delete/event' => 'logdelete-logentry',
4863 - 'upload/upload' => 'uploadedimage',
4864 - 'upload/overwrite' => 'overwroteimage',
4865 - 'upload/revert' => 'uploadedimage',
4866 - 'move/move' => '1movedto2',
4867 - 'move/move_redir' => '1movedto2_redir',
4868 - 'import/upload' => 'import-logentry-upload',
4869 - 'import/interwiki' => 'import-logentry-interwiki',
4870 - 'merge/merge' => 'pagemerge-logentry',
4871 - 'suppress/revision' => 'revdelete-logentry',
4872 - 'suppress/file' => 'revdelete-logentry',
4873 - 'suppress/event' => 'logdelete-logentry',
4874 - 'suppress/delete' => 'suppressedarticle',
4875 - 'suppress/block' => 'blocklogentry',
4876 - 'suppress/reblock' => 'reblock-logentry',
4877 - 'patrol/patrol' => 'patrol-log-line',
 4850+ 'block/block' => 'blocklogentry',
 4851+ 'block/unblock' => 'unblocklogentry',
 4852+ 'block/reblock' => 'reblock-logentry',
 4853+ 'protect/protect' => 'protectedarticle',
 4854+ 'protect/modify' => 'modifiedarticleprotection',
 4855+ 'protect/unprotect' => 'unprotectedarticle',
 4856+ 'protect/move_prot' => 'movedarticleprotection',
 4857+ 'rights/rights' => 'rightslogentry',
 4858+ 'rights/autopromote' => 'rightslogentry-autopromote',
 4859+ 'rights/disable' => 'disableaccount-logentry',
 4860+ 'delete/delete' => 'deletedarticle',
 4861+ 'delete/restore' => 'undeletedarticle',
 4862+ 'delete/revision' => 'revdelete-logentry',
 4863+ 'delete/event' => 'logdelete-logentry',
 4864+ 'upload/upload' => 'uploadedimage',
 4865+ 'upload/overwrite' => 'overwroteimage',
 4866+ 'upload/revert' => 'uploadedimage',
 4867+ 'move/move' => '1movedto2',
 4868+ 'move/move_redir' => '1movedto2_redir',
 4869+ 'import/upload' => 'import-logentry-upload',
 4870+ 'import/interwiki' => 'import-logentry-interwiki',
 4871+ 'merge/merge' => 'pagemerge-logentry',
 4872+ 'suppress/revision' => 'revdelete-logentry',
 4873+ 'suppress/file' => 'revdelete-logentry',
 4874+ 'suppress/event' => 'logdelete-logentry',
 4875+ 'suppress/delete' => 'suppressedarticle',
 4876+ 'suppress/block' => 'blocklogentry',
 4877+ 'suppress/reblock' => 'reblock-logentry',
 4878+ 'patrol/patrol' => 'patrol-log-line',
48784879 );
48794880
48804881 /**
Index: trunk/phase3/includes/Autopromote.php
@@ -46,13 +46,13 @@
4747
4848 if ( isset( $wgAutopromoteOnce[$event] ) && count( $wgAutopromoteOnce[$event] ) ) {
4949 $currentGroups = $user->getGroups();
 50+ $formerGroups = $user->getFormerGroups();
5051 foreach ( $wgAutopromoteOnce[$event] as $group => $cond ) {
5152 // Do not check if the user's already a member
5253 if ( in_array( $group, $currentGroups ) ) {
5354 continue;
5455 }
5556 // Do not autopromote if the user has belonged to the group
56 - $formerGroups = $user->getFormerGroups();
5757 if ( in_array( $group, $formerGroups ) ) {
5858 continue;
5959 }
Index: trunk/phase3/includes/LogPage.php
@@ -217,7 +217,7 @@
218218 $rv = wfMsgHtml( $wgLogActions[$key] );
219219 } else {
220220 $titleLink = self::getTitleLink( $type, $skin, $title, $params );
221 - if( $key == 'rights/rights' ) {
 221+ if( preg_match( '/^rights\/(rights|autopromote)/', $key ) ) {
222222 if( $skin ) {
223223 $rightsnone = wfMsg( 'rightsnone' );
224224 foreach ( $params as &$param ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1978,11 +1978,11 @@
19791979 'right-sendemail' => 'Send e-mail to other users',
19801980
19811981 # User rights log
1982 -'rightslog' => 'User rights log',
1983 -'rightslogtext' => 'This is a log of changes to user rights.',
1984 -'rightslogentry' => 'changed group membership for $1 from $2 to $3',
1985 -'rightsnone' => '(none)',
1986 -'rightsautocomment' => 'automatically promoted',
 1982+'rightslog' => 'User rights log',
 1983+'rightslogtext' => 'This is a log of changes to user rights.',
 1984+'rightslogentry' => 'changed group membership for $1 from $2 to $3',
 1985+'rightslogentry-autopromote' => 'was automatically promoted from $2 to $3',
 1986+'rightsnone' => '(none)',
19871987
19881988 # Associated actions - in the sentence "You do not have permission to X"
19891989 'action-read' => 'read this page',

Sign-offs

UserFlagDate
Nikerabbitinspected22:06, 28 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90749Added one-time promote support via Autopromote::autopromoteOnceHook function....aaron02:52, 25 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   22:05, 28 June 2011

Should use tabs in trunk/phase3/maintenance/language/messages.inc.

#Comment by Nikerabbit (talk | contribs)   08:46, 3 September 2011

Please add message documentation for rightslogentry-autopromote.

#Comment by Aaron Schulz (talk | contribs)   19:21, 3 September 2011

It already has a qqq entry.

#Comment by Nikerabbit (talk | contribs)   19:39, 3 September 2011

Yep. Siebrand was too fast :)

Status & tagging log