From b6e1285b81f407101b14e1765500641b2a004a3b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 30 Oct 2009 09:42:50 +0000 Subject: [PATCH] Fix: limit access setup page of core module to superadmin --- htdocs/admin/modules.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 25acfb51332..59d29249410 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -449,11 +449,20 @@ foreach ($orders as $key => $value) print ""; if (! empty($conf->global->$const_name)) { - // Module actif - if (! empty($objMod->always_enabled) || (($conf->global->MAIN_MODULE_MULTICOMPANY && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) print $langs->trans("Required"); - else print "numero."&action=reset&value=" . $modName . "&mode=" . $mode . "\">" . $langs->trans("Disable") . "\n"; + $disableSetup = 0; + + // Module actif + if (! empty($objMod->always_enabled) || (($conf->global->MAIN_MODULE_MULTICOMPANY && $objMod->core_enabled) && ($user->entity || $conf->entity!=1))) + { + print $langs->trans("Required"); + if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) $disableSetup++; + } + else + { + print "numero."&action=reset&value=" . $modName . "&mode=" . $mode . "\">" . $langs->trans("Disable") . "\n"; + } - if (! empty($objMod->config_page_url)) + if (! empty($objMod->config_page_url) && !$disableSetup) { if (is_array($objMod->config_page_url)) {