Update LogPage to ManualLogEntry

We still had three entries of "LogPage", which is legacy and has some
problems (I7bb0e92b2906a2511fc4290bdc76fc39ec4617fe). This patch updates
two of them to ManualLogEntry. The last one is handled separately in
Ic23e724997e4748c8d0da8138aa73d31b17b7064.

Change-Id: I2a4f18ea6baebdc114078c57d8937ce4ca2aace5
This commit is contained in:
Daimona Eaytoy 2018-07-12 19:46:13 +02:00
parent 4462fd5eae
commit 0815fc6a8f
2 changed files with 20 additions and 14 deletions

View file

@ -1596,21 +1596,21 @@ class AbuseFilter {
break;
}
$log = new LogPage( 'rights' );
$log->addEntry( 'rights',
$wgUser->getUserPage(),
$logEntry = new ManualLogEntry( 'rights', 'rights' );
$logEntry->setPerformer( self::getFilterUser() );
$logEntry->setTarget( $wgUser->getUserPage() );
$logEntry->setComment(
wfMessage(
'abusefilter-degroupreason',
$rule_desc,
$rule_number
)->inContentLanguage()->text(),
[
implode( ', ', $groups ),
''
],
self::getFilterUser()
)->inContentLanguage()->text()
);
$logEntry->setParameters( [
'4::oldgroups' => $groups,
'5::newgroups' => []
] );
$logEntry->publish( $logEntry->insert() );
}
break;

View file

@ -297,15 +297,21 @@ class AbuseFilterViewRevert extends AbuseFilterView {
$dbw->insert( 'user_groups', $rows, __METHOD__, [ 'IGNORE' ] );
$user->invalidateCache();
$log = new LogPage( 'rights' );
$log->addEntry( 'rights', $user->getUserPage(),
$logEntry = new ManualLogEntry( 'rights', 'rights' );
$logEntry->setTarget( $user->getUserPage() );
$logEntry->setPerformer( $this->getUser() );
$logEntry->setComment(
$this->msg(
'abusefilter-revert-reason',
$this->mPage->mFilter,
$this->mReason
)->inContentLanguage()->text(),
[ implode( ',', $currentGroups ), implode( ',', $newGroups ) ]
)->inContentLanguage()->text()
);
$logEntry->setParameters( [
'4::oldgroups' => $currentGroups,
'5::newgroups' => $newGroups
] );
$logEntry->publish( $logEntry->insert() );
return true;
}