Changeset 523 in subversion


Ignore:
Timestamp:
Mar 27, 2007 10:27:20 AM (6 years ago)
Author:
thomasb
Message:

devel-addressbook: refinements in LDAP config and search

Location:
branches/devel-addressbook
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-addressbook/config/main.inc.php.dist

    r423 r523  
    187187// simply uncomment the Verisign example. 
    188188/**  
    189  *  example config for Verisign directory 
     189 * example config for Verisign directory 
    190190 * 
    191  *  $rcmail_config['ldap_public']['Verisign'] = array('hosts'         => array('directory.verisign.com'), 
    192  *                                                    'port'          => 389, 
    193  *                                                    'base_dn'       => '', 
    194  *                                                    'search_fields' => array('Email' => 'mail', 'Name' => 'cn'), 
    195  *                                                    'name_field'    => 'cn', 
    196  *                                                    'mail_field'    => 'mail', 
    197  *                                                    'scope'         => 'sub', 
    198  *                                                    'fuzzy_search'  => 0); 
     191 * $rcmail_config['ldap_public']['Verisign'] = array( 
     192 *  'name'          => 'Verisign.com', 
     193 *  'hosts'         => array('directory.verisign.com'), 
     194 *  'port'          => 389, 
     195 *  'base_dn'       => '', 
     196 *  'search_fields' => array('mail', 'cn'), 
     197 *  'name_field'    => 'cn', 
     198 *  'email_field'   => 'mail', 
     199 *  'scope'         => 'sub', 
     200 *  'fuzzy_search'  => 0); 
    199201 */ 
    200202 
  • branches/devel-addressbook/program/include/rcube_ldap.inc

    r522 r523  
    261261     
    262262    $filter = '(|'; 
    263     foreach ((array)$fields as $field) 
    264       if ($f = $this->_map_field($field)) 
    265         $filter .= "($f=*" . rcube_ldap::quote_string($value) . "*)"; 
     263    if (is_array($this->prop['search_fields'])) 
     264    { 
     265      foreach ($this->prop['search_fields'] as $k => $field) 
     266        $filter .= "($field=*" . rcube_ldap::quote_string($value) . "*)"; 
     267    } 
     268    else 
     269    { 
     270      foreach ((array)$fields as $field) 
     271        if ($f = $this->_map_field($field)) 
     272          $filter .= "($f=*" . rcube_ldap::quote_string($value) . "*)"; 
     273    } 
    266274    $filter .= ')'; 
    267275 
Note: See TracChangeset for help on using the changeset viewer.