Page MenuHomeWickedGov Phorge

GroupMembershipChangeLogFormatter.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

GroupMembershipChangeLogFormatter.php

<?php
namespace MediaWiki\Extension\CentralAuth\LogFormatter;
use MediaWiki\Logging\LogFormatter;
use MediaWiki\Logging\RightsLogFormatter;
/**
* Handles the following log types:
* - gblrights/usergroups
*/
class GroupMembershipChangeLogFormatter extends RightsLogFormatter {
/** @inheritDoc */
protected function getMessageKey() {
return 'logentry-gblrights-usergroups';
}
/** @inheritDoc */
protected function shouldProcessParams( $params ) {
return true;
}
/** @inheritDoc */
protected function getOldGroups( $params ) {
$allParams = $this->entry->getParameters();
$groupNames = $allParams['oldGroups'] ?? $params[3] ?? [];
$metadata = $allParams['oldMetadata'] ?? [];
$groups = $this->joinGroupsWithExpiries( $groupNames, $metadata );
// Legacy entries had (none) literal as a placeholder
unset( $groups['(none)'] );
return $groups;
}
/** @inheritDoc */
protected function getNewGroups( $params ) {
$allParams = $this->entry->getParameters();
$groupNames = $allParams['newGroups'] ?? $params[4] ?? [];
$metadata = $allParams['newMetadata'] ?? [];
$groups = $this->joinGroupsWithExpiries( $groupNames, $metadata );
unset( $groups['(none)'] );
return $groups;
}
/** @inheritDoc */
protected function replaceGroupsWithMemberNames( &$groupNames ) {
// Do nothing, to display the internal group ids
}
/** @inheritDoc */
protected function getParametersForApi() {
// gblrights/usergroups log entries are returned in a raw form from
// the database, without trying to normalize legacy ones. Keep that
// behavior by pinpointing to the base LogFormatter class.
return LogFormatter::getParametersForApi();
}
/** @inheritDoc */
public function formatParametersForApi() {
return LogFormatter::formatParametersForApi();
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 22:12 (2 d, 4 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
69/5f/86bee1984cf3bf10d1410ed65d4d
Default Alt Text
GroupMembershipChangeLogFormatter.php (1 KB)

Event Timeline