Fix: Security check

This commit is contained in:
Laurent Destailleur 2008-02-24 13:18:40 +00:00
parent ec536cb582
commit 99297fea62
31 changed files with 148 additions and 182 deletions

View File

@ -49,8 +49,8 @@ else
accessforbidden(); accessforbidden();
} }
// Securite d'acces client et commerciaux // Security check
$objectid = restrictedArea($user, $type, $objectid); $result = restrictedArea($user, $type, $objectid);

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/adresse_livraison.php \file htdocs/comm/adresse_livraison.php
\ingroup societe \ingroup societe
\brief Onglet adresse de livraison d'un client \brief Onglet adresse de livraison d'un client
\version $Revision$ \version $Id$
*/ */
require("pre.inc.php"); require("pre.inc.php");
@ -41,8 +38,9 @@ $originid = isset($_GET["originid"])?$_GET["originid"]:'';
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
if (! $socid && ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && $_REQUEST["action"] != 'update')) accessforbidden(); if (! $socid && ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && $_REQUEST["action"] != 'update')) accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
/* /*
* Actions * Actions

View File

@ -15,22 +15,19 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/clients.php \file htdocs/comm/clients.php
\ingroup commercial, societe \ingroup commercial, societe
\brief Liste des clients \brief Liste des clients
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'societe','','',1); $result = restrictedArea($user, 'societe','','',1);
$page=$_GET["page"]; $page=$_GET["page"];
$sortorder=$_GET["sortorder"]; $sortorder=$_GET["sortorder"];

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/contact.php \file htdocs/comm/contact.php
\ingroup commercial \ingroup commercial
\brief Liste des contacts \brief Liste des contacts
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -44,12 +41,16 @@ $offset = $limit * $page ;
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
$type=$_GET["type"]; $type=$_GET["type"];
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'societe'); $result = restrictedArea($user, 'societe');
/*
* View
*/
llxHeader('','Contacts'); llxHeader('','Contacts');
if ($type == "c") if ($type == "c")
{ {
$label = $langs->trans("Customers"); $label = $langs->trans("Customers");

View File

@ -43,7 +43,7 @@ if ($conf->fichinter->enabled) $langs->load("interventions");
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
// Securite d'acces client et commerciaux // Security check
$result = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
$sortorder=$_GET["sortorder"]; $sortorder=$_GET["sortorder"];

View File

@ -19,14 +19,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/comm/propal.php \file htdocs/comm/propal.php
\ingroup propale \ingroup propale
\brief Page liste des propales (vision commercial) \brief Page liste des propales (vision commercial)
\version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -51,7 +50,7 @@ if (isset($_GET["msg"])) { $mesg=urldecode($_GET["mesg"]); }
$year=isset($_GET["year"])?$_GET["year"]:""; $year=isset($_GET["year"])?$_GET["year"]:"";
$month=isset($_GET["month"])?$_GET["month"]:""; $month=isset($_GET["month"])?$_GET["month"]:"";
// Sécurité accés client // Security check
$module='propale'; $module='propale';
if (isset($_GET["socid"])) if (isset($_GET["socid"]))
{ {
@ -65,9 +64,7 @@ else if (isset($_GET["propalid"]) && $_GET["propalid"] > 0)
$module='propale'; $module='propale';
$dbtable='propal'; $dbtable='propal';
} }
$result = restrictedArea($user, $module, $objectid, $dbtable);
// Sécurité d'accès client et commerciaux
$socid = restrictedArea($user, $module, $objectid, $dbtable);
// Nombre de ligne pour choix de produit/service predefinis // Nombre de ligne pour choix de produit/service predefinis
$NBLINES=4; $NBLINES=4;

View File

@ -15,16 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/ */
/** /**
\file htdocs/comm/propal/aideremise.php \file htdocs/comm/propal/aideremise.php
\ingroup propale \ingroup propale
\brief Page de simulation des remises \brief Page de simulation des remises
\version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -32,8 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/propal.class.php");
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security cehck
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/******************************************************************************/ /******************************************************************************/
@ -42,11 +39,13 @@ $socid = restrictedArea($user, 'propale', $propalid, 'propal');
llxHeader();
/******************************************************************************/ /******************************************************************************/
/* Fin des Actions */ /* View */
/******************************************************************************/ /******************************************************************************/
llxHeader();
/* /*
* *
* Mode fiche * Mode fiche

View File

@ -17,15 +17,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/comm/propal/apercu.php \file htdocs/comm/propal/apercu.php
\ingroup propal \ingroup propal
\brief Page de l'onglet aperçu d'une propal \brief Page de l'onglet aperçu d'une propal
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -41,8 +39,13 @@ $langs->load('compta');
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/*
* View
*/
llxHeader(); llxHeader();

View File

@ -15,15 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/comm/propal/contact.php \file htdocs/comm/propal/contact.php
\ingroup propal \ingroup propal
\brief Onglet de gestion des contacts de propal \brief Onglet de gestion des contacts de propal
\version $Revision$ \version $Id$
*/ */
require ("./pre.inc.php"); require ("./pre.inc.php");
@ -38,8 +36,9 @@ $langs->load("companies");
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact

View File

@ -17,15 +17,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/comm/propal/document.php \file htdocs/comm/propal/document.php
\ingroup propale \ingroup propale
\brief Page de gestion des documents attachées à une proposition commerciale \brief Page de gestion des documents attachées à une proposition commerciale
\version $Revision$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -40,8 +38,8 @@ $action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action'
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/* /*

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/propal/info.php \file htdocs/comm/propal/info.php
\ingroup propale \ingroup propale
\brief Page d'affichage des infos d'une proposition commerciale \brief Page d'affichage des infos d'une proposition commerciale
\version $Revision$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -37,8 +34,8 @@ $langs->load('compta');
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/* /*

View File

@ -17,16 +17,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/comm/propal/note.php \file htdocs/comm/propal/note.php
\ingroup propale \ingroup propale
\brief Fiche d'information sur une proposition commerciale \brief Fiche d'information sur une proposition commerciale
\version $Revision$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -39,8 +36,10 @@ $langs->load('bills');
$propalid = isset($_GET["propalid"])?$_GET["propalid"]:''; $propalid = isset($_GET["propalid"])?$_GET["propalid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'propale', $propalid, 'propal'); $result = restrictedArea($user, 'propale', $propalid, 'propal');
/******************************************************************************/ /******************************************************************************/
/* Actions */ /* Actions */

View File

@ -15,16 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/commande/contact.php \file htdocs/commande/contact.php
\ingroup commande \ingroup commande
\brief Onglet de gestion des contacts de commande \brief Onglet de gestion des contacts de commande
\version $Revision$ \version $Id$
*/ */
require ("./pre.inc.php"); require ("./pre.inc.php");
@ -39,8 +36,9 @@ $langs->load("companies");
$commandeid = isset($_GET["id"])?$_GET["id"]:''; $commandeid = isset($_GET["id"])?$_GET["id"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'commande', $commandeid); $result = restrictedArea($user, 'commande', $commandeid);
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact

View File

@ -15,15 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/compta/facture/contact.php \file htdocs/compta/facture/contact.php
\ingroup facture \ingroup facture
\brief Onglet de gestion des contacts des factures \brief Onglet de gestion des contacts des factures
\version $Revision$ \version $Id$
*/ */
require ("./pre.inc.php"); require ("./pre.inc.php");
@ -36,8 +34,9 @@ $langs->load("companies");
$facid = isset($_GET["facid"])?$_GET["facid"]:''; $facid = isset($_GET["facid"])?$_GET["facid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'facture', $facid); $result = restrictedArea($user, 'facture', $facid);
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact

View File

@ -17,14 +17,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/compta/propal.php \file htdocs/compta/propal.php
\ingroup propale \ingroup propale
\brief Page liste des propales (vision compta) \brief Page liste des propales (vision compta)
\version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -64,8 +63,8 @@ else if (! empty($_GET["propalid"]))
$dbtable='propal'; $dbtable='propal';
} }
// S<EFBFBD>curit<EFBFBD> d'acc<63>s client et commerciaux // Security check
$socid = restrictedArea($user, $module, $objectid, $dbtable); $result = restrictedArea($user, $module, $objectid, $dbtable);

View File

@ -15,16 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/contrat/contact.php \file htdocs/contrat/contact.php
\ingroup contrat \ingroup contrat
\brief Onglet de gestion des contacts des contrats \brief Onglet de gestion des contacts des contrats
\version $Revision$ \version $Id$
*/ */
require ("./pre.inc.php"); require ("./pre.inc.php");
@ -38,8 +35,9 @@ $langs->load("companies");
$contratid = isset($_GET["id"])?$_GET["id"]:''; $contratid = isset($_GET["id"])?$_GET["id"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'contrat', $contratid); $result = restrictedArea($user, 'contrat', $contratid);
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact

View File

@ -37,7 +37,7 @@ $langs->load("bills");
$langs->load("products"); $langs->load("products");
// Security check // Security check
restrictedArea($user,'contrat',$contratid,'contrat'); $result=restrictedArea($user,'contrat',$contratid,'contrat');

View File

@ -16,15 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/docsoc.php \file htdocs/docsoc.php
\brief Fichier onglet documents li<EFBFBD>s <EFBFBD> la soci<EFBFBD>t<EFBFBD> \brief Fichier onglet documents li<EFBFBD>s <EFBFBD> la soci<EFBFBD>t<EFBFBD>
\ingroup societe \ingroup societe
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -42,8 +40,8 @@ $sortfield=$_GET["sortfield"];
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name"; if (! $sortfield) $sortfield="name";
// S<EFBFBD>curit<EFBFBD> d'acc<63>s client et commerciaux // Security check
$socid = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
/* /*
* Actions * Actions

View File

@ -15,15 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/fichinter/contact.php \file htdocs/fichinter/contact.php
\ingroup fichinter \ingroup fichinter
\brief Onglet de gestion des contacts de fiche d'intervention \brief Onglet de gestion des contacts de fiche d'intervention
\version $Revision$ \version $Id$
*/ */
require ("./pre.inc.php"); require ("./pre.inc.php");
@ -37,8 +35,9 @@ $langs->load("companies");
$fichinterid = isset($_GET["id"])?$_GET["id"]:''; $fichinterid = isset($_GET["id"])?$_GET["id"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
/* /*
* Ajout d'un nouveau contact * Ajout d'un nouveau contact

View File

@ -16,15 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/fichinter/fiche.php \file htdocs/fichinter/fiche.php
\brief Fichier fiche intervention \brief Fichier fiche intervention
\ingroup ficheinter \ingroup ficheinter
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -41,12 +39,8 @@ if (defined("FICHEINTER_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/mod
$langs->load("companies"); $langs->load("companies");
$langs->load("interventions"); $langs->load("interventions");
// Get parameters
$fichinterid = isset($_GET["id"])?$_GET["id"]:''; $fichinterid = isset($_GET["id"])?$_GET["id"]:'';
// Securite d'acces client et commerciaux
$socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
//Recupere le resultat de la recherche Ajax //Recupere le resultat de la recherche Ajax
//Todo: voir pour le supprimer par la suite //Todo: voir pour le supprimer par la suite
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['socid_id']) if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && $_POST['socid_id'])
@ -54,6 +48,11 @@ if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT &&
$_POST['socid'] = $_POST['socid_id']; $_POST['socid'] = $_POST['socid_id'];
} }
// Security check
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
/* /*
* Traitements des actions * Traitements des actions
*/ */

View File

@ -14,16 +14,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/fichinter/info.php \file htdocs/fichinter/info.php
\ingroup fichinter \ingroup fichinter
\brief Page d'affichage des infos d'une fiche d'intervention \brief Page d'affichage des infos d'une fiche d'intervention
\version $Revision$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -34,14 +31,13 @@ $langs->load('companies');
$fichinterid = isset($_GET["id"])?$_GET["id"]:''; $fichinterid = isset($_GET["id"])?$_GET["id"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
/* /*
* * View
* */
*/
llxHeader(); llxHeader();

View File

@ -14,16 +14,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/fichinter/note.php \file htdocs/fichinter/note.php
\ingroup fichinter \ingroup fichinter
\brief Fiche d'information sur une fiche d'intervention \brief Fiche d'information sur une fiche d'intervention
\version $Revision$ \version $Id$
*/ */
require('./pre.inc.php'); require('./pre.inc.php');
@ -34,8 +31,9 @@ $langs->load('companies');
$fichinterid = isset($_GET["id"])?$_GET["id"]:''; $fichinterid = isset($_GET["id"])?$_GET["id"]:'';
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
/******************************************************************************/ /******************************************************************************/
/* Actions */ /* Actions */

View File

@ -1232,7 +1232,7 @@ function restrictedArea($user, $modulename, $objectid='', $dbtablename='', $list
global $db; global $db;
// Clean parameters // Clean parameters
if (!$modulename) if (! $modulename)
{ {
$modulename = 'societe'; $modulename = 'societe';
$list = 1; $list = 1;
@ -1240,20 +1240,25 @@ function restrictedArea($user, $modulename, $objectid='', $dbtablename='', $list
$objectid = 0; $objectid = 0;
$socid = 0; $socid = 0;
$nocreate = 0;
// Check permission from module // Check read permission from module
if (! $user->rights->$modulename->lire) $readok=1;
if ($modulename == 'societe')
{ {
accessforbidden(); if (! $user->rights->societe->lire && ! $user->rights->fournisseur->lire) $readok=0;
} }
else if (!$user->rights->$modulename->creer) else
{ {
$nocreate = 1; if (! $user->rights->$modulename->lire) $readok=0;
if ($_GET["action"] == 'create' || $_POST["action"] == 'create') }
{ if (! $readok) accessforbidden();
accessforbidden();
} // Check write permission from module
$createok=1;
if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
{
if (! $user->rights->$modulename->creer) $createok=0;
if (! $createok) accessforbidden();
} }
// Check permission from company affiliation // Check permission from company affiliation
@ -1298,7 +1303,8 @@ function restrictedArea($user, $modulename, $objectid='', $dbtablename='', $list
} }
} }
} }
else if ((!$objectid && $list==0) && $nocreate == 1) // If access to create or modify
if (! $objectid && ! $list && ! $createok)
{ {
accessforbidden(); accessforbidden();
} }

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/projet/commandes.php \file htdocs/projet/commandes.php
\ingroup projet commande \ingroup projet commande
\brief Page des commandes par projet \brief Page des commandes par projet
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -44,8 +41,9 @@ if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '') accessforbidden(); if ($projetid == '') accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'projet', $projetid); $result = restrictedArea($user, 'projet', $projetid);
llxHeader("","../"); llxHeader("","../");

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/projet/facture.php \file htdocs/projet/facture.php
\ingroup projet facture \ingroup projet facture
\brief Page des factures par projet \brief Page des factures par projet
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -44,8 +41,10 @@ if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '') accessforbidden(); if ($projetid == '') accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'projet', $projetid); $result = restrictedArea($user, 'projet', $projetid);
llxHeader("","../"); llxHeader("","../");

View File

@ -16,15 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/projet/fiche.php \file htdocs/projet/fiche.php
\ingroup projet \ingroup projet
\brief Fiche projet \brief Fiche projet
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -38,10 +36,14 @@ if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '' && ($_GET['action'] != "create" && $_POST['action'] != "add" && $_POST["action"] != "update" && !$_POST["cancel"])) accessforbidden(); if ($projetid == '' && ($_GET['action'] != "create" && $_POST['action'] != "add" && $_POST["action"] != "update" && !$_POST["cancel"])) accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'projet', $projetid); $result = restrictedArea($user, 'projet', $projetid);
/*
* Actions
*/
if ($_POST["action"] == 'add' && $user->rights->projet->creer) if ($_POST["action"] == 'add' && $user->rights->projet->creer)
{ {
$pro = new Project($db); $pro = new Project($db);

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/projet/propal.php \file htdocs/projet/propal.php
\ingroup projet propale \ingroup projet propale
\brief Page des propositions commerciales par projet \brief Page des propositions commerciales par projet
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -44,8 +41,10 @@ if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '') accessforbidden(); if ($projetid == '') accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'projet', $projetid); $result = restrictedArea($user, 'projet', $projetid);
llxHeader("","../"); llxHeader("","../");

View File

@ -16,15 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/projet/tasks/fiche.php \file htdocs/projet/tasks/fiche.php
\ingroup projet \ingroup projet
\brief Fiche taches d'un projet \brief Fiche taches d'un projet
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -38,8 +36,8 @@ if ($_GET["id"]) { $projetid=$_GET["id"]; }
if ($projetid == '') accessforbidden(); if ($projetid == '') accessforbidden();
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'projet', $projetid); $result = restrictedArea($user, 'projet', $projetid);
Function PLines(&$inc, $parent, $lines, &$level, $tasksrole) Function PLines(&$inc, $parent, $lines, &$level, $tasksrole)

View File

@ -18,15 +18,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/soc.php \file htdocs/soc.php
\ingroup societe \ingroup societe
\brief Onglet societe d'une societe \brief Onglet societe d'une societe
\version $Revision$ \version $Id$
*/ */
require("pre.inc.php"); require("pre.inc.php");
@ -38,7 +36,7 @@ $langs->load("bills");
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
// Sécurité d'accès client et commerciaux // Security check
$result = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
// Initialisation de l'objet Societe // Initialisation de l'objet Societe

View File

@ -32,11 +32,8 @@ $langs->load("companies");
$langs->load("customers"); $langs->load("customers");
$langs->load("suppliers"); $langs->load("suppliers");
// Sécurité d'accès client et commerciaux // Security check
if (! $user->rights->societe->lire && ! $user->rights->fournisseur->lire) accessforbidden(); $result = restrictedArea($user, 'societe','','',1);
$socid = restrictedArea($user, 'societe','','',1);
//print 'socid '.$socid;
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; $search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];
$search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_ville"]; $search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_ville"];

View File

@ -16,16 +16,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/socnote.php \file htdocs/socnote.php
\brief Fichier onglet notes liées à la société \brief Fichier onglet notes liées à la société
\ingroup societe \ingroup societe
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -38,8 +35,8 @@ $langs->load("companies");
// Protection quand utilisateur externe // Protection quand utilisateur externe
$socid = isset($_GET["socid"])?$_GET["socid"]:$_POST["socid"]; $socid = isset($_GET["socid"])?$_GET["socid"]:$_POST["socid"];
// Sécurité d'accès client et commerciaux // Security check
$socid = restrictedArea($user, 'societe', $socid); $result = restrictedArea($user, 'societe', $socid);
if ($_POST["action"] == 'add') if ($_POST["action"] == 'add')
{ {