Could not use "replace" as it is not supported by Postgres
This commit is contained in:
parent
f5a68ba7a8
commit
96587791c0
1 changed files with 4 additions and 6 deletions
|
|
@ -18,18 +18,16 @@ sub saveParams {
|
||||||
|
|
||||||
($uid, $authMethod, $data) = @_;
|
($uid, $authMethod, $data) = @_;
|
||||||
foreach (keys(%$data)) {
|
foreach (keys(%$data)) {
|
||||||
my $sql = "replace into authentication set userId=$uid, authMethod=".quote($authMethod).", fieldData=".quote($$data{$_}).", fieldName=".quote($_);
|
WebGUI::SQL->write("delete from authentication where userId=$uid and authMethod=".quote($authMethod)." and fieldName=".quote($_));
|
||||||
WebGUI::SQL->write($sql);
|
WebGUI::SQL->write("insert into authentication (userId,authMethod,fieldData,fieldName) values ($uid,".quote($authMethod).",".quote($$data{$_}).",".quote($_).")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getParams {
|
sub getParams {
|
||||||
my ($uid, $authMethod, $data);
|
my ($uid, $authMethod);
|
||||||
|
|
||||||
$uid = shift;
|
$uid = shift;
|
||||||
$authMethod = shift;
|
$authMethod = shift;
|
||||||
$data = WebGUI::SQL->buildHashRef("select fieldName, fieldData from authentication where userId=$uid and authMethod='$authMethod'");
|
return WebGUI::SQL->buildHashRef("select fieldName, fieldData from authentication where userId=$uid and authMethod='$authMethod'");
|
||||||
return $data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub deleteParams {
|
sub deleteParams {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue