From 72dfbcc4e8054431c156b6d446b75b82ce8b6457 Mon Sep 17 00:00:00 2001
From: Rodolphe Quiedeville <rodolphe@quiedeville.org>
Date: Fri, 2 Sep 2005 11:47:09 +0000
Subject: [PATCH] Modif permissions

---
 htdocs/telephonie/service/contrats.php | 5 ++++-
 htdocs/telephonie/service/fiche.php    | 5 ++++-
 htdocs/telephonie/service/index.php    | 2 +-
 htdocs/telephonie/service/liste.php    | 5 ++++-
 htdocs/telephonie/service/pre.inc.php  | 6 ++++--
 htdocs/telephonie/service/vendus.php   | 5 ++++-
 6 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/htdocs/telephonie/service/contrats.php b/htdocs/telephonie/service/contrats.php
index fe36e05b0bb..9eee87a473c 100644
--- a/htdocs/telephonie/service/contrats.php
+++ b/htdocs/telephonie/service/contrats.php
@@ -1,5 +1,5 @@
 <?PHP
-/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
+/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,9 @@
  */
 require("./pre.inc.php");
 
+if (!$user->rights->telephonie->service->lire)
+  accessforbidden();
+
 $page = $_GET["page"];
 $sortorder = $_GET["sortorder"];
 $sortfield = $_GET["sortfield"];
diff --git a/htdocs/telephonie/service/fiche.php b/htdocs/telephonie/service/fiche.php
index faefcd1f45a..228ce8a607c 100644
--- a/htdocs/telephonie/service/fiche.php
+++ b/htdocs/telephonie/service/fiche.php
@@ -1,5 +1,5 @@
 <?PHP
-/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
+/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,6 +22,9 @@
 
 require "./pre.inc.php";
 
+if (!$user->rights->telephonie->service->lire)
+  accessforbidden();
+
 $mesg = '';
 
 
diff --git a/htdocs/telephonie/service/index.php b/htdocs/telephonie/service/index.php
index c1e2a2242d8..29dbf5f7081 100644
--- a/htdocs/telephonie/service/index.php
+++ b/htdocs/telephonie/service/index.php
@@ -21,7 +21,7 @@
  */
 require("./pre.inc.php");
 
-if (!$user->rights->telephonie->lire) accessforbidden();
+if (!$user->rights->telephonie->service->lire) accessforbidden();
 
 llxHeader('','Telephonie - Services');
 
diff --git a/htdocs/telephonie/service/liste.php b/htdocs/telephonie/service/liste.php
index 5b069665b5b..31c6e065884 100644
--- a/htdocs/telephonie/service/liste.php
+++ b/htdocs/telephonie/service/liste.php
@@ -1,5 +1,5 @@
 <?PHP
-/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
+/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,9 @@
  */
 require("./pre.inc.php");
 
+if (!$user->rights->telephonie->service->lire)
+  accessforbidden();
+
 $page = $_GET["page"];
 $sortorder = $_GET["sortorder"];
 $sortfield = $_GET["sortfield"];
diff --git a/htdocs/telephonie/service/pre.inc.php b/htdocs/telephonie/service/pre.inc.php
index 8c14b549952..f0707efacd3 100644
--- a/htdocs/telephonie/service/pre.inc.php
+++ b/htdocs/telephonie/service/pre.inc.php
@@ -43,11 +43,13 @@ function llxHeader($head = "", $title="") {
 
   $menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
 
-  $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
+  if ($user->rights->telephonie->ligne_commander)    
+    $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
 
   $menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures");
 
-  $menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
+  if ($user->rights->telephonie->stats->lire)
+    $menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
 
   $menu->add(DOL_URL_ROOT."/telephonie/service/", "Services");
 
diff --git a/htdocs/telephonie/service/vendus.php b/htdocs/telephonie/service/vendus.php
index 09b06b18740..7ad8832f4d4 100644
--- a/htdocs/telephonie/service/vendus.php
+++ b/htdocs/telephonie/service/vendus.php
@@ -1,5 +1,5 @@
 <?PHP
-/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
+/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,9 @@
  */
 require("./pre.inc.php");
 
+if (!$user->rights->telephonie->service->lire)
+  accessforbidden();
+
 $page = $_GET["page"];
 $sortorder = $_GET["sortorder"];
 $sortfield = $_GET["sortfield"];
-- 
GitLab