From ce3b8e5cc8622b1b7a8573e75ca22a0096deef7d Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis.houssin@capnetworks.com>
Date: Thu, 25 Apr 2013 15:49:27 +0200
Subject: [PATCH] Fix: broken features with multicompany

---
 htdocs/master.inc.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 7212ea38f5b..3008884a59e 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -143,7 +143,10 @@ if (! defined('NOREQUIREDB'))
 	{
 		$conf->entity = DOLENTITY;
 	}
-	// TODO Multicompany Remove this.
+	else if (!empty($_COOKIE['DOLENTITY']))							// For other application with MultiCompany module
+	{
+		$conf->entity = $_COOKIE['DOLENTITY'];
+	}
 	else if (! empty($conf->multicompany->force_entity) && is_int($conf->multicompany->force_entity)) // To force entity in login page
 	{
 		$conf->entity = $conf->multicompany->force_entity;
-- 
GitLab