Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 06:10:17 +02:00
parent cce6d82741
commit 0dacfd3fac
5 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ $langs->loadLangs(array("admin", "products"));
$action = GETPOST('action', 'alphanohtml');
// Security check
if (!$user->admin || empty($conf->variants->enabled)) {
if (!$user->admin || !isModEnabled('variants')) {
accessforbidden();
}

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
// Security check
if (empty($conf->variants->enabled)) {
if (!isModEnabled('variants')) {
accessforbidden('Module not enabled');
}
if ($user->socid > 0) { // Protection if external user

View File

@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php';
// Security check
if (empty($conf->variants->enabled)) {
if (!isModEnabled('variants')) {
accessforbidden('Module not enabled');
}
if ($user->socid > 0) { // Protection if external user

View File

@ -40,7 +40,7 @@ require '../../main.inc.php';
require DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php';
// Security check
if (empty($conf->variants->enabled)) {
if (!isModEnabled('variants')) {
accessforbidden('Module not enabled');
}
if ($user->socid > 0) { // Protection if external user

View File

@ -43,7 +43,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$lineid = GETPOST('lineid', 'alpha');
// Security check
if (empty($conf->variants->enabled)) {
if (!isModEnabled('variants')) {
accessforbidden('Module not enabled');
}
if ($user->socid > 0) { // Protection if external user