Authentication modules are now configured from the config file rather than the command line.
This commit is contained in:
parent
7bca02db6d
commit
71d0d6b0c7
5 changed files with 30 additions and 33 deletions
|
|
@ -165,28 +165,13 @@ sub _time {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _loadAuthentication {
|
||||
my ($dir, @files, $file, $cmd, $namespace, $exclude);
|
||||
$dir = $session{config}{webguiRoot}.$session{os}{slash}."lib".$session{os}{slash}."WebGUI".$session{os}{slash}."Authentication";
|
||||
opendir (DIR,$dir) or WebGUI::ErrorHandler::fatalError("Can't open Authentication module directory!");
|
||||
@files = readdir(DIR);
|
||||
foreach $file (@files) {
|
||||
if ($file =~ /(.*?)\.pm$/) {
|
||||
$namespace = $1;
|
||||
$cmd = "use WebGUI::Authentication::".$namespace;
|
||||
eval($cmd);
|
||||
unless ($@) {
|
||||
$exclude = $session{config}{excludeAuthentication};
|
||||
$exclude =~ s/ //g;
|
||||
unless (isIn($namespace, split(/,/,$exclude))) {
|
||||
$session{authentication}{$namespace} = $namespace;
|
||||
}
|
||||
} else {
|
||||
WebGUI::ErrorHandler::warn("Authentication module failed to compile: $namespace. ".$@);
|
||||
$session{authentication}{failed} .= "[".$namespace."] ";
|
||||
}
|
||||
foreach my $namespace (@{$session{config}{authMethods}}) {
|
||||
my $cmd = "use WebGUI::Authentication::".$namespace;
|
||||
eval($cmd);
|
||||
if ($@) {
|
||||
WebGUI::ErrorHandler::warn("Authentication module failed to compile: $namespace. ".$@);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue