From 1533b97cbe9e2e4adae47d37885476cf4f603cd7 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Mon, 29 Jun 2009 09:09:12 +0000 Subject: Bug 499103 - page_requires_login check uses undefined variable r/a=mkanat --- Bugzilla.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 1916fa508..671cda38d 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -240,15 +240,16 @@ sub login { my $authorizer = new Bugzilla::Auth(); $type = LOGIN_REQUIRED if $class->cgi->param('GoAheadAndLogIn'); + if (!defined $type || $type == LOGIN_NORMAL) { + $type = $class->params->{'requirelogin'} ? LOGIN_REQUIRED : LOGIN_NORMAL; + } + # Allow templates to know that we're in a page that always requires # login. if ($type == LOGIN_REQUIRED) { $class->request_cache->{page_requires_login} = 1; } - if (!defined $type || $type == LOGIN_NORMAL) { - $type = $class->params->{'requirelogin'} ? LOGIN_REQUIRED : LOGIN_NORMAL; - } my $authenticated_user = $authorizer->login($type); # At this point, we now know if a real person is logged in. -- cgit v1.2.3-24-g4f1b