summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authorerik%dasbistro.com <>2005-02-19 07:41:09 +0100
committererik%dasbistro.com <>2005-02-19 07:41:09 +0100
commitcc73e8e4f6726abd0421c78445b18bd21b28169e (patch)
tree4cb7bf4e825e06346250e9b6aa8f5dbd76df5ae3 /Bugzilla/Search.pm
parent1ab7c9d7a1495c0f95e6e8ae12249a7ccb3c1465 (diff)
downloadbugzilla-cc73e8e4f6726abd0421c78445b18bd21b28169e.tar.gz
bugzilla-cc73e8e4f6726abd0421c78445b18bd21b28169e.tar.xz
Bug 253721: Add group-based lists to whining
Patch by Erik Stambaugh <erik@dasbistro.com> r=joel, r,a=justdave
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm23
1 files changed, 3 insertions, 20 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 816b4b0a1..e58278f48 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -40,6 +40,7 @@ use Bugzilla::Config;
use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::Constants;
+use Bugzilla::Group;
use Date::Format;
use Date::Parse;
@@ -382,7 +383,7 @@ sub init {
(
"^(?:assigned_to|reporter|qa_contact),(?:notequals|equals|anyexact),%group\\.(\\w+)%" => sub {
my $group = $1;
- my $groupid = ValidateGroupName( $group, ($user));
+ my $groupid = Bugzilla::Group::ValidateGroupName( $group, ($user));
$groupid || ThrowUserError('invalid_group_name',{name => $group});
my @childgroups = @{$user->flatten_group_membership($groupid)};
my $table = "user_group_map_$chartid";
@@ -419,7 +420,7 @@ sub init {
"^(?:cc),(?:notequals|equals|anyexact),%group\\.(\\w+)%" => sub {
my $group = $1;
- my $groupid = ValidateGroupName( $group, ($user));
+ my $groupid = Bugzilla::Group::ValidateGroupName( $group, ($user));
$groupid || ThrowUserError('invalid_group_name',{name => $group});
my @childgroups = @{$user->flatten_group_membership($groupid)};
my $chartseq = $chartid;
@@ -1495,24 +1496,6 @@ sub pronoun {
return 0;
}
-# ValidateGroupName checks to see if ANY of the users in the provided list
-# of user objects can see the named group. It returns the group id if
-# successful and undef otherwise.
-sub ValidateGroupName {
- my ($name, @users) = (@_);
- my @visible = (-1);
- foreach my $user (@users) {
- $user && push @visible, @{$user->visible_groups_direct};
- }
- my $visible = join(', ', @visible);
- my $dbh = Bugzilla->dbh;
- my $sth = $dbh->prepare("SELECT id FROM groups " .
- "WHERE name = ? AND id IN($visible)");
- $sth->execute($name);
- my ($ret) = $sth->fetchrow_array();
- return $ret;
-}
-
# Validate that the query type is one we can deal with
sub IsValidQueryType
{