Ignore:
Timestamp:
Feb 1, 2008 9:33:01 PM (5 years ago)
Author:
till
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r940 r987  
    871871 
    872872require_once('include/rcube_contacts.inc'); 
     873require_once('include/rcube_ldap.inc');  
    873874 
    874875$CONTACTS = new rcube_contacts($DB, $USER->ID); 
    875876$CONTACTS->set_pagesize(1000); 
     877 
     878$a_contacts = array();  
    876879                                    
    877880if ($result = $CONTACTS->list_records()) 
    878 {         
    879   $a_contacts = array(); 
     881{ 
    880882  while ($sql_arr = $result->iterate()) 
    881883    if ($sql_arr['email']) 
    882884      $a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name'])); 
    883    
    884   $OUTPUT->set_env('contacts', $a_contacts); 
    885 } 
     885} 
     886 
     887/* LDAP autocompletion */  
     888foreach ($CONFIG['ldap_public'] as $ldapserv_config)  
     889  {  
     890  if ($ldapserv_config['fuzzy_search'] != 1)  
     891    {  
     892    continue;  
     893        }  
     894          
     895  $LDAP = new rcube_ldap($ldapserv_config);  
     896  $LDAP->connect();  
     897  $LDAP->set_pagesize(1000); 
     898   
     899  $results = $LDAP->search($ldapserv_config['mail_field'], "");  
     900  
     901  for ($i = 0; $i < $results->count; $i++)  
     902        {  
     903        if ($results->records[$i]['email'] != '')  
     904          {  
     905          $email = $results->records[$i]['email'];  
     906          $name = $results->records[$i]['name'];  
     907                  
     908          $a_contacts[] = format_email_recipient($email, JQ($name));  
     909          }  
     910        }  
     911                  
     912  $LDAP->close();  
     913  }  
     914                                             
     915  if ($a_contacts)  
     916        {  
     917        $OUTPUT->set_env('contacts', $a_contacts);  
     918        }  
    886919 
    887920parse_template('compose'); 
Note: See TracChangeset for help on using the changeset viewer.