Fix test on malware

This commit is contained in:
Laurent Destailleur 2024-10-19 20:46:10 +02:00
parent b30798a2eb
commit 560829cacf
2 changed files with 26 additions and 2 deletions

View File

@ -281,6 +281,30 @@ if ($action == 'install' && $allowonlineinstall) {
}
}
/*
if (!$error) {
if (GETPOST('checkforcompliance')) {
$dir = $dirins;
$file = $modulenameval;
// $installedmodule
try {
$res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
$modName = substr($file, 0, dol_strlen($file) - 10);
if ($modName) {
if (class_exists($modName)) {
$objMod = new $modName($db);
'@phan-var-force DolibarrModules $objMod';
//var_dump($objMod);
}
}
} catch(Exception $e) {
// Nothing done
}
}
}
*/
if (!$error) {
$searchParams = array(
'search_keyword' => $modulenameval,
@ -887,7 +911,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
}
}
if ($objMod->isCoreOrExternalModule() == 'external' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
if (!is_numeric($checkRes) && $checkRes != '') {
$langs->load("errors");

View File

@ -2574,4 +2574,4 @@ SALES_ORDER_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (F
MaxNbOfRecordOnListIsOk=You have a max size for lists is set to <b>%s</b> lines. This is a good value.
YouHaveALargeAmountOfRecordOnLists=You have a default max size for lists set to <b>%s</b> lines. This is a large value that need scrolling to see all answers. It is better to have a value lower than <b>%s</b> and use pagination to see record over this number. Change this in menu Home - Setup - Display.
RoundBorders=Round borders
CheckIfModuleIsNotBlackListed=Some modules may be provided by some companies that do not respect the project's rules of goodwill (non-compliance with GDPR, violation of the rules tof use the Dolibarr brand name, etc.). By checking this box, a check will be made with the project to inform you if a report was made about this module and will protect you by blocking the deployment.
CheckIfModuleIsNotBlackListed=Some modules may be provided by some companies that do not respect the project's rules of goodwill (non-compliance with GDPR, violation of the rules tof use the Dolibarr brand name, etc.). By checking this box, a request will be made to the project server to see if a report was received about this module, and will protect you by blocking the deployment if module is flagged as this.