![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#11
|
|||
|
|||
|
What did you try? give me more informations, if I can help you....
|
|
#12
|
|||
|
|||
|
I'm trying to implement this ldap-autofill too, but without success.
my code of compose.inc looks like this at the end. Code:
/****** get contacts for this user and add them to client scripts ********/
require_once('include/rcube_contacts.inc');
require_once('include/rcube_ldap.inc');
$CONTACTS = new rcube_contacts($DB, $_SESSION['user_id']);
$CONTACTS->set_pagesize(1000);
if ($result = $CONTACTS->list_records())
{
$a_contacts = array();
while ($sql_arr = $result->iterate())
if ($sql_arr['email'])
$a_contacts[] = format_email_recipient($sql_arr['email'], JQ($sql_arr['name']));
//Add for LDAP search
foreach ($CONFIG['ldap_public'] as $ldapserv_config)
{
$ldapfields = array($ldapserv_config['email_field'],$ldapserv_config['name_field']);
$cLdap = new rcube_ldap($ldapserv_config);
$cLdap->connect ();
$cLdap->bind($ldapserv_config['bind_dn'], $ldapserv_config['bind_pass']);
$results = $cLdap->search ($ldapfields, "@" /* God, forgive me this nasty hack */, true);
$cLdap->close ();
}
while ($ldap_arr = $results->next())
{
if ($ldap_arr['email'])
$a_contacts[] = format_email_recipient($ldap_arr['email'], JQ($ldap_arr['name']));
}
//End of LDAP search
$OUTPUT->set_env('contacts', $a_contacts);
}
parse_template('compose');
but if I type in the to: filed some names no email appears except the one address of the normal addressbook. any idea what's wrong? btw: if I change to the ldap-addressbook RC shows "loading..." but nothing will be displayed, I have to use the search for seeing some addresses. is this normal? or could this be a similar problem? thanks for any help jay |
|
#13
|
|||
|
|||
|
sorry, no ideas... perhaps look in ldap logs
which version of RC do you use? I test this code on RC1, now I use on svn version of the 18 june for me in ldap-addressbook nothing is displaying whereas I make a search |
|
#14
|
|||
|
|||
|
I found where it's not working!! on this line
Code:
$results = $cLdap->search ($ldapfields, "@" /* God, forgive me this nasty hack */, true); Do you have an idea why the email field is not searchable? BTW: 1) In main.inc.php I configured the ldap email filed like this Code:
'email_field' => 'mail', // this field represents the contact's e-mail Thanks jay |
|
#15
|
|||
|
|||
|
I try with "@" and it is working for me... I use my domain name in search criteria because I only have users of my network into my ldap.
maybe "@" doesn't work for you because of your character encoding is your file compose.inc, your web server and your browser use the same character encoding? For me I install roundcube on a Debian with Apache and all character encoding is UTF8. |
|
#16
|
|||
|
|||
|
Hi all...I was working on this and noticed that the ldap query appears as soon as you compose. I had similar problems with the addresses since it would not search the email field. Then I figured since it has to grab the whole list and do a search later based on type in, then why even use search? It appears the the regular address book uses the list_records() instead of search()
So.. I replaced this in the compose.inc file mentioned above: Code:
$results = $cLdap->search ($ldapfields, "@" /* God, forgive me this nasty hack */, true); Code:
$results = $cLdap->list_records(); |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
| For more information about the ads and why they're here, please see the FAQ |