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

Fix: limit to company name for a server with multiple instance of dolibarr

parent b3013401
Branches
Tags
No related merge requests found
......@@ -471,7 +471,9 @@ function listOfSessions()
{
$sessValues = file_get_contents($fullpath); // get raw session data
if (eregi('dol_login',$sessValues) && eregi('dol_entity\|s:([0-9]+):"('.$conf->entity.')"',$sessValues)) // limit to dolibarr session and current entity
if (eregi('dol_login',$sessValues) && // limit to dolibarr session
eregi('dol_entity\|s:([0-9]+):"('.$conf->entity.')"',$sessValues) && // limit to current entity
eregi('dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"',$sessValues)) // limit to company name
{
$tmp=split('_', $file);
$idsess=$tmp[1];
......@@ -513,7 +515,9 @@ function purgeSessions($mysessionid)
{
$sessValues = file_get_contents($fullpath); // get raw session data
if (eregi('dol_login',$sessValues) && eregi('dol_entity\|s:([0-9]+):"('.$conf->entity.')"',$sessValues)) // limit to dolibarr session and current entity
if (eregi('dol_login',$sessValues) && // limit to dolibarr session
eregi('dol_entity\|s:([0-9]+):"('.$conf->entity.')"',$sessValues) && // limit to current entity
eregi('dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"',$sessValues)) // limit to company name
{
$tmp=split('_', $file);
$idsess=$tmp[1];
......
......@@ -441,6 +441,7 @@ if (! isset($_SESSION["dol_login"]))
// New session for this login
$_SESSION["dol_login"]=$user->login;
$_SESSION["dol_authmode"]=$conf->authmode;
$_SESSION["dol_company"]=$conf->global->MAIN_INFO_SOCIETE_NOM;
if ($conf->multicompany->enabled) $_SESSION["dol_entity"]=$conf->entity;
dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"].' Session id='.session_id());
......
......@@ -348,7 +348,7 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
$mysoc->siret=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
$mysoc->ape=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
$mysoc->rcs=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS;
// Id prof g�n�riques
// Id prof generiques
$mysoc->profid1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
$mysoc->profid2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
$mysoc->profid3=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment