35 lines
804 B
Perl
35 lines
804 B
Perl
package WebGUI::Authentication;
|
|
|
|
use WebGUI::Authentication::LDAP;
|
|
use WebGUI::Authentication::WebGUI;
|
|
use WebGUI::SQL;
|
|
use strict;
|
|
|
|
sub saveParams {
|
|
my ($uid, $authMethod, $data, @values);
|
|
|
|
($uid, $authMethod, $data) = @_;
|
|
foreach (keys(%$data)) {
|
|
my $sql = "replace into authentication set userId=$uid, authMethod=".quote($authMethod).", fieldData=".quote($$data{$_}).", fieldName=".quote($_);
|
|
WebGUI::SQL->write($sql);
|
|
}
|
|
}
|
|
|
|
sub getParams {
|
|
my ($uid, $authMethod, $data);
|
|
|
|
$uid = shift;
|
|
$authMethod = shift;
|
|
$data = WebGUI::SQL->buildHashRef("select fieldName, fieldData from authentication where userId=$uid and authMethod='$authMethod'");
|
|
return $data;
|
|
}
|
|
|
|
sub deleteParams {
|
|
my $uid = shift;
|
|
|
|
if ($uid) {
|
|
WebGUI::SQL->write("delete from authentication where userId=$uid");
|
|
}
|
|
}
|
|
|
|
1;
|