From 4fe71883330880ca3d52e4e79cd89dc60cce1e03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2008 20:13:28 +0000 Subject: [PATCH] New: Super clean of permissions checks --- htdocs/contact/exportimport.php | 8 +++----- htdocs/contact/fiche.php | 2 +- htdocs/contact/info.php | 8 +++----- htdocs/contact/ldap.php | 2 +- htdocs/contact/perso.php | 4 ++-- htdocs/contact/vcard.php | 4 +--- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index c8f9756c5e8..af5430aa22b 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2008 Laurent Destailleur * Copyright (C) 2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -15,15 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/contact/exportimport.php \ingroup societe \brief Onglet exports-imports d'un contact - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -35,7 +33,7 @@ $langs->load("companies"); // Security check $contactid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact',$contactid,'',1); +$result = restrictedArea($user, 'contact', $contactid, 'socpeople'); /* diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index f5bad6db542..c4a8bd6ecd6 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -41,7 +41,7 @@ $socid=$_GET["socid"]?$_GET["socid"]:$_POST["socid"]; // Security check $contactid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact', $contactid,'socpeople',0); +$result = restrictedArea($user, 'contact', $contactid, 'socpeople'); /* diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index cffef5b9471..ef4db0843cc 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * * 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 @@ -15,15 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/contact/info.php \ingroup societe \brief Onglet info d'un contact - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -35,7 +33,7 @@ $langs->load("companies"); // Security check $contactid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact',$contactid,'',1); +$result = restrictedArea($user, 'contact',$contactid,'socpeople'); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 7d954fbba14..8db2604b9e8 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -36,7 +36,7 @@ $langs->load("admin"); // Security check $contactid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact',$contactid,'',1); +$result = restrictedArea($user, 'contact', $contactid, 'socpeople'); /* diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 16a4b1f3f7b..e0d1b6ad797 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * * 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 @@ -33,7 +33,7 @@ $langs->load("companies"); // Security check $contactid = isset($_GET["id"])?$_GET["id"]:''; if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'contact',$contactid,'',1); +$result = restrictedArea($user, 'contact', $contactid, 'socpeople'); /* diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index ac0051988b7..eb22652243e 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -15,15 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/contact/vcard.php \ingroup societe \brief Onglet vcard d'un contact - \version $Revision$ + \version $Id$ */ require("./pre.inc.php");