diff options
author | bugreport%peshkin.net <> | 2002-09-23 02:14:48 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2002-09-23 02:14:48 +0200 |
commit | 65d3dc0ec33fd76229dc02536a74ccac5408876b (patch) | |
tree | bcacbb27e99c73f9548e92408fadb2e369f0543b /processmail | |
parent | cf9b4ba2e757925eeb18bb63411ae30c8600c643 (diff) | |
download | bugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.gz bugzilla-65d3dc0ec33fd76229dc02536a74ccac5408876b.tar.xz |
bug 157756 - Groups_20020716_Branch Tracking : > 55 groups now supported
r=bbaetz, gerv
Diffstat (limited to 'processmail')
-rwxr-xr-x | processmail | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/processmail b/processmail index 45aaacc77..a47297597 100755 --- a/processmail +++ b/processmail @@ -632,14 +632,17 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { } - SendSQL("SELECT userid, groupset " . + SendSQL("SELECT userid, (refreshed_when > " . SqlQuote($::last_changed) . ") " . "FROM profiles WHERE login_name = " . SqlQuote($person)); - my ($userid, $groupset) = (FetchSQLData()); + my ($userid, $current) = (FetchSQLData()); $seen{$person} = 1; detaint_natural($userid); - detaint_natural($groupset); + + if (!$current) { + DeriveGroup($userid); + } # if this person doesn't have permission to see info on this bug, # return. @@ -649,19 +652,13 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { # see the action of restricting the bug itself; the bug will just # quietly disappear from their radar. # - return unless CanSeeBug($id, $userid, $groupset); + return unless CanSeeBug($id, $userid); + # Drop any non-insiders if the comment is private - if (Param("insidergroup") && ($anyprivate != 0)) { - ConnectToDatabase(); - PushGlobalSQLState(); - SendSQL("select (bit & $groupset ) != 0 from groups where name = " . SqlQuote(Param("insidergroup"))); - my $bit = FetchOneColumn(); - PopGlobalSQLState(); - if (!$bit) { - return; - } - } + return if (Param("insidergroup") && + ($anyprivate != 0) && + (!UserInGroup(Param("insidergroup"), $userid))); # We shouldn't send changedmail if this is a dependency mail, and any of # the depending bugs is not visible to the user. @@ -669,7 +666,7 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { my $save_id = $dep_id; detaint_natural($dep_id) || warn("Unexpected Error: \@depbugs contains a non-numeric value: '$save_id'") && return; - return unless CanSeeBug($dep_id, $userid, $groupset); + return unless CanSeeBug($dep_id, $userid); } my %mailhead = %defmailhead; @@ -781,6 +778,14 @@ if (open(FID, "<data/nomail")) { close FID; } +# Since any email recipients must be rederived if the user has not +# been rederived since the most recent group change, figure out when that +# is once and determine the need to rederive users using the same DB access +# that gets the user's email address each time a person is processed. +# +SendSQL("SELECT MAX(last_changed) FROM groups"); +($::last_changed) = FetchSQLData(); + if ($#ARGV >= 0 && $ARGV[0] eq "regenerate") { print "Regenerating is no longer required or supported\n"; exit; |