Fix: Can manage permissions for module on 2 different roots
This commit is contained in:
parent
ae89bd0307
commit
e8cfcd8952
@ -99,28 +99,34 @@ dolibarr_fiche_head($head, 'rights', $langs->trans("User"));
|
||||
$db->begin();
|
||||
|
||||
// Charge les modules soumis a permissions
|
||||
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/";
|
||||
$handle=opendir($dir);
|
||||
$modules = array();
|
||||
while (($file = readdir($handle))!==false)
|
||||
|
||||
$listdir=array();
|
||||
$listdir[]=DOL_DOCUMENT_ROOT . "/includes/modules/";
|
||||
if (defined('DOL_DOCUMENT_ROOT_BIS') && DOL_DOCUMENT_ROOT_BIS) $listdir[]=DOL_DOCUMENT_ROOT_BIS . "/includes/modules/";
|
||||
foreach($listdir as $dir)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
$modName = substr($file, 0, strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
include_once("../includes/modules/$file");
|
||||
$objMod = new $modName($db);
|
||||
if ($objMod->rights_class) {
|
||||
|
||||
$ret=$objMod->insert_permissions();
|
||||
|
||||
$modules[$objMod->rights_class]=$objMod;
|
||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||
}
|
||||
}
|
||||
}
|
||||
$handle=opendir($dir);
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
$modName = substr($file, 0, strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
include_once($dir.$file);
|
||||
$objMod = new $modName($db);
|
||||
if ($objMod->rights_class) {
|
||||
|
||||
$ret=$objMod->insert_permissions();
|
||||
|
||||
$modules[$objMod->rights_class]=$objMod;
|
||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user