summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-06-03 18:47:37 +0200
committerbbaetz%acm.org <>2003-06-03 18:47:37 +0200
commit1d057f02b277d29ad4d232d598c49b0344798b40 (patch)
tree5dd73500b1cf10b51875179f7559c8ec97f0b5be /query.cgi
parent3a843833f4ab5d07f10e199daa7ec317e03b9959 (diff)
downloadbugzilla-1d057f02b277d29ad4d232d598c49b0344798b40.tar.gz
bugzilla-1d057f02b277d29ad4d232d598c49b0344798b40.tar.xz
Bug 180635 - Enhance Bugzilla::User to store additional information
r=myk,jake
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi17
1 files changed, 9 insertions, 8 deletions
diff --git a/query.cgi b/query.cgi
index b9fb9f794..e450898da 100755
--- a/query.cgi
+++ b/query.cgi
@@ -53,19 +53,21 @@ ConnectToDatabase();
my $cgi = Bugzilla->cgi;
-my $userid = 0;
if (defined $::FORM{"GoAheadAndLogIn"}) {
# We got here from a login page, probably from relogin.cgi. We better
# make sure the password is legit.
- $userid = confirm_login();
+ confirm_login();
} else {
- $userid = quietly_check_login();
+ quietly_check_login();
}
+my $user = Bugzilla->user;
+my $userid = $user ? $user->id : 0;
+
# Backwards compatibility hack -- if there are any of the old QUERY_*
# cookies around, and we are logged in, then move them into the database
# and nuke the cookie. This is required for Bugzilla 2.8 and earlier.
-if ($userid) {
+if ($user) {
my @oldquerycookies;
foreach my $i (keys %::COOKIE) {
if ($i =~ /^QUERY_(.*)$/) {
@@ -97,7 +99,7 @@ if ($userid) {
}
if ($::FORM{'nukedefaultquery'}) {
- if ($userid) {
+ if ($user) {
SendSQL("DELETE FROM namedqueries " .
"WHERE userid = $userid AND name = '$::defaultqueryname'");
}
@@ -105,7 +107,7 @@ if ($::FORM{'nukedefaultquery'}) {
}
my $userdefaultquery;
-if ($userid) {
+if ($user) {
SendSQL("SELECT query FROM namedqueries " .
"WHERE userid = $userid AND name = '$::defaultqueryname'");
$userdefaultquery = FetchOneColumn();
@@ -308,7 +310,6 @@ $vars->{'rep_platform'} = \@::legal_platform;
$vars->{'op_sys'} = \@::legal_opsys;
$vars->{'priority'} = \@::legal_priority;
$vars->{'bug_severity'} = \@::legal_severity;
-$vars->{'userid'} = $userid;
# Boolean charts
my @fields;
@@ -362,7 +363,7 @@ for (my $chart = 0; $::FORM{"field$chart-0-0"}; $chart++) {
$default{'charts'} = \@charts;
# Named queries
-if ($userid) {
+if ($user) {
my @namedqueries;
SendSQL("SELECT name FROM namedqueries " .
"WHERE userid = $userid AND name != '$::defaultqueryname' " .