[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [888] branches/1.2/LedgerSMB/Session/DB.pm



Revision: 888
          http://svn.sourceforge.net/ledger-smb/?rev=888&view=rev
Author:   einhverfr
Date:     2007-03-12 19:00:42 -0700 (Mon, 12 Mar 2007)

Log Message:
-----------
Fixing 8.0 compatibility bug in session management

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Session/DB.pm

Modified: branches/1.2/LedgerSMB/Session/DB.pm
===================================================================
--- branches/1.2/LedgerSMB/Session/DB.pm	2007-03-13 01:58:51 UTC (rev 887)
+++ branches/1.2/LedgerSMB/Session/DB.pm	2007-03-13 02:00:42 UTC (rev 888)
@@ -133,11 +133,11 @@
 	my $dbh = ${LedgerSMB::Sysconfig::GLOBALDBH}; 
 
 	# TODO Change this to use %myconfig
-	my $deleteExisting = $dbh->prepare("DELETE FROM session
-											  USING users
-											  WHERE users.username = ?
-												AND users.id = session.users_id
-												AND age(last_used) > ?::interval");  
+	my $deleteExisting = $dbh->prepare(
+		"DELETE 
+		   FROM session
+		  WHERE session.users_id = (select id from users where username = ?) 
+		        AND age(last_used) > ?::interval");  
 
 	my $seedRandom = $dbh->prepare("SELECT setseed(?);");
 
@@ -195,10 +195,10 @@
 	# use the central database handle
 	my $dbh = ${LedgerSMB::Sysconfig::GLOBALDBH};
 
-	my $deleteExisting = $dbh->prepare("DELETE FROM session 
-											  USING users
-											  WHERE users.username = ?
-												AND users.id = session.users_id;");
+	my $deleteExisting = $dbh->prepare("
+		DELETE FROM session 
+		       WHERE users_id = (select id from users where username = ?)
+	");
 
 	$deleteExisting->execute($login)
 		|| $form->dberror(__FILE__.':'.__LINE__.': Delete from session: ');


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.