]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 715902: Do not log personal common activities in audit_log
authorFrédéric Buclin <LpSolit@gmail.com>
Wed, 11 Jan 2012 23:08:11 +0000 (00:08 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 11 Jan 2012 23:08:11 +0000 (00:08 +0100)
r=dkl a=LpSolit

Bugzilla/Attachment.pm
Bugzilla/Bug.pm
Bugzilla/BugUrl.pm
Bugzilla/Comment.pm
Bugzilla/Flag.pm
Bugzilla/Object.pm
Bugzilla/Search/Recent.pm
Bugzilla/Search/Saved.pm

index 3a8e7d5d5ffdb7bae02f181f42fb3ab6a96b8bfe..b1f47d0cd60503264e8e117fd7797e9232d3b236 100644 (file)
@@ -72,6 +72,7 @@ use constant DB_TABLE   => 'attachments';
 use constant ID_FIELD   => 'attach_id';
 use constant LIST_ORDER => ID_FIELD;
 # Attachments are tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
 use constant AUDIT_UPDATES => 0;
 
 sub DB_COLUMNS {
index c2899f66914d1ca76383a61d1ff1dcc533143b96..ddfe5702855d00d16edc1bd40b38424b7d302249 100644 (file)
@@ -74,6 +74,7 @@ use constant ID_FIELD   => 'bug_id';
 use constant NAME_FIELD => 'alias';
 use constant LIST_ORDER => ID_FIELD;
 # Bugs have their own auditing table, bugs_activity.
+use constant AUDIT_CREATES => 0;
 use constant AUDIT_UPDATES => 0;
 
 # This is a sub because it needs to call other subroutines.
index 347d8d2324aa8fe2445a54bf7a3f12ab89e93e30..837c0d4fef1923000a6fc666fc10de73ecbc56eb 100644 (file)
@@ -35,6 +35,10 @@ use URI::QueryParam;
 use constant DB_TABLE   => 'bug_see_also';
 use constant NAME_FIELD => 'value';
 use constant LIST_ORDER => 'id';
+# See Also is tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
 
 use constant DB_COLUMNS => qw(
     id
index 1d42f04c634c1767fbd680b26c8fa1bc587ba24d..ee342fb2d29d9e29bcf4403d2f3d32f0c21eb6dd 100644 (file)
@@ -37,7 +37,9 @@ use Scalar::Util qw(blessed);
 ####    Initialization     ####
 ###############################
 
-# Updates of comments are audited in bugs_activity instead of audit_log.
+# Creation and updating of comments are audited in longdescs
+# and bugs_activity respectively instead of audit_log.
+use constant AUDIT_CREATES => 0;
 use constant AUDIT_UPDATES => 0;
 
 use constant DB_COLUMNS => qw(
index a4b5a026aeba0c878085d02d492bedcb46f75445..a727532a6a3d52f4127d91e4cffc9d2d9ee71a71 100644 (file)
@@ -75,7 +75,9 @@ use base qw(Bugzilla::Object Exporter);
 use constant DB_TABLE => 'flags';
 use constant LIST_ORDER => 'id';
 # Flags are tracked in bugs_activity.
+use constant AUDIT_CREATES => 0;
 use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
 
 use constant SKIP_REQUESTEE_ON_ERROR => 1;
 
index 29a6415b9d7c8e382fe76a6b08ad2feabc2b0269..422a2ffa5474efd6401aa2d3692940167dd20176 100644 (file)
@@ -43,7 +43,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
@@ -411,7 +413,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;
@@ -559,7 +561,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;
 }
index ccd4a0f090e2735cd89a27a6e81466a45f9cb8d3..5f04b180bb05642c8515fbbb9040f52a2e3d0a6d 100644 (file)
@@ -33,6 +33,10 @@ use Bugzilla::Util;
 
 use constant DB_TABLE => 'profile_search';
 use constant LIST_ORDER => 'id DESC';
+# Do not track buglists viewed by users.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
 
 use constant DB_COLUMNS => qw(
     id
index 9828d6e02a84858cd02d9f5ecda3f648a9a4cc75..fc773fcde6829a73392f7cb9b5c351cae8140628 100644 (file)
@@ -39,6 +39,10 @@ use Scalar::Util qw(blessed);
 #############
 
 use constant DB_TABLE => 'namedqueries';
+# Do not track buglists saved by users.
+use constant AUDIT_CREATES => 0;
+use constant AUDIT_UPDATES => 0;
+use constant AUDIT_REMOVES => 0;
 
 use constant DB_COLUMNS => qw(
     id