RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Release Support > Older Versions > Release Candidate 1

For more information about the ads and why they're here, please see the FAQ
Reply
  #11  
Old 08-09-2007, 01:38 PM
em em is offline
Registered User
 
Join Date: May 2007
Posts: 9
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

What did you try? give me more informations, if I can help you....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12  
Old 08-21-2007, 11:48 PM
jay jay is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

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');
the ldap-addressbook is working fine
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13  
Old 08-23-2007, 08:40 AM
em em is offline
Registered User
 
Join Date: May 2007
Posts: 9
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14  
Old 08-31-2007, 04:16 PM
jay jay is offline
Registered User
 
Join Date: Aug 2007
Posts: 6
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

I found where it's not working!! on this line
Code:
$results = $cLdap->search ($ldapfields, "@" /* God, forgive me this nasty hack */, true);
I never get a result. If I replace "@" with some text e.g. the beginning of a name there is a result. I don't know why but the email field is not searchable (see also my post http://roundcubeforum.net/forum/index.php?topic=2084.0).

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
2) I installed the latest roundcube svn version (675)

Thanks
jay
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 09-03-2007, 07:14 AM
em em is offline
Registered User
 
Join Date: May 2007
Posts: 9
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16  
Old 10-13-2007, 08:50 AM
Registered User
 
Join Date: Oct 2007
Posts: 1
Downloads: 0
Uploads: 0
Default Re: ldap as default addressbook

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);
with:
Code:
$results = $cLdap->list_records();
bingo...it works great. hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 06:23 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community