29 if (!defined(
'NOTOKENRENEWAL')) {
30 define(
'NOTOKENRENEWAL', 1);
32 if (!defined(
'NOREQUIREMENU')) {
33 define(
'NOREQUIREMENU',
'1');
35 if (!defined(
'NOREQUIREHTML')) {
36 define(
'NOREQUIREHTML',
'1');
40 require
'../../main.inc.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/authority.class.php';
46 if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
47 exit(
'BLOCKEDLOG_AUTHORITY_URL not set');
52 $auth->syncSignatureWithAuthority();
56 $blocks = $block_static->getLog(
'just_certified', 0, 0,
'rowid',
'ASC');
58 $auth->signature = $block_static->getSignature();
60 if (is_array($bocks)) {
61 foreach ($blocks as &$b) {
62 $auth->blockchain .= $b->signature;
66 $hash = $auth->getBlockchainHash();
69 $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.
'/blockedlog/ajax/authority.php?s='.urlencode($auth->signature).
'&h='.urlencode($hash);
71 $resarray =
getURLContent($url,
'GET',
'', 1, array(), array(), 2);
72 $res = $resarray[
'content'];