Fix: When user has no permissions to see all other user, we must keep

only user.
This commit is contained in:
Laurent Destailleur 2014-05-26 17:21:48 +02:00
parent 300e430024
commit 1199d54fb2

View File

@ -363,7 +363,7 @@ class FormOther
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.fk_societe = ".($user->societe_id?$user->societe_id:0);
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.rowid = ".$user->id;
// Add existing sales representatives of thirdparty of external user
if (empty($user->rights->user->user->lire) && $user->societe_id)
{