Fixed issues with loop variable being undefed.

This commit is contained in:
Chris 2012-03-19 13:43:54 +00:00
parent bcde3ba651
commit 4926dfd72e

View File

@ -217,12 +217,15 @@ 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"})) {
foreach $authmethod (@{$methods}) {
my $methodimpl = $self -> {"methods"} -> load_method($authmethod)
foreach $trymethod (@{$methods}) {
my $methodimpl = $self -> {"methods"} -> load_method($trymethod)
or die_log($self -> {"cgi"} -> remote_host(), "Auth implementation load failed: ".$self -> {"methods"} -> {"errstr"});
$valid = $methodimpl -> authenticate($username, $password, $self);
# If this method worked, record it.
$authmethod = $trymethod if($valid);
# If an auth method says the user is valid, stop immediately
last if($valid);
}