Use isModEnabled
This commit is contained in:
parent
cce6d82741
commit
0dacfd3fac
@ -26,7 +26,7 @@ $langs->loadLangs(array("admin", "products"));
|
|||||||
$action = GETPOST('action', 'alphanohtml');
|
$action = GETPOST('action', 'alphanohtml');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->admin || empty($conf->variants->enabled)) {
|
if (!$user->admin || !isModEnabled('variants')) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->variants->enabled)) {
|
if (!isModEnabled('variants')) {
|
||||||
accessforbidden('Module not enabled');
|
accessforbidden('Module not enabled');
|
||||||
}
|
}
|
||||||
if ($user->socid > 0) { // Protection if external user
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
|||||||
@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->variants->enabled)) {
|
if (!isModEnabled('variants')) {
|
||||||
accessforbidden('Module not enabled');
|
accessforbidden('Module not enabled');
|
||||||
}
|
}
|
||||||
if ($user->socid > 0) { // Protection if external user
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
|||||||
@ -40,7 +40,7 @@ require '../../main.inc.php';
|
|||||||
require DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php';
|
require DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php';
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->variants->enabled)) {
|
if (!isModEnabled('variants')) {
|
||||||
accessforbidden('Module not enabled');
|
accessforbidden('Module not enabled');
|
||||||
}
|
}
|
||||||
if ($user->socid > 0) { // Protection if external user
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
|||||||
$lineid = GETPOST('lineid', 'alpha');
|
$lineid = GETPOST('lineid', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($conf->variants->enabled)) {
|
if (!isModEnabled('variants')) {
|
||||||
accessforbidden('Module not enabled');
|
accessforbidden('Module not enabled');
|
||||||
}
|
}
|
||||||
if ($user->socid > 0) { // Protection if external user
|
if ($user->socid > 0) { // Protection if external user
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user