From b33020c86a95cf31790f5980683078e579cbc430 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Apr 2009 15:48:58 +0000 Subject: [PATCH] Fix: entity cookie connection --- htdocs/main.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7b573002daf..05aa1d543df 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -112,10 +112,10 @@ analyse_sql_injection($_POST); // This is to make Dolibarr working with Plesk set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); -// Retrieve the entity -if (isset($_POST["entity"])) $_SESSION["dol_entity"] = $_POST["entity"]; +// Retrieve the entity in login form, and after in the cookie $entityCookieName = "DOLENTITYID_dolibarr"; -if (isset($_COOKIE[$entityCookieName])) $conf->entity = $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName]; +if (isset($_POST["entity"])) $_SESSION["dol_entity"] = $_POST["entity"]; +if (isset($_COOKIE[$entityCookieName])) $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName]; // Set and init common variables require_once("master.inc.php");