Fixed brainos.

This commit is contained in:
Chris 2012-03-16 14:41:07 +00:00
parent fb36598ab6
commit ad8b679ce0

View File

@ -113,8 +113,8 @@ sub load_method {
# Fetch the module name first
my $moduleh = $self -> {"dbh"} -> prepare("SELECT perl_module, active FROM ".$self -> {"settings"} -> {"database"} -> {"auth_methods"}."
WHERE id = ?");
$moduleh -> execute($module_id)
or die_log($self -> {"cgi"} -> remote_host(), "Unable to execute auth method list query: ".$self -> {"dbh"} -> errstr);
$moduleh -> execute($method_id)
or die_log($self -> {"cgi"} -> remote_host(), "Unable to execute auth method lookup query: ".$self -> {"dbh"} -> errstr);
my $module = $moduleh -> fetchrow_hashref();
return $self -> self_error("Unknown auth method requested in load_method($method_id)") if($module);
@ -125,7 +125,7 @@ sub load_method {
# Module is active, fetch its settings
my $paramh = $self -> {"dbh"} -> prepare("SELECT name, value FROM ".$self -> {"settings"} -> {"database"} -> {"auth_params"}."
WHERE method_id = ?");
$paramh -> execute($module_id)
$paramh -> execute($method_id)
or die_log($self -> {"cgi"} -> remote_host(), "Unable to execute auth method parameter query: ".$self -> {"dbh"} -> errstr);
# Build up a settings hash using the standard objects, and settings for the
@ -138,6 +138,9 @@ sub load_method {
$settings{$param -> {"name"}} = $param -> {"value"};
}
# For readability...
my $name = $module -> {"perl_module"};
no strict "refs"; # must disable strict references to allow named module loading.
eval "require $name";
die "Unable to load auth module $name: $@" if($@);