summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-03-02 06:26:18 +0100
committermkanat%kerio.com <>2006-03-02 06:26:18 +0100
commit877a6c19c0974eb7e51856b7a2314dbee6079893 (patch)
treee4a62af31deb816ef3a0615d03196a3b3524d60d
parentc67f8c510ca7ec8f5c18e6e0d74a3a8b74f3031a (diff)
downloadbugzilla-877a6c19c0974eb7e51856b7a2314dbee6079893.tar.gz
bugzilla-877a6c19c0974eb7e51856b7a2314dbee6079893.tar.xz
Bug 328434: Move GroupIsActive into post_bug.cgi
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=justdave
-rw-r--r--globals.pl14
-rwxr-xr-xpost_bug.cgi20
2 files changed, 20 insertions, 14 deletions
diff --git a/globals.pl b/globals.pl
index 4f7b6e03a..2c7861c6b 100644
--- a/globals.pl
+++ b/globals.pl
@@ -526,20 +526,6 @@ sub GroupIdToName {
return $name;
}
-
-# Determines whether or not a group is active by checking
-# the "isactive" column for the group in the "groups" table.
-# Note: This function selects groups by id rather than by name.
-sub GroupIsActive {
- my ($groupid) = (@_);
- $groupid ||= 0;
- PushGlobalSQLState();
- SendSQL("SELECT isactive FROM groups WHERE id=$groupid");
- my $isactive = FetchOneColumn();
- PopGlobalSQLState();
- return $isactive;
-}
-
# Determines if the given bug_status string represents an "Opened" bug. This
# routine ought to be parameterizable somehow, as people tend to introduce
# new states into Bugzilla.
diff --git a/post_bug.cgi b/post_bug.cgi
index 296979b79..50ef6ecef 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -55,6 +55,26 @@ my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template;
my $vars = {};
+######################################################################
+# Subroutines
+######################################################################
+
+# Determines whether or not a group is active by checking
+# the "isactive" column for the group in the "groups" table.
+# Note: This function selects groups by id rather than by name.
+sub GroupIsActive {
+ my ($group_id) = @_;
+ $group_id ||= 0;
+ detaint_natural($group_id);
+ my ($is_active) = Bugzilla->dbh->selectrow_array(
+ "SELECT isactive FROM groups WHERE id = ?", undef, $group_id);
+ return $is_active;
+}
+
+######################################################################
+# Main Script
+######################################################################
+
# do a match on the fields if applicable
&Bugzilla::User::match_field ($cgi, {