summaryrefslogtreecommitdiff
path: root/LedgerSMB/Session
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-13 01:58:51 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-13 01:58:51 +0000
commitf5376c3c0efee31a87e4d35a4627d3bc216c4a95 (patch)
tree33b7119334026ec9b57ad0d2e42b330edcdb331c /LedgerSMB/Session
parentc1fe248cb1ec9979a615ae0673191c92034b0ab3 (diff)
Fixing 8.0 compatibility bug in session management
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@887 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Session')
-rwxr-xr-xLedgerSMB/Session/DB.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/LedgerSMB/Session/DB.pm b/LedgerSMB/Session/DB.pm
index ecd87814..eb550c62 100755
--- a/LedgerSMB/Session/DB.pm
+++ b/LedgerSMB/Session/DB.pm
@@ -133,11 +133,11 @@ sub session_create {
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 @@ sub session_destroy {
# 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: ');