From 983b3de9fa733c65784dbdac78663312616e368c Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Sat, 11 Mar 2000 00:24:54 +0000 Subject: Patch by Joe Robins -- allow automatic definition of a group per project, and automatically put new bugs against that project into that group, thus allowing entire projects to be protected against viewing by unauthorized users. This is all optional, controlled by new parameters. --- globals.pl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 82447389d..8e05fc0d2 100644 --- a/globals.pl +++ b/globals.pl @@ -30,7 +30,6 @@ use strict; sub globals_pl_sillyness { my $zz; $zz = @main::chooseone; - $zz = @main::db_errstr; $zz = @main::default_column_list; $zz = $main::defaultqueryname; $zz = @main::dontchange; @@ -498,7 +497,10 @@ sub InsertNewUser { my $groupset = "0"; while (MoreSQLData()) { my @row = FetchSQLData(); - if ($username =~ m/$row[1]/) { + # Modified -Joe Robins, 2/17/00 + # Making this case insensitive, since usernames are email addresses, + # and could be any case. + if ($username =~ m/$row[1]/i) { $groupset .= "+ $row[0]"; # Silly hack to let MySQL do the math, # not Perl, since we're dealing with 64 # bit ints here, and I don't *think* Perl @@ -681,6 +683,13 @@ sub UserInGroup { return 0; } +sub GroupExists { + my ($groupname) = (@_); + ConnectToDatabase(); + SendSQL("select count(*) from groups where name=" . SqlQuote($groupname)); + my $count = FetchOneColumn(); + return $count; +} # Determines if the given bug_status string represents an "Opened" bug. This # routine ought to be paramaterizable somehow, as people tend to introduce -- cgit v1.2.3-24-g4f1b