summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2015-10-16 00:58:09 +0200
committerDylan William Hardison <dylan@hardison.net>2015-10-16 00:58:09 +0200
commita0fcc8ff20fe57bf442402ba227954ffb33a2175 (patch)
tree9a3ee457971d8c8654d1a085d2c7261b54535621 /Bugzilla/WebService
parentb21167f4de2d29d7ce4a7cd07266783032099568 (diff)
downloadbugzilla-a0fcc8ff20fe57bf442402ba227954ffb33a2175.tar.gz
bugzilla-a0fcc8ff20fe57bf442402ba227954ffb33a2175.tar.xz
Bug 1196626 - log all authenticated requests
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index d0fe8465f..d7a1d8f9b 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -458,6 +458,11 @@ sub get {
$self->_add_update_tokens($params, \@bugs, \@hashes);
+ if (Bugzilla->user->id) {
+ foreach my $bug (@bugs) {
+ Bugzilla->log_user_request($bug->id, undef, 'bug-get');
+ }
+ }
return { bugs => \@hashes, faults => \@faults };
}
@@ -1196,6 +1201,7 @@ sub attachments {
}
my %attachments;
+ my @log_attachments;
foreach my $attach (@{Bugzilla::Attachment->new_from_list($attach_ids)}) {
Bugzilla::Bug->check($attach->bug_id);
if ($attach->isprivate && !Bugzilla->user->is_insider) {
@@ -1203,10 +1209,18 @@ sub attachments {
object => 'attachment',
attach_id => $attach->id});
}
+ push @log_attachments, $attach;
+
$attachments{$attach->id} =
$self->_attachment_to_hash($attach, $params);
}
+ if (Bugzilla->user->id) {
+ foreach my $attachment (@log_attachments) {
+ Bugzilla->log_user_request($attachment->bug_id, $attachment->id, "attachment-get");
+ }
+ }
+
return { bugs => \%bugs, attachments => \%attachments };
}