X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=index.php;h=7910e3afa2b41507b0b5f304624db59eedbf0352;hb=80bfe0c989b5884d0133e99c36ccad7197105593;hp=7fcf106a9d1dc464785e6d972cfd26ae3e8d0f0c;hpb=957e03f1c6791f6275ecfdc5e954c673c930844e;p=contagged diff --git a/index.php b/index.php index 7fcf106..7910e3a 100644 --- a/index.php +++ b/index.php @@ -12,6 +12,8 @@ $entrytpl = 'list_entry.tpl'; } + tpl_std(); + // check which fields are needed $fields = get_fields_from_template($entrytpl); @@ -37,7 +39,6 @@ } //prepare templates - tpl_std(); if (empty($_REQUEST['filter'])) $_REQUEST['filter']=''; if (empty($_REQUEST['marker'])) $_REQUEST['marker']=''; if (empty($_REQUEST['search'])) $_REQUEST['search']=''; @@ -94,6 +95,7 @@ */ function _makeldapfilter(){ global $FIELDS; + global $conf; //handle given filter @@ -111,7 +113,7 @@ if(!empty($marker)){ // Search by tag - $ldapfilter = '(&(objectClass=contactPerson)'; + $ldapfilter = '(&(objectClass=evolutionPerson)'; $marker = explode(',',$marker); foreach($marker as $m){ $m = trim($m); @@ -143,9 +145,14 @@ $words=preg_split('/\s+/',$search); $filter=''; foreach($words as $word){ - $filter .= '(|(|('.$FIELDS['name'].'=*'.$word.'*)('. - $FIELDS['givenname'].'=*'.$word.'*))('. - $FIELDS['organization'].'=*'.$word.'*))'; + $wordfilter=''; + foreach($conf['searchfields'] as $field) { + $wordfilter .= '('.$field.'=*'.$word.'*)'; + } + for($i=0; $i