Skip to content

Commit

Permalink
Fix: wrong user fetch when same login in different entity
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Mar 17, 2017
1 parent 53abc32 commit 9e944e4
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 9e944e4

Please sign in to comment.