an absolute slew of changes.
This commit is contained in:
parent
9499e17cfd
commit
e33c7bebc3
22 changed files with 80 additions and 68 deletions
|
|
@ -30,8 +30,8 @@ Get the instance of this object or create a new instance if none exists
|
|||
=cut
|
||||
|
||||
sub getInstance {
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
#Get Auth Settings
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
#Get Auth Settings
|
||||
my $authMethod = $session->user->authMethod || $session->setting->get("authMethod");
|
||||
$authMethod = $session->setting->get("authMethod") if($session->user->userId eq '1');
|
||||
$authMethod = $_[0] if($_[0] && isIn($_[0], @{$session->config->get("authMethods")}));
|
||||
|
|
@ -41,8 +41,8 @@ sub getInstance {
|
|||
my $load = "use ".$cmd;
|
||||
eval($load);
|
||||
$session->errorHandler->fatal("Authentication module failed to compile: $cmd.".$@) if($@);
|
||||
my $auth = eval{$cmd->new($session, $authMethod,$userId)};
|
||||
$session->errorHandler->fatal("Couldn't instantiate authentication module: $authMethod. Root cause: ".$@) if($@);
|
||||
my $auth = eval{$cmd->new($session, $authMethod,$userId)};
|
||||
$session->errorHandler->fatal("Couldn't instantiate authentication module: $authMethod. Root cause: ".$@) if($@);
|
||||
return $auth;
|
||||
}
|
||||
|
||||
|
|
@ -59,16 +59,16 @@ is returned.
|
|||
|
||||
sub www_auth {
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
my $auth;
|
||||
($auth) = $session->db->quickArray("select authMethod from users where username=".$session->db->quote($session->form->process("username"))) if($session->form->process("username"));
|
||||
my $authMethod = getInstance($session,$auth);
|
||||
my $methodCall = shift || $session->form->process("method") || "init";
|
||||
if(!$authMethod->isCallable($methodCall)){
|
||||
$session->errorHandler->security("access uncallable auth method");
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
return $i18n->get(1077);
|
||||
}
|
||||
return $session->style->userStyle($authMethod->$methodCall);
|
||||
my $auth;
|
||||
($auth) = $session->db->quickArray("select authMethod from users where username=".$session->db->quote($session->form->process("username"))) if($session->form->process("username"));
|
||||
my $authMethod = getInstance($session,$auth);
|
||||
my $methodCall = shift || $session->form->process("method") || "init";
|
||||
if(!$authMethod->isCallable($methodCall)){
|
||||
$session->errorHandler->security("access uncallable auth method");
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
return $i18n->get(1077);
|
||||
}
|
||||
return $session->style->userStyle($authMethod->$methodCall);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue