From 8b50bde81bfa9fde61cd3674c66f2693b47b67e2 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 14 Nov 2007 16:10:05 -0600 Subject: [PATCH] Ported session storage code to support PostgreSQL Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index e189c3419d..d77b574894 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1,3 +1,4 @@ + # -*- tab-width: 8 -*- # NOTE: This file uses 8-character tabs; do not change the tab size! @@ -412,9 +413,12 @@ sub checkauth { if ($storage_method eq 'mysql'){ $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh}); } + elsif ($storage_method eq 'Pg') { + $session = new CGI::Session("driver:PostgreSQL", $sessionID, {Handle=>$dbh}); + } else { # catch all defaults to tmp should work on all systems - $session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'}); + $session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'}); } C4::Context->_new_userenv($sessionID); if ($session){ @@ -501,6 +505,9 @@ sub checkauth { if ($storage_method eq 'mysql'){ $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh}); } + elsif ($storage_method eq 'Pg') { + $session = new CGI::Session("driver:PostgreSQL", $sessionID, {Handle=>$dbh}); + } else { # catch all defaults to tmp should work on all systems $session = new CGI::Session("driver:File", $sessionID, {Directory=>'/tmp'}); -- 2.39.5