]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Make Login/Stack.pm refuse to continue down the stack if an Auth method returns an...
authorGervase Markham <gerv@gerv.net>
Fri, 18 Nov 2011 10:15:43 +0000 (10:15 +0000)
committerGervase Markham <gerv@mozilla.org>
Fri, 18 Nov 2011 10:15:43 +0000 (10:15 +0000)
https://bugzilla.mozilla.org/show_bug.cgi?id=698423

Bugzilla/Auth/Login/Stack.pm

index 0f3661954a5801e3fc76bd7b2aa32e3acd19e1bc..e8d9c46350cee2bdac03fceabf665dbe1e259ffb 100644 (file)
@@ -28,6 +28,7 @@ use fields qw(
 );
 use Hash::Util qw(lock_keys);
 use Bugzilla::Hook;
+use Bugzilla::Constants;
 use List::MoreUtils qw(any);
 
 sub new {
@@ -60,8 +61,13 @@ sub get_login_info {
         }
         $result = $object->get_login_info(@_);
         $self->{successful} = $object;
-        last if !$result->{failure};
-        # So that if none of them succeed, it's undef.
+        
+        # We only carry on down the stack if this method denied all knowledge.
+        last unless ($result->{failure}
+                    && ($result->{failure} eq AUTH_NODATA 
+                       || $result->{failure} eq AUTH_NO_SUCH_USER));
+        
+        # If none of the methods succeed, it's undef.
         $self->{successful} = undef;
     }
     return $result;