From bdbf87750c1769584e3e672c9ae93c71ad3de273 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 12 Jan 2012 00:05:36 +0100 Subject: Bug 715902: Do not log personal common activities in audit_log r=dkl a=LpSolit --- Bugzilla/Object.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Object.pm') diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 19297e143..1b0af509d 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -29,7 +29,9 @@ use constant VALIDATOR_DEPENDENCIES => {}; # XXX At some point, this will be joined with FIELD_MAP. use constant REQUIRED_FIELD_MAP => {}; use constant EXTRA_REQUIRED_FIELDS => (); +use constant AUDIT_CREATES => 1; use constant AUDIT_UPDATES => 1; +use constant AUDIT_REMOVES => 1; # This allows the JSON-RPC interface to return Bugzilla::Object instances # as though they were hashes. In the future, this may be modified to return @@ -397,7 +399,7 @@ sub remove_from_db { my $id_field = $self->ID_FIELD; my $dbh = Bugzilla->dbh; $dbh->bz_start_transaction(); - $self->audit_log(AUDIT_REMOVE); + $self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES; $dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id); $dbh->bz_commit_transaction(); undef $self; @@ -545,7 +547,7 @@ sub insert_create_data { Bugzilla::Hook::process('object_end_of_create', { class => $class, object => $object }); - $object->audit_log(AUDIT_CREATE); + $object->audit_log(AUDIT_CREATE) if $object->AUDIT_CREATES; return $object; } -- cgit v1.2.3-24-g4f1b