summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-07-06 08:42:47 +0200
committerlpsolit%gmail.com <>2006-07-06 08:42:47 +0200
commit60562aad7e1d47a79a2d93db32106b3ae2d9df85 (patch)
tree3cd21dab52db59a81e47280f530a69c536a9e84b /Bugzilla/Auth
parent1369edc78cf84ba2a3cebec0a5c7ae519175de9d (diff)
downloadbugzilla-60562aad7e1d47a79a2d93db32106b3ae2d9df85.tar.gz
bugzilla-60562aad7e1d47a79a2d93db32106b3ae2d9df85.tar.xz
Bug 340967: The login form appears twice when trying to add an attachment (due to two consecutive calls to Bugzilla->login) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Login/Cookie.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/Bugzilla/Auth/Login/Cookie.pm b/Bugzilla/Auth/Login/Cookie.pm
index 41d8a2152..e2cd8f5ee 100644
--- a/Bugzilla/Auth/Login/Cookie.pm
+++ b/Bugzilla/Auth/Login/Cookie.pm
@@ -22,6 +22,8 @@ use base qw(Bugzilla::Auth::Login);
use Bugzilla::Constants;
use Bugzilla::Util;
+use List::Util qw(first);
+
use constant requires_persistence => 0;
use constant requires_verification => 0;
use constant can_login => 0;
@@ -38,6 +40,19 @@ sub get_login_info {
my $login_cookie = $cgi->cookie("Bugzilla_logincookie");
my $user_id = $cgi->cookie("Bugzilla_login");
+ # If cookies cannot be found, this could mean that they haven't
+ # been made available yet. In this case, look at Bugzilla_cookie_list.
+ unless ($login_cookie) {
+ my $cookie = first {$_->name eq 'Bugzilla_logincookie'}
+ @{$cgi->{'Bugzilla_cookie_list'}};
+ $login_cookie = $cookie->value if $cookie;
+ }
+ unless ($user_id) {
+ my $cookie = first {$_->name eq 'Bugzilla_login'}
+ @{$cgi->{'Bugzilla_cookie_list'}};
+ $user_id = $cookie->value if $cookie;
+ }
+
if ($login_cookie && $user_id) {
# Anything goes for these params - they're just strings which
# we're going to verify against the db