diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 1dbb901cd35..70866431808 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -31,14 +31,10 @@ require("./pre.inc.php"); +if (!$user->rights->societe->lire) accessforbidden(); + $langs->load("companies"); -$user->getrights('propale'); -$user->getrights('fichinter'); -$user->getrights('commande'); -$user->getrights('projet'); - - llxHeader('','Contacts'); $sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 4b1f4220c88..3336ed88ce0 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -29,17 +29,18 @@ */ require_once("./pre.inc.php"); -require_once("../contact.class.php"); -require_once("../actioncomm.class.php"); + +if (!$user->rights->societe->lire) accessforbidden(); + +require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); +require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); -require_once("../contrat/contrat.class.php"); +require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $langs->load("companies"); $langs->load("orders"); $langs->load("contracts"); -$user->getrights(); - llxHeader('',$langs->trans('CustomerCard')); $sortorder=$_GET["sortorder"]; diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php index 4cd8e832dc6..62410d6a8c2 100644 --- a/htdocs/pre.inc.php +++ b/htdocs/pre.inc.php @@ -59,7 +59,7 @@ function llxHeader($head = "") { $menu->add_submenu(DOL_URL_ROOT."/contact/index.php",$langs->trans("Contacts")); } - if ($conf->commercial->enabled ) + if ($conf->commercial->enabled && $user->rights->societe->lire) { $langs->load("commercial"); $menu->add(DOL_URL_ROOT."/comm/index.php",$langs->trans("Commercial")); @@ -74,7 +74,7 @@ function llxHeader($head = "") { } } - if ($conf->compta->enabled ) + if ($conf->compta->enabled && $user->rights->societe->lire) { $langs->load("compta"); $menu->add(DOL_URL_ROOT."/compta/index.php", $langs->trans("Accountancy")); @@ -85,10 +85,10 @@ function llxHeader($head = "") { } } - if ($conf->fichinter->enabled ) + if ($conf->fichinter->enabled && $user->rights->ficheinter->lire) { - $langs->trans("interventions"); - $menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions")); + $langs->trans("interventions"); + $menu->add(DOL_URL_ROOT."/fichinter/index.php", $langs->trans("Interventions")); } if (($conf->produit->enabled || $conf->service->enabled) && $user->rights->produit->lire)