Ported session storage code to support PostgreSQL
authorChris Nighswonger <cnighswonger@foundations.edu>
Wed, 14 Nov 2007 22:10:05 +0000 (16:10 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 16 Nov 2007 13:27:24 +0000 (07:27 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Auth.pm

index e189c34..d77b574 100755 (executable)
@@ -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'});