]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 499103 - page_requires_login check uses undefined variable
authorbbaetz%acm.org <>
Mon, 29 Jun 2009 09:10:21 +0000 (09:10 +0000)
committerbbaetz%acm.org <>
Mon, 29 Jun 2009 09:10:21 +0000 (09:10 +0000)
r/a=mkanat

Bugzilla.pm

index 9ce6232236156d30d4d5253bc52d3f4b6e414443..7d1b1f801da132154d27db6be8105164742144a1 100644 (file)
@@ -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.