From a0fcc8ff20fe57bf442402ba227954ffb33a2175 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 15 Oct 2015 18:58:09 -0400 Subject: Bug 1196626 - log all authenticated requests --- Bugzilla/WebService/Bug.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Bugzilla/WebService/Bug.pm') 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 }; } -- cgit v1.2.3-24-g4f1b