[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [887] trunk
- Subject: SF.net SVN: ledger-smb: [887] trunk
- From: ..hidden..
- Date: Mon, 12 Mar 2007 18:58:51 -0700
Revision: 887
http://svn.sourceforge.net/ledger-smb/?rev=887&view=rev
Author: einhverfr
Date: 2007-03-12 18:58:51 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
Fixing 8.0 compatibility bug in session management
Modified Paths:
--------------
trunk/LedgerSMB/AM.pm
trunk/LedgerSMB/CreditCard.pm
trunk/LedgerSMB/Form.pm
trunk/LedgerSMB/HR.pm
trunk/LedgerSMB/Session/DB.pm
trunk/sql/upgrade/1.2-1.3.sql
Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/LedgerSMB/AM.pm 2007-03-13 01:58:51 UTC (rev 887)
@@ -1316,7 +1316,7 @@
my @queryargs;
my $query = qq|
SELECT login
- FROM employee
+ FROM employees
WHERE login = ?|;
@queryargs = ($form->{login});
my $sth = $dbh->prepare($query);
@@ -1328,7 +1328,7 @@
# update name
$query = qq|
- UPDATE employee
+ UPDATE employees
SET name = ?
WHERE login = ?|;
@@ -1770,7 +1770,7 @@
$query = qq|
INSERT INTO gl (reference, employee_id)
- VALUES (?, (SELECT id FROM employee
+ VALUES (?, (SELECT id FROM employees
WHERE login = ?))|;
$dbh->prepare($query)->execute($uid, $form->{login})
Modified: trunk/LedgerSMB/CreditCard.pm
===================================================================
--- trunk/LedgerSMB/CreditCard.pm 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/LedgerSMB/CreditCard.pm 2007-03-13 01:58:51 UTC (rev 887)
@@ -15,12 +15,13 @@
# POS Credit card processing-- could be extended for ecommerce
package CreditCard;
-use LedgerSMB::CreditCard::Config;
-BEGIN {
- $gateway_module = ${Config::gateway_module};
- require "LedgerSMB/CreditCard/$gateway_module.pm";
- import $gateway_module qw(sale credit);
-}
+use LedgerSMB;
+use LedgerSMB::DBObject;
+our @ISA qw(LedgerSMB::DBObject);
+# use LedgerSMB::CreditCard::Config; # moving elsewhere
+
+## TODO: Add code for credit card number validation and the like
+
1;
Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/LedgerSMB/Form.pm 2007-03-13 01:58:51 UTC (rev 887)
@@ -1864,7 +1864,7 @@
my @whereargs = ();
# setup employees/sales contacts
my $query = qq|SELECT id, name
- FROM employee
+ FROM employees
WHERE 1 = 1|;
if ($transdate) {
Modified: trunk/LedgerSMB/HR.pm
===================================================================
--- trunk/LedgerSMB/HR.pm 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/LedgerSMB/HR.pm 2007-03-13 01:58:51 UTC (rev 887)
@@ -80,7 +80,7 @@
# get managers
$query = qq|
SELECT id, name
- FROM employee
+ FROM employees
WHERE sales = '1'
AND role = 'manager'
$notid
Modified: trunk/LedgerSMB/Session/DB.pm
===================================================================
--- trunk/LedgerSMB/Session/DB.pm 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/LedgerSMB/Session/DB.pm 2007-03-13 01:58:51 UTC (rev 887)
@@ -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: ');
Modified: trunk/sql/upgrade/1.2-1.3.sql
===================================================================
--- trunk/sql/upgrade/1.2-1.3.sql 2007-03-13 01:02:11 UTC (rev 886)
+++ trunk/sql/upgrade/1.2-1.3.sql 2007-03-13 01:58:51 UTC (rev 887)
@@ -23,4 +23,6 @@
DROP RULE employee_id_track_i ON employees; -- no longer needed
+CREATE TABLE account_links AS
+
COMMIT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.