Fix: superadmin can show all users in master entity
This commit is contained in:
parent
df718cca5c
commit
9709207a4f
@ -1539,8 +1539,12 @@ abstract class CommonObject
|
|||||||
else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
|
else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
|
||||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
|
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
|
||||||
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||||
$sql.= " AND (ug.fk_user = te.rowid";
|
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||||
$sql.= " AND ug.entity IN (".getEntity($this->element)."))";
|
$sql.= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
|
} else {
|
||||||
|
$sql.= " AND ug.fk_user = te.rowid";
|
||||||
|
$sql.= " AND ug.entity IN (".getEntity($this->element).")";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql.= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql.= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
}
|
}
|
||||||
@ -1581,8 +1585,12 @@ abstract class CommonObject
|
|||||||
else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
|
else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
|
||||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
|
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
|
||||||
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
|
||||||
$sql.= " AND (ug.fk_user = te.rowid";
|
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
|
||||||
$sql.= " AND ug.entity IN (".getEntity($this->element)."))";
|
$sql.= " AND te.entity IS NOT NULL"; // Show all users
|
||||||
|
} else {
|
||||||
|
$sql.= " AND ug.fk_user = te.rowid";
|
||||||
|
$sql.= " AND ug.entity IN (".getEntity($this->element).")";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$sql.= ' AND te.entity IN ('.getEntity($this->element).')';
|
$sql.= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user