allow to search for multiple items and strip "contact_" prefix

This commit is contained in:
Ralf Becker 2019-07-18 15:27:06 +02:00 committed by Hadi Nategh
parent 1d4e4d7db5
commit 034f836aca

View File

@ -821,10 +821,17 @@ class Ldap
}
foreach($this->schema2egw as $mapping)
{
if (substr($egwSearchKey, 0, 8) === 'contact_')
{
$egwSearchKey = substr($egwSearchKey, 8);
}
if(($ldapSearchKey = $mapping[$egwSearchKey]))
{
$searchString = Api\Translation::convert($searchValue,$this->charset,'utf-8');
$searchFilter .= '('.$ldapSearchKey.'='.$wildcard.Api\Ldap::quote($searchString).$wildcard.')';
foreach((array)$searchValue as $val)
{
$searchString = Api\Translation::convert($val, $this->charset,'utf-8');
$searchFilter .= '('.$ldapSearchKey.'='.$wildcard.Api\Ldap::quote($searchString).$wildcard.')';
}
break;
}
}