- $ldapfilter = "(&(objectClass=contactPerson)(marker=$marker))";
- }elseif(!empty($categories)){
- $ldapfilter = "(&(objectClass=OXUserObject)(OXUserCategories=$categories))";
+ // Search by tag
+ $ldapfilter = '(&(objectClass=contactPerson)';
+ $marker = explode(',',$marker);
+ foreach($marker as $m){
+ $m = trim($m);
+ $ldapfilter .= '('.$FIELDS['_marker'].'='.$m.')';
+ }
+ $ldapfilter .= ')';
+ }elseif($number){
+ // Search by telephone number
+ $filter = '';
+ // add wildcards between digits to compensate for any formatting
+ $length = strlen($number);
+ for($i=0; $i <$length; $i++){
+ $filter .= '*'.$number{$i};
+ }
+ $filter .= '*';
+ $ldapfilter = '(&'.
+ '(objectClass=inetOrgPerson)'.
+ '(|'.
+ '(|'.
+ '('.$FIELDS['phone'].'='.$filter.')'.
+ '('.$FIELDS['homephone'].'='.$filter.')'.
+ ')'.
+ '('.$FIELDS['mobile'].'='.$filter.')'.
+ ')'.
+ ')';