diff --git a/htdocs/telephonie/contrat/stats.php b/htdocs/telephonie/contrat/stats.php index 884f054768e..e8dd06e8f1f 100644 --- a/htdocs/telephonie/contrat/stats.php +++ b/htdocs/telephonie/contrat/stats.php @@ -29,11 +29,18 @@ llxHeader("","T if ($_GET["id"]) { + $client_comm = new Societe($db); $contrat = new TelephonieContrat($db); $result = $contrat->fetch($_GET["id"]); + $client_comm->fetch($contrat->client_comm_id, $user); - if ( $result == 1 ) + if (!$client_comm->perm_read) + { + print "Lecture non authorisée"; + } + + if ( $result && $client_comm->perm_read) { if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') {