$methods needs to remain in scope or $authmethod is undef.

This commit is contained in:
Chris 2012-03-19 13:27:37 +00:00
parent d63120e29d
commit bcde3ba651

View File

@ -198,6 +198,8 @@ sub valid_user {
return undef;
}
my $methods = $self -> {"methods"} -> available_methods(1);
# Does the user already have an auth method set?
my $authmethod = $self -> {"app"} -> get_user_authmethod($username);
@ -215,8 +217,6 @@ sub valid_user {
# that, if an auth method is removed for some reason, the system will try other auth
# methods instead.
if(!$valid && (!$authmethod || !$methodimpl || $self -> {"settings"} -> {"Auth:enable_fallback"})) {
my $methods = $self -> {"methods"} -> available_methods(1);
foreach $authmethod (@{$methods}) {
my $methodimpl = $self -> {"methods"} -> load_method($authmethod)
or die_log($self -> {"cgi"} -> remote_host(), "Auth implementation load failed: ".$self -> {"methods"} -> {"errstr"});