Fix: missing superadmin

This commit is contained in:
Regis Houssin
2018-03-06 19:22:59 +01:00
parent 175971bfc1
commit bf4402eb89
3 changed files with 27 additions and 21 deletions

View File

@@ -101,11 +101,15 @@ $sql.= ", s.code_client";
$sql.= ", s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
if (! empty($conf->multicompany->enabled))
{
// TODO add hook
if (! empty($conf->multicompany->enabled)) {
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if ($conf->entity == 1 && ! empty($user->admin) && empty($user->entity)) {
$sql.= " WHERE u.entity IS NOT NULL";
if (! empty($user->admin) && empty($user->entity)) {
if ($conf->entity == 1) {
$sql.= " WHERE u.entity IS NOT NULL";
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
} else {
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
$sql.= " WHERE ug.fk_user = u.rowid";
@@ -114,9 +118,7 @@ if (! empty($conf->multicompany->enabled))
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
}
else
{
} else {
$sql.= " WHERE u.entity IN (".getEntity('user').")";
}
if (!empty($socid)) $sql.= " AND u.fk_soc = ".$socid;