Page MenuHomePhabricator
Authored By
Huji
Nov 24 2018, 7:52 PM
Size
2 KB
Referenced Files
None
Subscribers
None

T210329.patch

diff --git a/i18n/en.json b/i18n/en.json
index 28b14347..5b0bf0e6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -106,6 +106,7 @@
"log-action-filter-abusefilter-modify": "Filter modification",
"log-action-filter-suppress-abuselog": "Abuse log suppression",
"logentry-abusefilterprivatedetails-access": "$1 {{GENDER:$2|accessed}} private details for $3",
+ "abusefilter-privatedetails-access-via-api": "(accessed via API)",
"abusefilterprivatedetails-log-name": "AbuseFilter private details access log",
"abusefilter-management": "Abuse filter management",
"abusefilter-list": "All filters",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 320d0a1b..e35248bb 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -139,6 +139,7 @@
"log-action-filter-abusefilter-modify": "{{doc-log-action-filter-action|abusefilter|modify}}",
"log-action-filter-suppress-abuselog": "{{doc-log-action-filter-action|suppress|abuselog}}",
"logentry-abusefilterprivatedetails-access": "This message is for a log entry. Parameters:\n* $1 User who accessed the private logs\n* $2 User who accessed the private logs (used for gender)\n* $3 The log entry of which private details were accessed",
+ "abusefilter-privatedetails-access-via-api": "Shown in the logs when access to private details happened through the API",
"abusefilterprivatedetails-log-name": "Log name",
"abusefilter-management": "Title of [[Special:AbuseFilter]]",
"abusefilter-list": "Used as HTML <code><nowiki><h2></nowiki></code> heading.\n\nFollowed by the fieldset label {{msg-mw|Abusefilter-list-options}}.",
diff --git a/includes/api/ApiQueryAbuseLog.php b/includes/api/ApiQueryAbuseLog.php
index 31e06a25..c94618a2 100644
--- a/includes/api/ApiQueryAbuseLog.php
+++ b/includes/api/ApiQueryAbuseLog.php
@@ -197,6 +197,10 @@ class ApiQueryAbuseLog extends ApiQueryBase {
}
if ( $fld_ip ) {
$entry['ip'] = $row->afl_ip;
+ // Log access to private information
+ $reason = $this->msg( 'abusefilter-privatedetails-access-via-api' );
+ // TODO: Require a reason to be passed via API query, and use that in addition to above
+ SpecialAbuseLog::addLogEntry( $row->afl_id, $reason, $this->getUser() );
}
if ( $fld_wiki ) {
$entry['wiki'] = $row->afl_wiki;

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6731324
Default Alt Text
T210329.patch (2 KB)

Event Timeline