Bug 150153 - ConnectToDatabase/quietly_check_login issues pt 2

r=jouni x2
parent 106f7157
...@@ -442,7 +442,6 @@ sub quietly_check_login() { ...@@ -442,7 +442,6 @@ sub quietly_check_login() {
$::userid = 0; $::userid = 0;
if (defined $::COOKIE{"Bugzilla_login"} && if (defined $::COOKIE{"Bugzilla_login"} &&
defined $::COOKIE{"Bugzilla_logincookie"}) { defined $::COOKIE{"Bugzilla_logincookie"}) {
ConnectToDatabase();
SendSQL("SELECT profiles.userid, profiles.groupset, " . SendSQL("SELECT profiles.userid, profiles.groupset, " .
"profiles.login_name, " . "profiles.login_name, " .
"profiles.login_name = " . "profiles.login_name = " .
...@@ -559,7 +558,6 @@ sub confirm_login { ...@@ -559,7 +558,6 @@ sub confirm_login {
# Uncommenting the next line can help debugging... # Uncommenting the next line can help debugging...
# print "Content-type: text/plain\n\n"; # print "Content-type: text/plain\n\n";
ConnectToDatabase();
# I'm going to reorganize some of this stuff a bit. Since we're adding # 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 # a second possible validation method (LDAP), we need to move some of this
# to a later section. -Joe Robins, 8/3/00 # to a later section. -Joe Robins, 8/3/00
......
...@@ -438,7 +438,6 @@ sub GenerateArrayCode { ...@@ -438,7 +438,6 @@ sub GenerateArrayCode {
sub GenerateVersionTable { sub GenerateVersionTable {
ConnectToDatabase();
SendSQL("select value, program from versions order by value"); SendSQL("select value, program from versions order by value");
my @line; my @line;
my %varray; my %varray;
...@@ -1251,7 +1250,6 @@ sub UserInGroup { ...@@ -1251,7 +1250,6 @@ sub UserInGroup {
if ($::usergroupset eq "0") { if ($::usergroupset eq "0") {
return 0; return 0;
} }
ConnectToDatabase();
PushGlobalSQLState(); PushGlobalSQLState();
SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname)); SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname));
my $bit = FetchOneColumn(); my $bit = FetchOneColumn();
...@@ -1274,7 +1272,6 @@ sub BugInGroup { ...@@ -1274,7 +1272,6 @@ sub BugInGroup {
sub GroupExists { sub GroupExists {
my ($groupname) = (@_); my ($groupname) = (@_);
ConnectToDatabase();
PushGlobalSQLState(); PushGlobalSQLState();
SendSQL("select count(*) from groups where name=" . SqlQuote($groupname)); SendSQL("select count(*) from groups where name=" . SqlQuote($groupname));
my $count = FetchOneColumn(); my $count = FetchOneColumn();
...@@ -1287,7 +1284,6 @@ sub GroupExists { ...@@ -1287,7 +1284,6 @@ sub GroupExists {
# !!! Remove this function when the new group system is implemented! # !!! Remove this function when the new group system is implemented!
sub GroupNameToBit { sub GroupNameToBit {
my ($groupname) = (@_); my ($groupname) = (@_);
ConnectToDatabase();
PushGlobalSQLState(); PushGlobalSQLState();
SendSQL("SELECT bit FROM groups WHERE name = " . SqlQuote($groupname)); SendSQL("SELECT bit FROM groups WHERE name = " . SqlQuote($groupname));
my $bit = FetchOneColumn() || 0; my $bit = FetchOneColumn() || 0;
...@@ -1301,7 +1297,6 @@ sub GroupNameToBit { ...@@ -1301,7 +1297,6 @@ sub GroupNameToBit {
sub GroupIsActive { sub GroupIsActive {
my ($groupbit) = (@_); my ($groupbit) = (@_);
$groupbit ||= 0; $groupbit ||= 0;
ConnectToDatabase();
PushGlobalSQLState(); PushGlobalSQLState();
SendSQL("select isactive from groups where bit=$groupbit"); SendSQL("select isactive from groups where bit=$groupbit");
my $isactive = FetchOneColumn(); my $isactive = FetchOneColumn();
...@@ -1331,7 +1326,6 @@ sub OpenStates { ...@@ -1331,7 +1326,6 @@ sub OpenStates {
sub RemoveVotes { sub RemoveVotes {
my ($id, $who, $reason) = (@_); my ($id, $who, $reason) = (@_);
ConnectToDatabase();
my $whopart = ""; my $whopart = "";
if ($who) { if ($who) {
$whopart = " AND votes.who = $who"; $whopart = " AND votes.who = $who";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment