From ec79686a7d0d3f35a546c8d9ca2ef90684253de4 Mon Sep 17 00:00:00 2001 From: DanielS Date: Wed, 11 Nov 2026 00:20:01 +0100 Subject: [PATCH] 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 --- classes/Tools.php | 8 ++++++++ config/defines_uri.inc.php | 7 +++++++ controllers/admin/AdminThemesController.php | 4 ++++ install-dev/models/install.php | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index ec57d240d..7f58ead9d 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -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); } diff --git a/config/defines_uri.inc.php b/config/defines_uri.inc.php index 7e87b56c5..14e0ad747 100644 --- a/config/defines_uri.inc.php +++ b/config/defines_uri.inc.php @@ -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'); diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index e5e4bf17b..c1e71c447 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -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; diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 055290f20..21f95a429 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -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_,