summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-03-11 01:24:54 +0100
committerterry%mozilla.org <>2000-03-11 01:24:54 +0100
commit983b3de9fa733c65784dbdac78663312616e368c (patch)
tree2bd9bf43e141401d78959eee05c22d241867713d /globals.pl
parentd601251a5aae95f3e16dc86ab16d07dc0dc045a6 (diff)
downloadbugzilla-983b3de9fa733c65784dbdac78663312616e368c.tar.gz
bugzilla-983b3de9fa733c65784dbdac78663312616e368c.tar.xz
Patch by Joe Robins <jmrobins@tgix.com> -- 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.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl13
1 files changed, 11 insertions, 2 deletions
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