Integrate with Renameuser

Register abuse_filter and abuse_filter_history tables.
abuse_filter_log is more difficult (if possible).

Bug: T27377
Bug: T206477
Change-Id: If8289101a08887519d5a90ef84700421b8ed2406
This commit is contained in:
Matěj Suchánek 2020-09-30 15:15:27 +02:00
parent c5a1ab7899
commit 65708afcea
3 changed files with 23 additions and 0 deletions

View file

@ -6,6 +6,7 @@ $cfg['directory_list'] = array_merge(
$cfg['directory_list'],
[
'../../extensions/CheckUser',
'../../extensions/Renameuser',
]
);
@ -13,6 +14,7 @@ $cfg['exclude_analysis_directory_list'] = array_merge(
$cfg['exclude_analysis_directory_list'],
[
'../../extensions/CheckUser',
'../../extensions/Renameuser',
]
);

View file

@ -284,6 +284,7 @@
"UploadVerifyUpload": "AbuseFilterHooks::onUploadVerifyUpload",
"UploadStashFile": "AbuseFilterHooks::onUploadStashFile",
"PageSaveComplete": "AbuseFilterHooks::onPageSaveComplete",
"RenameUserSQL": "AbuseFilterHooks::onRenameUserSQL",
"UserMergeAccountFields": "AbuseFilterHooks::onUserMergeAccountFields",
"ParserOutputStashForEdit": "AbuseFilterHooks::onParserOutputStashForEdit",
"UnitTestsAfterDatabaseSetup": "AbuseFilterHooks::onUnitTestsAfterDatabaseSetup",

View file

@ -789,6 +789,26 @@ class AbuseFilterHooks {
return $filterResult->isOK();
}
/**
* For integration with the Renameuser extension.
*
* @param RenameuserSQL $renameUserSQL
*/
public static function onRenameUserSQL( RenameuserSQL $renameUserSQL ) {
$renameUserSQL->tablesJob['abuse_filter'] = [
RenameuserSQL::NAME_COL => 'af_user_text',
RenameuserSQL::UID_COL => 'af_user',
RenameuserSQL::TIME_COL => 'af_timestamp',
'uniqueKey' => 'af_id'
];
$renameUserSQL->tablesJob['abuse_filter_history'] = [
RenameuserSQL::NAME_COL => 'afh_user_text',
RenameuserSQL::UID_COL => 'afh_user',
RenameuserSQL::TIME_COL => 'afh_timestamp',
'uniqueKey' => 'afh_id'
];
}
/**
* Tables that Extension:UserMerge needs to update
*