Adaptation au nouveau système de permissions
This commit is contained in:
parent
5d30c7ab29
commit
df4a56da49
@ -140,17 +140,39 @@ class DolibarrModules
|
|||||||
{
|
{
|
||||||
foreach ($this->rights as $key => $value)
|
foreach ($this->rights as $key => $value)
|
||||||
{
|
{
|
||||||
$r_id = $this->rights[$key][0];
|
$r_id = $this->rights[$key][0];
|
||||||
$r_desc = $this->rights[$key][1];
|
$r_desc = $this->rights[$key][1];
|
||||||
$r_type = $this->rights[$key][2];
|
$r_type = $this->rights[$key][2];
|
||||||
$r_def = $this->rights[$key][3];
|
$r_def = $this->rights[$key][3];
|
||||||
$r_modul = $this->rights_class;
|
$r_perms = $this->rights[$key][4];
|
||||||
|
$r_subperms = $this->rights[$key][5];
|
||||||
|
$r_modul = $this->rights_class;
|
||||||
|
|
||||||
|
if (strlen($r_perms) )
|
||||||
|
{
|
||||||
|
if (strlen($r_subperms) )
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def ";
|
||||||
|
$sql .= " (id, libelle, module, type, bydefault, perms, subperms)";
|
||||||
|
$sql .= " VALUES ";
|
||||||
|
$sql .= "(".$r_id.",'".$r_desc."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."');";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def ";
|
||||||
|
$sql .= " (id, libelle, module, type, bydefault, perms)";
|
||||||
|
$sql .= " VALUES ";
|
||||||
|
$sql .= "(".$r_id.",'".$r_desc."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."');";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def ";
|
||||||
|
$sql .= " (id, libelle, module, type, bydefault)";
|
||||||
|
$sql .= " VALUES ";
|
||||||
|
$sql .= "(".$r_id.",'".$r_desc."','".$r_modul."','".$r_type."',".$r_def.");";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def ";
|
|
||||||
$sql .= " (id, libelle, module, type, bydefault)";
|
|
||||||
$sql .= " VALUES ";
|
|
||||||
$sql .= "(".$r_id.",'".$r_desc."','".$r_modul."','".$r_type."',".$r_def.");";
|
|
||||||
|
|
||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user