]> 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:05:36 +0000 (00:05 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 11 Jan 2012 23:05:36 +0000 (00:05 +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 189073d547d34cc57845b2fd488ff842a577a946..2ab494eecf684335571466d3d3b77f565a7cb69a 100644 (file)
@@ -55,6 +55,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 2fe9cc1a6bb933811036a24e36760bc34870c983..aeb2e16b72c2549fe321c156ad345262f22c491e 100644 (file)
@@ -51,6 +51,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 7778a4d7ea4075bcd6120775972659a156c5e33f..1272b55fa7047524826d9cefe03548c827d84abd 100644 (file)
@@ -22,6 +22,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 5f3d118f8c8fcb9bdd28d227451f500206b90149..549753d2b00596d8b96c4fcc7367754ef023ef51 100644 (file)
@@ -23,7 +23,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 ba2c840cc2a32c93f07566879a1ddf4fb6da729d..0ea49a4b7f9c56d9f34f30bc48d5d5bf509f3af3 100644 (file)
@@ -59,7 +59,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 19297e14383511277da8b2b22175bb7424d0cc24..1b0af509dcdc98c51a2fca2f40dee8ff421abb2e 100644 (file)
@@ -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;
 }
index cea086444ed8bbd3bc4ae361ab66ec47ef7b195b..02c3ec37a5f920199d7f88b588ccb7bfb2333bb9 100644 (file)
@@ -19,6 +19,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 bb8b62a925466204498e20adc605ff27c1d9e924..f7d5971d403ce9ba181620aefbddeb90ba94e4b2 100644 (file)
@@ -26,6 +26,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