r36763 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36762‎ | r36763 | r36764 >
Date:04:38, 28 June 2008
Author:werdna
Status:old
Tags:
Comment:
Prettify global rights log: include rights added/removed, add (none) if none are added/removed
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.i18n.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialGlobalGroupPermissions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/SpecialGlobalGroupPermissions.php
@@ -220,7 +220,7 @@
221221
222222 // Log it
223223 if (!(count($addRights)==0 && count($removeRights)==0))
224 - $this->addLogEntry( $group, $oldRights, $newRights, $reason );
 224+ $this->addLogEntry( $group, $addRights, $removeRights, $reason );
225225
226226 $this->invalidateRightsCache( $group );
227227
@@ -258,23 +258,25 @@
259259 LogEventsList::showLogExtract( $output, 'gblrights', $title->getPrefixedText() );
260260 }
261261
262 - function addLogEntry( $group, $oldRights, $newRights, $reason ) {
 262+ function addLogEntry( $group, $addRights, $removeRights, $reason ) {
263263 global $wgRequest;
264264
265265 $log = new LogPage( 'gblrights' );
 266+
 267+ $added =
266268
267 - $log->addEntry( 'groupperms',
 269+ $log->addEntry( 'groupperms2',
268270 SpecialPage::getTitleFor( 'GlobalUsers', $group ),
269271 $reason,
270272 array(
271 - $this->makeRightsList( $oldRights ),
272 - $this->makeRightsList( $newRights )
 273+ $this->makeRightsList( $addRights ),
 274+ $this->makeRightsList( $removeRights )
273275 )
274276 );
275277 }
276278
277279 function makeRightsList( $ids ) {
278 - return implode( ', ', $ids );
 280+ return (bool)count($ids) ? implode( ', ', $ids ) : wfMsg( 'rightsnone' );
279281 }
280282
281283 function invalidateRightsCache( $group ) {
Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -199,3 +199,4 @@
200200 $wgLogHeaders['gblrights'] = 'centralauth-rightslog-header';
201201 $wgLogActions['gblrights/usergroups'] = 'centralauth-rightslog-entry-usergroups';
202202 $wgLogActions['gblrights/groupperms'] = 'centralauth-rightslog-entry-groupperms';
 203+$wgLogActions['gblrights/groupperms2'] = 'centralauth-rightslog-entry-groupperms2';
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php
@@ -234,6 +234,7 @@
235235 'centralauth-rightslog-name' => 'Global rights log',
236236 'centralauth-rightslog-entry-usergroups' => 'changed global group membership for $1 from $2 to $3',
237237 'centralauth-rightslog-entry-groupperms' => 'changed group permissions for $1 from $2 to $3',
 238+ 'centralauth-rightslog-entry-groupperms' => 'changed group permissions for $1. Added $2; Removed $3',
238239 'centralauth-rightslog-header' => 'This log contains operations on global groups: membership and permissions changes',
239240
240241 // Global group membership

Status & tagging log