Skip to content
Snippets Groups Projects
Commit 584371ed authored by Regis Houssin's avatar Regis Houssin
Browse files

Works on multi-company module

parent 123dba25
No related branches found
No related tags found
No related merge requests found
......@@ -84,6 +84,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
if ( preg_match('/^([^.]+)\/htdocs\//i', realpath($_SERVER["SCRIPT_FILENAME"]), $regs)) $realpath = isset($regs[1])?$regs[1]:'';
// Set cookie for timeout management
// FIXME le cookie n'est pas créé la première fois
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', 0);
......@@ -116,7 +117,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
if (! empty($conf->global->MAIN_MULTICOMPANY_COOKIE))
{
$entityCookieName = 'DOLENTITYID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$entityCookieName = 'DOLENTITYID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
if (isset($_COOKIE[$entityCookieName]))
{
include_once(DOL_DOCUMENT_ROOT . "/core/class/cookie.class.php");
......@@ -153,19 +154,18 @@ function dol_loginfunction($langs,$conf,$mysoc)
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
}
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $rowspan++;
// Entity field
$select_entity='';
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY))
{
$res=@include_once(DOL_DOCUMENT_ROOT.'/multicompany/class/multicompany.class.php');
$rowspan++;
$res=@include_once(DOL_DOCUMENT_ROOT.'/multicompany/class/actions_multicompany.class.php');
if ($res)
{
$mc = new Multicompany($db);
$mc->getEntities(0,1);
$mc = new ActionsMulticompany($db);
$select_entity=$mc->select_entities($mc->entities,$lastentity,'tabindex="3"');
$select_entity=$mc->select_entities($lastentity,'tabindex="3"');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment