Hi, i've this module prestashop, called danea upload products and i've need to null it.
I've see in the file DaneaproductsCommon.php a function to check to external url the token.
How is possible to null it? I paste here the function.
public static function refreshToken($idShop)
{
$baseUrl = _PS_BASE_URL_.__PS_BASE_URI__;
if (Configuration::get('PS_SSL_ENABLED')) {
$baseUrl = str_replace('http://', 'https://', $baseUrl);
}
$baseUrl = rtrim($baseUrl, '/');
$params = array(
'domain' => $baseUrl,
'shop_email' => Configuration::get('PS_SHOP_EMAIL'),
'source' => 'Prestashop',
'id_module' => 2,
'token' => self::getConfig('handling_token', $idShop)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://app.prestalia.it/tokenhandler/activate.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$res = json_decode($res, true);
if (empty($res)) {
return false;
}
self::setConfig('handling_length', time(), $idShop);
if (!$res['success'] ||
(isset($res['is_valid']) && $res['is_valid'] == 0)
) {
self::setConfig('handling_refresh', 0, $idShop);
return false;
}
self::setConfig('handling_length', time(), $idShop);
if ($res['msg'] == 'token_refresh_success') {
self::setConfig('handling_refresh', 1, $idShop);
return true;
}
self::setConfig('handling_token', $res['token'], $idShop);
self::setConfig('handling_refresh', 1, $idShop);
return true;
}
link for download: https://megaupload.is/FfKb61yco7/v2.1.1-daneaproducts_2_zip
I've see in the file DaneaproductsCommon.php a function to check to external url the token.
How is possible to null it? I paste here the function.
public static function refreshToken($idShop)
{
$baseUrl = _PS_BASE_URL_.__PS_BASE_URI__;
if (Configuration::get('PS_SSL_ENABLED')) {
$baseUrl = str_replace('http://', 'https://', $baseUrl);
}
$baseUrl = rtrim($baseUrl, '/');
$params = array(
'domain' => $baseUrl,
'shop_email' => Configuration::get('PS_SHOP_EMAIL'),
'source' => 'Prestashop',
'id_module' => 2,
'token' => self::getConfig('handling_token', $idShop)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://app.prestalia.it/tokenhandler/activate.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$res = json_decode($res, true);
if (empty($res)) {
return false;
}
self::setConfig('handling_length', time(), $idShop);
if (!$res['success'] ||
(isset($res['is_valid']) && $res['is_valid'] == 0)
) {
self::setConfig('handling_refresh', 0, $idShop);
return false;
}
self::setConfig('handling_length', time(), $idShop);
if ($res['msg'] == 'token_refresh_success') {
self::setConfig('handling_refresh', 1, $idShop);
return true;
}
self::setConfig('handling_token', $res['token'], $idShop);
self::setConfig('handling_refresh', 1, $idShop);
return true;
}
link for download: https://megaupload.is/FfKb61yco7/v2.1.1-daneaproducts_2_zip