Merge pull request #18693 from FHenry/14_fix_ldap_limit
fix: User class fetch method if LDAP Search LIMIT must be after ORDER BY
This commit is contained in:
commit
7420e6ab9a
@ -455,8 +455,9 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba
|
if ($sid) {
|
||||||
$sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1";
|
// permet une recherche du user par son SID ActiveDirectory ou Samba
|
||||||
|
$sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."')";
|
||||||
} elseif ($login) {
|
} elseif ($login) {
|
||||||
$sql .= " AND u.login = '".$this->db->escape($login)."'";
|
$sql .= " AND u.login = '".$this->db->escape($login)."'";
|
||||||
} elseif ($email) {
|
} elseif ($email) {
|
||||||
@ -466,6 +467,11 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
$sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
|
$sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
|
||||||
|
|
||||||
|
if ($sid) {
|
||||||
|
// permet une recherche du user par son SID ActiveDirectory ou Samba
|
||||||
|
$sql .= ' '.$this->db->plimit(1);
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user