diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 2e997664c21..edd39ab4c8a 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -49,6 +49,7 @@ $sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; if (isset($_GET["msg"])) { $mesg=urldecode($_GET["mesg"]); } $year=isset($_GET["year"])?$_GET["year"]:""; $month=isset($_GET["month"])?$_GET["month"]:""; +$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; // Security check $module='propale'; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index e3edad92772..88f0a083e2e 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -39,6 +39,7 @@ $sref=isset($_GET['sref'])?$_GET['sref']:$_POST['sref']; $sref_client=isset($_GET['sref_client'])?$_GET['sref_client']:(isset($_POST['sref_client'])?$_POST['sref_client']:''); $snom=isset($_GET['snom'])?$_GET['snom']:$_POST['snom']; $sall=isset($_GET['sall'])?$_GET['sall']:$_POST['sall']; +$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; // Security check $orderid = isset($_GET["orderid"])?$_GET["orderid"]:''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1d32a31d5fd..f4f46b28628 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -52,20 +52,12 @@ $langs->load('main'); $sall=isset($_GET['sall'])?trim($_GET['sall']):trim($_POST['sall']); $mesg=isset($_GET['mesg'])?urldecode($_GET['mesg']):''; $socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; +$projetid=isset($_GET['projetid'])?$_GET['projetid']:0; -// Sécurité accès client -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -// Récupération de l'id de projet -$projetid = 0; -if ($_GET["projetid"]) -{ - $projetid = $_GET["projetid"]; -} +// Security check +$facid = isset($_GET["id"])?$_GET["id"]:''; +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'facture', $facid,''); // Nombre de ligne pour choix de produit/service prédéfinis $NBLINES=4; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index a5256727236..6009776f7af 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -42,7 +42,7 @@ $search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; $search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"]; $sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; $statut=isset($_GET["statut"])?$_GET["statut"]:1; -$socid=$_GET["socid"]; +$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid']; if (! $sortfield) $sortfield="c.rowid"; if (! $sortorder) $sortorder="DESC"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ee42cd53055..50c6185de01 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -29,7 +29,7 @@ */ // Pour le tuning optionnel. Activer si la variable d'environnement DOL_TUNING est positionnee. -// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float +// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float pas encore chargee. $micro_start_time=0; if (! empty($_SERVER['DOL_TUNING'])) { @@ -87,8 +87,26 @@ foreach ($_POST as $key => $val) // This is to make Dolibarr working with Plesk set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); + +// Test if install ok +if (! @include_once("conf/conf.php")) +{ + Header("Location: install/index.php"); + exit; +} +else +{ + if (! isset($dolibarr_main_db_host)) + { + Header("Location: install/index.php"); + exit; + } +} + + require_once("master.inc.php"); + // Chargement des includes complementaire de presentation if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); // Need 11ko memory if (! defined('NOREQUIREHTML')) require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); // Need 800ko memory diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 37d68725cd7..1e40d9c3145 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Xavier Dutoit - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2007 Regis Houssin @@ -60,18 +60,10 @@ else error_reporting(E_ALL ^ E_NOTICE); // Test si install ok -if (! @include_once("conf/conf.php")) +if (! isset($dolibarr_main_db_host)) { - Header("Location: install/index.php"); - exit; -} -else -{ - if (! isset($dolibarr_main_db_host)) - { - Header("Location: install/index.php"); - exit; - } + print "Error: Dolibarr setup is not complete.\n"; + exit; } if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'