diff options
author | bugreport%peshkin.net <> | 2004-07-31 09:27:23 +0000 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-07-31 09:27:23 +0000 |
commit | 4c1db37570469aef2c7cc9f2ad9f859560ca8851 (patch) | |
tree | 17a519e7f08a85993b710ecd6d809bd9e4b40211 /query.cgi | |
parent | 1ffd632931b05caea45f9c48079b455d156086be (diff) | |
download | bugs-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar bugs-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.gz bugs-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.bz2 bugs-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.xz bugs-4c1db37570469aef2c7cc9f2ad9f859560ca8851.zip |
Bug 253588: Change Bugzilla->user to be usable even for a logged-out user
patch by erik,joel
r=kiko
a=justdave
Diffstat (limited to 'query.cgi')
-rwxr-xr-x | query.cgi | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -62,13 +62,12 @@ if (defined $::FORM{"GoAheadAndLogIn"}) { Bugzilla->login(); } -my $user = Bugzilla->user; -my $userid = $user ? $user->id : 0; +my $userid = Bugzilla->user->id; # 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 ($user) { +if ($userid) { my @oldquerycookies; foreach my $i ($cgi->cookie()) { if ($i =~ /^QUERY_(.*)$/) { @@ -102,7 +101,7 @@ if ($user) { } if ($::FORM{'nukedefaultquery'}) { - if ($user) { + if ($userid) { SendSQL("DELETE FROM namedqueries " . "WHERE userid = $userid AND name = '$::defaultqueryname'"); } @@ -110,7 +109,7 @@ if ($::FORM{'nukedefaultquery'}) { } my $userdefaultquery; -if ($user) { +if ($userid) { SendSQL("SELECT query FROM namedqueries " . "WHERE userid = $userid AND name = '$::defaultqueryname'"); $userdefaultquery = FetchOneColumn(); @@ -363,7 +362,7 @@ for (my $chart = 0; $::FORM{"field$chart-0-0"}; $chart++) { $default{'charts'} = \@charts; # Named queries -if ($user) { +if ($userid) { my @namedqueries; SendSQL("SELECT name FROM namedqueries " . "WHERE userid = $userid AND name != '$::defaultqueryname' " . |