diff --git a/htdocs/telephonie/config/perms.php b/htdocs/telephonie/config/perms.php index d1f2febea94..a3c0f45c86f 100644 --- a/htdocs/telephonie/config/perms.php +++ b/htdocs/telephonie/config/perms.php @@ -62,11 +62,15 @@ if ($_GET["action"] == "all") { while ($row = $db->fetch_row($resql)) { - $sql_i = "INSERT INTO ".MAIN_DB_PREFIX."societe_perms "; - $sql_i.= " (fk_soc,fk_user,pread,pwrite,pperms) "; - $sql_i.= " VALUES ($socs[0],$row[0],1,1,1) "; - - $resql_i = $db->query( $sql_i ); + + foreach ($socs as $soc) + { + $sql_i = "INSERT INTO ".MAIN_DB_PREFIX."societe_perms "; + $sql_i.= " (fk_soc,fk_user,pread,pwrite,pperms) "; + $sql_i.= " VALUES ($soc,$row[0],1,1,1) "; + + $resql_i = $db->query( $sql_i ); + } } $db->free($resql); @@ -106,8 +110,6 @@ print "Toutes les permissions a tout le monde"; print 'Appliquer'; print ''; - - print ''; print '';