From 96587791c0cd4a8ea0cd3390c9f7f83d125c937a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 4 Dec 2002 18:58:26 +0000 Subject: [PATCH] Could not use "replace" as it is not supported by Postgres --- lib/WebGUI/Authentication.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Authentication.pm b/lib/WebGUI/Authentication.pm index baca8cd14..8ae1b1342 100644 --- a/lib/WebGUI/Authentication.pm +++ b/lib/WebGUI/Authentication.pm @@ -18,18 +18,16 @@ sub saveParams { ($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); + WebGUI::SQL->write("delete from authentication where userId=$uid and authMethod=".quote($authMethod)." and fieldName=".quote($_)); + WebGUI::SQL->write("insert into authentication (userId,authMethod,fieldData,fieldName) values ($uid,".quote($authMethod).",".quote($$data{$_}).",".quote($_).")"); } } sub getParams { - my ($uid, $authMethod, $data); - + my ($uid, $authMethod); $uid = shift; $authMethod = shift; - $data = WebGUI::SQL->buildHashRef("select fieldName, fieldData from authentication where userId=$uid and authMethod='$authMethod'"); - return $data; + return WebGUI::SQL->buildHashRef("select fieldName, fieldData from authentication where userId=$uid and authMethod='$authMethod'"); } sub deleteParams {