Intorduce dolDecodeBlockedData
This commit is contained in:
parent
69ef6a9316
commit
78259db0ee
@ -196,7 +196,7 @@ else if (GETPOST('downloadcsv','alpha'))
|
||||
$block_static->user_fullname = $obj->user_fullname;
|
||||
$block_static->fk_user = $obj->fk_user;
|
||||
$block_static->signature = $obj->signature;
|
||||
$block_static->object_data = unserialize($obj->object_data);
|
||||
$block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data);
|
||||
|
||||
$checksignature = $block_static->checkSignature($previoushash); // If $previoushash is not defined, checkSignature will search it
|
||||
|
||||
|
||||
@ -85,10 +85,16 @@ function formatObject($objtoshow, $prefix)
|
||||
{
|
||||
if (! is_object($val) && ! is_array($val))
|
||||
{
|
||||
// TODO $val can be '__PHP_Incomplete_Class', the is_object return false
|
||||
$s.='<tr><td>'.($prefix?$prefix.' > ':'').$key.'</td>';
|
||||
$s.='<td>';
|
||||
if (in_array($key, array('date','datef','dateh','datec','datem','datep')))
|
||||
{
|
||||
/*var_dump(is_object($val));
|
||||
var_dump(is_array($val));
|
||||
var_dump(is_array($val));
|
||||
var_dump(@get_class($val));
|
||||
var_dump($val);*/
|
||||
$s.=dol_print_date($val, 'dayhour');
|
||||
}
|
||||
else
|
||||
|
||||
@ -18,10 +18,23 @@
|
||||
* See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*ini_set('unserialize_callback_func', 'mycallback');
|
||||
|
||||
function mycallback($classname)
|
||||
{
|
||||
//var_dump($classname);
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage Blocked Log
|
||||
*/
|
||||
|
||||
class BlockedLog
|
||||
{
|
||||
/**
|
||||
@ -636,7 +649,7 @@ class BlockedLog
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->user_fullname = $obj->user_fullname;
|
||||
|
||||
$this->object_data = unserialize($obj->object_data);
|
||||
$this->object_data = $this->dolDecodeBlockedData($obj->object_data);
|
||||
|
||||
$this->signature = $obj->signature;
|
||||
$this->signature_line = $obj->signature_line;
|
||||
@ -658,6 +671,30 @@ class BlockedLog
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Decode data
|
||||
*
|
||||
* @param string $mode 0=unserialize, 1=json_decode
|
||||
* @return string Value unserialized
|
||||
*/
|
||||
public function dolDecodeBlockedData($data, $mode=0)
|
||||
{
|
||||
try
|
||||
{
|
||||
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$aaa = unserialize($data);
|
||||
//$aaa = unserialize($data);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
//print $e->getErrs);
|
||||
}
|
||||
return $aaa;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set block certified by authority
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user