Sec: Fix security test

This commit is contained in:
Laurent Destailleur 2009-08-11 12:56:42 +00:00
parent 9735c0c770
commit 5de6da03ab

View File

@ -19,20 +19,27 @@
*/ */
/** /**
\file htdocs/compta/clients.php * \file htdocs/compta/clients.php
\ingroup compta * \ingroup compta
\brief Page accueil des clients * \brief Show list of customers to add an new invoice
\version $Id$ * \version $Id$
*/ */
require_once("./pre.inc.php"); require_once("./pre.inc.php");
if (! $user->rights->societe->lire)
accessforbidden();
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
// Secrutiy check
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
}
if (! $user->rights->facture->lire)
accessforbidden();
$langs->load("companies"); $langs->load("companies");
$page=$_GET["page"]; $page=$_GET["page"];
@ -46,19 +53,13 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
/* /*
* View * View
*/ */
llxHeader(); llxHeader();
// Sécurité accés client
if ($user->societe_id > 0)
{
$action = '';
$socid = $user->societe_id;
}
if ($action == 'attribute_prefix') if ($action == 'attribute_prefix')
{ {
$societe = new Societe($db, $socid); $societe = new Societe($db, $socid);