Skip to content

Commit

Permalink
Merge pull request #6538 from hregis/4.0_bug3
Browse files Browse the repository at this point in the history
FIX wrong user fetch when same login in different entity
  • Loading branch information
eldy committed Mar 18, 2017
2 parents 60a9268 + f03bdb9 commit 9e545e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/main.inc.php
Expand Up @@ -576,9 +576,10 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type)
{
// We are already into an authenticated session
$login=$_SESSION["dol_login"];
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG);
$entity=$_SESSION["dol_entity"];
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);

$resultFetchUser=$user->fetch('',$login);
$resultFetchUser=$user->fetch('',$login,'',1,($entity > 0 ? $entity : -1));
if ($resultFetchUser <= 0)
{
// Account has been removed after login
Expand Down

0 comments on commit 9e545e9

Please sign in to comment.