From fd078ef7137d4fe33dc766f0f73eb8512fb773ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Nov 2020 21:43:45 +0100 Subject: [PATCH] Update user.class.php --- htdocs/user/class/user.class.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 31c884e9f2c..1092d5b6a50 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -74,6 +74,10 @@ class User extends CommonObject public $ldap_sid; public $search_sid; public $employee; + + /** + * @var string gender + */ public $gender; public $birth; @@ -307,6 +311,9 @@ class User extends CommonObject public $default_c_exp_tax_cat; public $default_range; + /** + *@var int id of warehouse + */ public $fk_warehouse; public $fields = array( @@ -2916,23 +2923,17 @@ class User extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."user"; if ($option == 'superadmin') { $sql .= " WHERE entity = 0"; - if ($admin >= 0) { - $sql .= " AND admin = ".$admin; - } } else { $sql .= " WHERE entity IN (".getEntity('user', 0).")"; - if ($limitTo == 'active') { - $sql .= " AND statut = 1"; - } - if ($admin >= 0) { - $sql .= " AND admin = ".$admin; - } + } + if ($admin >= 0) { + $sql .= " AND admin = ".(int) $admin; } $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - $nb = $obj->nb; + $nb = (int) $obj->nb; $this->db->free($resql); return $nb;