Fix replace file_get_contents with getURLContent
This commit is contained in:
parent
ae3a0fce71
commit
13e64d2f79
@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/blockedlog/ajax/block-info.php
|
* \file htdocs/blockedlog/ajax/check_signature.php
|
||||||
* \ingroup blockedlog
|
* \ingroup blockedlog
|
||||||
* \brief block-info
|
* \brief This page is not used yet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -38,13 +38,15 @@ if (!defined('NOREQUIREHTML')) {
|
|||||||
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
|
||||||
|
|
||||||
|
|
||||||
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
|
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
|
||||||
exit('BLOCKEDLOG_AUTHORITY_URL not set');
|
exit('BLOCKEDLOG_AUTHORITY_URL not set');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
|
|
||||||
|
|
||||||
$auth = new BlockedLogAuthority($db);
|
$auth = new BlockedLogAuthority($db);
|
||||||
$auth->syncSignatureWithAuthority();
|
$auth->syncSignatureWithAuthority();
|
||||||
@ -63,8 +65,11 @@ if (is_array($bocks)) {
|
|||||||
|
|
||||||
$hash = $auth->getBlockchainHash();
|
$hash = $auth->getBlockchainHash();
|
||||||
|
|
||||||
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$auth->signature.'&h='.$hash;
|
// Call external authority
|
||||||
|
$url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.urlencode($auth->signature).'&h='.urlencode($hash);
|
||||||
|
|
||||||
|
$resarray = getURLContent($url, 'GET', '', 1, array(), array(), 2);
|
||||||
|
$res = $resarray['content'];
|
||||||
|
|
||||||
$res = file_get_contents($url);
|
|
||||||
//echo $url;
|
//echo $url;
|
||||||
echo $res;
|
echo dol_escape_htmltag($res);
|
||||||
|
|||||||
@ -66,10 +66,12 @@ class GoogleAPI
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
// Desired address
|
// Desired address
|
||||||
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
|
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".urlencode($this->key);
|
||||||
|
|
||||||
// Retrieve the URL contents
|
// Retrieve the URL contents
|
||||||
$page = file_get_contents($urladdress);
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
|
$pagearray = getURLContent($urladdress, 'GET');
|
||||||
|
$page = $pagearray['content'];
|
||||||
|
|
||||||
$code = strstr($page, '<coordinates>');
|
$code = strstr($page, '<coordinates>');
|
||||||
$code = strstr($code, '>');
|
$code = strstr($code, '>');
|
||||||
|
|||||||
@ -58,7 +58,8 @@ foreach ($result as $driver) {
|
|||||||
$classname = 'printing_'.$driver;
|
$classname = 'printing_'.$driver;
|
||||||
$langs->load($driver);
|
$langs->load($driver);
|
||||||
$printer = new $classname($db);
|
$printer = new $classname($db);
|
||||||
if ($conf->global->{$printer->active}) {
|
$keyforprinteractive = $printer->active;
|
||||||
|
if ($keyforprinteractive && $conf->global->$keyforprinteractive) {
|
||||||
//$printer->listJobs('commande');
|
//$printer->listJobs('commande');
|
||||||
$result = $printer->listJobs();
|
$result = $printer->listJobs();
|
||||||
print $printer->resprint;
|
print $printer->resprint;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user