$::userid = 0;
if (defined $::COOKIE{"Bugzilla_login"} &&
defined $::COOKIE{"Bugzilla_logincookie"}) {
- ConnectToDatabase();
SendSQL("SELECT profiles.userid, profiles.groupset, " .
"profiles.login_name, " .
"profiles.login_name = " .
# Uncommenting the next line can help debugging...
# print "Content-type: text/plain\n\n";
- ConnectToDatabase();
# I'm going to reorganize some of this stuff a bit. Since we're adding
# a second possible validation method (LDAP), we need to move some of this
# to a later section. -Joe Robins, 8/3/00
sub GenerateVersionTable {
- ConnectToDatabase();
SendSQL("select value, program from versions order by value");
my @line;
my %varray;
if ($::usergroupset eq "0") {
return 0;
}
- ConnectToDatabase();
PushGlobalSQLState();
SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname));
my $bit = FetchOneColumn();
sub GroupExists {
my ($groupname) = (@_);
- ConnectToDatabase();
PushGlobalSQLState();
SendSQL("select count(*) from groups where name=" . SqlQuote($groupname));
my $count = FetchOneColumn();
# !!! Remove this function when the new group system is implemented!
sub GroupNameToBit {
my ($groupname) = (@_);
- ConnectToDatabase();
PushGlobalSQLState();
SendSQL("SELECT bit FROM groups WHERE name = " . SqlQuote($groupname));
my $bit = FetchOneColumn() || 0;
sub GroupIsActive {
my ($groupbit) = (@_);
$groupbit ||= 0;
- ConnectToDatabase();
PushGlobalSQLState();
SendSQL("select isactive from groups where bit=$groupbit");
my $isactive = FetchOneColumn();
sub RemoveVotes {
my ($id, $who, $reason) = (@_);
- ConnectToDatabase();
my $whopart = "";
if ($who) {
$whopart = " AND votes.who = $who";