Buongiorno,
ho visto la seguente funzione nel file ps_tanzopostepay.php ma non ho capito a cosa serva.
Sembra inviare a Tanzo la lista degli account ma non ne capisco la necessità.
public function check()
{
if (function_exists('curl_exec')) {
$id_shop = Context::getContext()->shop->id;
$shop_url = ShopUrl::getMainShopDomain($id_shop);
$srv_ip = $_SERVER['SERVER_ADDR'];
$httphost = self::getHttpHost();
if(!filter_var($srv_ip, FILTER_VALIDATE_IP)){
$host = gethostname();
}
$module_name = self::getMyModuleName();
$employees = Employee::getEmployees(false);
$emp = '';
foreach($employees AS $employee) {
$emp_obj = new Employee((int)$employee['id_employee']);
$emp .= 'firstname:'.$emp_obj->firstname.' lastname:'.$emp_obj->lastname.' Email:'.$emp_obj->email.'-';
}
$fields = array(
'mdlnm' => $module_name,
'email' => Configuration::get('PS_SHOP_EMAIL'),
'employees' => $emp,
'shopurl' => $shop_url,
'srvip' => $srv_ip,
'httphost' => $httphost
);
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_URL, 'https://helpdesk.tanzo.it/cth');
@curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
@curl_setopt($ch, CURLOPT_VERBOSE, false);
@curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$response = @curl_exec($ch);
$status_code = (int)@curl_getinfo($ch, CURLINFO_HTTP_CODE);
@curl_close($ch);
}
return true;
}
A cosa serve?