Skip to content
Snippets Groups Projects
Commit 449678d6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: get_full_tree must follow same filter rule thant list of users

parent 3c4dfba9
No related branches found
No related tags found
No related merge requests found
......@@ -2235,8 +2235,14 @@ class User extends CommonObject
// Init $this->users array
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut"; // Distinct reduce pb with old tables with duplicates
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
{
$sql.= " WHERE u.entity IS NOT NULL";
}
else
{
$sql.= " WHERE u.entity IN (".getEntity('user',1).")";
}
dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
......
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