Errores solucionados

This commit is contained in:
Juan Ferrer Toribio 2016-10-17 14:36:52 +02:00
parent 45f8f44203
commit e373ad4522
6 changed files with 22 additions and 17 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.359-deb8) stable; urgency=low
hedera-web (1.362-deb8) stable; urgency=low
* Initial Release.

View File

@ -3,6 +3,8 @@
namespace Edi;
use Vn\Lib\Type;
use Vn\Lib\Date;
use Vn\Lib\Time;
class Segment
{
@ -18,16 +20,16 @@ class Segment
switch ($type)
{
case TYPE_DATE:
$tmp = new \Date ();
case Type::DATE:
$tmp = new Date ();
$tmp->setDate (substr ($v, 0, 4), substr ($v, 4, 2), substr ($v, 6, 2));
return $tmp;
case TYPE_TIME:
$tmp = new \Time ();
case Type::TIME:
$tmp = new Time ();
$tmp->setTime (substr ($v, 0, 2), substr ($v, 2, 2));
return $tmp;
case TYPE_DOUBLE:
case TYPE_INTEGER:
case Type::DOUBLE:
case Type::INTEGER:
Type::set ($v, $type);
default:
return $v;

View File

@ -3,6 +3,8 @@
require_once (__DIR__.'/lib/method.php');
require_once (__DIR__.'/lib/message.php');
use Vn\Lib\Type;
class Load extends Edi\Method
{
function ediRun ($db)
@ -105,19 +107,19 @@ class Load extends Edi\Method
switch ($row['type'])
{
case 'INTEGER':
$type = TYPE_INTEGER;
$type = Type::INTEGER;
break;
case 'DOUBLE':
$type = TYPE_DOUBLE;
$type = Type::DOUBLE;
break;
case 'DATE':
$type = TYPE_DATE;
$type = Type::DATE;
break;
case 'TIME':
$type = TYPE_TIME;
$type = Type::TIME;
break;
default:
$type = TYPE_STRING;
$type = Type::STRING;
}
$value = $lin->getValue (
@ -141,7 +143,7 @@ class Load extends Edi\Method
if ($res)
while ($row = $res->fetch_assoc ())
{
$value = $lin->getValue ('IMD', 2, TYPE_INTEGER, $row['feature']);
$value = $lin->getValue ('IMD', 2, Type::INTEGER, $row['feature']);
$ediValues['s'.$row['presentation_order']] = $value;
}
else

View File

@ -20,7 +20,7 @@ class Tpv
$error = NULL;
return $db->query (
'CALL transaction_confirm (#, #, #, #, #, #)',
'CALL transactionConfirm (#, #, #, #, #, #)',
[
$params['Ds_Amount']
,$params['Ds_Order']

View File

@ -38,8 +38,9 @@ class DbSessionHandler implements \SessionHandlerInterface
function read ($sessionId)
{
$this->db->query ('DO GET_LOCK(#, 10)', [$sessionId]);
$sessionData = $this->db->getValue (
'SELECT data FROM userSession WHERE ssid = #', [$sessionId]);
'SELECT data FROM userSession WHERE ssid = # FOR UPDATE', [$sessionId]);
return isset ($sessionData) ? $sessionData : '';
}
@ -51,6 +52,7 @@ class DbSessionHandler implements \SessionHandlerInterface
ON DUPLICATE KEY UPDATE
data = VALUES(data), lastUpdate = VALUES(lastUpdate)',
[$sessionId, $sessionData]);
$this->db->query ('DO RELEASE_LOCK(#)', [$sessionId]);
return TRUE;
}
}

View File

@ -48,7 +48,6 @@ abstract class Service
$db = $this->db;
ini_set ('session.cookie_secure', $this->isHttps ());
ini_set ('session.use_only_cookies', FALSE);
ini_set ('session.hash_function', 'sha256');
session_set_save_handler (new DbSessionHandler ($db));
@ -81,7 +80,7 @@ abstract class Service
// Registering the visit
if (!isset ($_COOKIE['PHPSESSID'])
if (isset ($_COOKIE['PHPSESSID'])
|| isset ($_SESSION['access'])
|| isset ($_SESSION['skipVisit']))
return;