Disable phone-home to api.qloapps.com
Add _QLO_DISABLE_PHONE_HOME_ (default true) and honour it in Tools::addonsRequest(), Tools::refresh(), the installer notification and the theme catalog fetch. This stops sending admin name/email, shop domain and country on install, the daily upgrade check, the admin "recommendation" HTML and module/theme catalog requests. Language and localization pack downloads stay available. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3374,6 +3374,10 @@ exit;
|
||||
protected static $is_addons_up = true;
|
||||
public static function addonsRequest($request, $params = array())
|
||||
{
|
||||
if (defined('_QLO_DISABLE_PHONE_HOME_') && _QLO_DISABLE_PHONE_HOME_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!self::$is_addons_up) {
|
||||
return false;
|
||||
}
|
||||
@@ -3485,6 +3489,10 @@ exit;
|
||||
*/
|
||||
public static function refresh($file_to_refresh, $external_file)
|
||||
{
|
||||
if (defined('_QLO_DISABLE_PHONE_HOME_') && _QLO_DISABLE_PHONE_HOME_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (self::$is_addons_up && $content = Tools::file_get_contents($external_file)) {
|
||||
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,13 @@ define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
|
||||
Tools::safeDefine('_PS_API_DOMAIN_', 'api.prestashop.com');
|
||||
Tools::safeDefine('_PS_API_URL_', 'http://'._PS_API_DOMAIN_);
|
||||
Tools::safeDefine('_PS_CURRENCY_FEED_URL_', _PS_API_URL_.'/xml/currencies.xml');
|
||||
/*
|
||||
* Phone-home kill switch: when true, no data is sent to api.qloapps.com for
|
||||
* installation notification, upgrade checks, admin recommendations or module/theme catalogs.
|
||||
* On-demand language/localization pack downloads stay available.
|
||||
* Define it as false in config/defines.inc.php (before this file) to restore upstream behaviour.
|
||||
*/
|
||||
Tools::safeDefine('_QLO_DISABLE_PHONE_HOME_', true);
|
||||
Tools::safeDefine('_QLO_API_DOMAIN_', 'api.qloapps.com');
|
||||
Tools::safeDefine('_QLO_API_URL_', 'https://'._QLO_API_DOMAIN_);
|
||||
Tools::safeDefine('_QLO_TAB_MODULE_LIST_URL_', _QLO_API_URL_.'/xml/tab_modules_list.xml');
|
||||
|
||||
@@ -2049,7 +2049,11 @@ class AdminThemesControllerCore extends AdminController
|
||||
*/
|
||||
private function getNativeModule($type = 0)
|
||||
{
|
||||
$xml = false;
|
||||
$protocols = array('https://', 'http://');
|
||||
if (defined('_QLO_DISABLE_PHONE_HOME_') && _QLO_DISABLE_PHONE_HOME_) {
|
||||
$protocols = array();
|
||||
}
|
||||
foreach ($protocols as $protocol) {
|
||||
if($xml = @simplexml_load_string(Tools::file_get_contents($protocol._QLO_API_DOMAIN_.'/xml/'.str_replace('.', '', _QLOAPPS_VERSION_).'.xml'))) {
|
||||
break;
|
||||
|
||||
@@ -634,6 +634,11 @@ class InstallModelInstall extends InstallAbstractModel
|
||||
*/
|
||||
public function setNotification($installData)
|
||||
{
|
||||
// Do not send admin name, email, domain and country to api.qloapps.com
|
||||
if (defined('_QLO_DISABLE_PHONE_HOME_') && _QLO_DISABLE_PHONE_HOME_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Tools::addonsRequest('installation', array(
|
||||
'install_data' => $installData,
|
||||
'version' => _QLO_INSTALL_VERSION_,
|
||||
|
||||
Reference in New Issue
Block a user