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. * Initial Release.

View File

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

View File

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

View File

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

View File

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

View File

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