From 965216282a90b57f1cf5ba66d7e61eae1243b5d2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 6 Sep 2011 03:12:36 +0800 Subject: [PATCH] Fix: bad path --- htdocs/main.inc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1f987b41859..689b9a48bce 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -750,14 +750,17 @@ if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) { if (GETPOST('action') == 'switchentity' && $user->admin && ! $user->entity) { - require_once("../class/actions_multicompany.class.php"); - - $mc = new ActionsMulticompany($db); - - if($mc->switchEntity(GETPOST('entity')) > 0) + $res = @dol_include_once("/multicompany/class/actions_multicompany.class.php"); + + if ($res) { - Header("Location: ".DOL_URL_ROOT.'/'); - exit; + $mc = new ActionsMulticompany($db); + + if($mc->switchEntity(GETPOST('entity')) > 0) + { + Header("Location: ".DOL_URL_ROOT.'/'); + exit; + } } } }