Author Topic: Saving contacts to LDAP  (Read 4679 times)

Offline trapper1204

  • Newbie
  • *
  • Posts: 8
Saving contacts to LDAP
« on: March 31, 2009, 01:47:08 PM »
I have LDAP configured and generally it works. But I can't get RoundCube to write to the LDAP address book. This is kinda of a must if I am to switch to roundcube from squirrelmail.

I would settle for LDAP Global Address Book, and  MySQL address book for personal Address books and Groups.. if thats possible.

Here is my openLDAP config from Webmin

Root DN for LDAP Database : dc=foxlakecreenation,dc=com
Administration Login DN : cn=Manager,dc=foxlakecreenation,dc=com
Administration Password Unix Encrypted : XXXXXXXXXXXXXX


Here is my RoundCube LDAP config from main.inc.php
$rcmail_config['address_book_type'] = 'ldap';
$rcmail_config['ldap_public']["foxlakecreenation"] = array(
    'name'          => 'foxlakecreenation.com',
    'user_specific' => false,
    'hosts'         => array("127.0.0.1"),
    'port'          => 389,
    'base_dn'       => "dc=foxlakecreenation,dc=com",
    'bind_dn'       => "cn=Manager,dc=foxlakecreenation,dc=com",
    'bind_pass'     => "*************",
    'writable'       => true,   
    'ldap_version'  => "3",       // using LDAPv3
    'search_fields' => array('mail', 'cn'),  // fields to search in
    'name_field'    => 'cn',    // this field represents the contact's name
    'email_field'   => 'mail',  // this field represents the contact's e-mail
    'surname_field' => 'sn',    // this field represents the contact's last name
    'firstname_field' => 'givenName',  // this field represents the contact's first name
    'scope'         => 'sub',   // search mode: sub|base|list
    'fuzzy_search'  => true);   // server allows wildcard search

// An ordered array of the ids of the addressbooks that should be searched
// when populating address autocomplete fields server-side. ex: array('sql','Verisign');
$rcmail_config['autocomplete_addressbooks'] = array('foxlakecreenation');

// don't allow these settings to be overriden by the user
$rcmail_config['dont_override'] = array();


When I try to add a contact I get his in the error log.
PHP Warning:  Invalid argument supplied for foreach() in /usr/share/roundcubemail/program/include/rcube_ldap.php on line 424

which is this line.

 424     foreach ($this->prop["required_fields"] as $fld) {


What does all this mean? and how can I fix it?

Travis Harper
« Last Edit: April 02, 2009, 10:17:48 AM by trapper1204 »

Offline trapper1204

  • Newbie
  • *
  • Posts: 8
Editing exiting entries work
« Reply #1 on: April 06, 2009, 03:26:45 PM »
Ok, To follow up on my previous post....

I can edit existing entries in the ldap address book, except for the display name.
So I have concluded that the display name field is the culprit.

Ok so I changed displayName to cn in the main.inc.php  but I get a differnet error.

I changed it back to displayName.

So, I guess the adding contacts is failing on the displayName.. but why.

I wish I knew more about LDAP... this is probably quite simple... but since I already deployed RoundCube.. DOE!!! I don't really want to mess around experimenting... guess I should have stuck with SquirrelMail a little longer... but.. uggg.. its uuugggly. Roundcube so pretty.lol..

Offline Julius Caesar

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 498
    • http://www.de-keizer.net/
Saving contacts to LDAP
« Reply #2 on: April 07, 2009, 02:48:01 AM »
Can you add contacts to the LDAP, using the
  • [/B] symbol in the message header (next to a contacts name), when displaying a message?
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

Offline binco

  • Newbie
  • *
  • Posts: 3
Same Problem and possible solution
« Reply #3 on: April 08, 2009, 10:03:46 AM »
I've got the same problem today. i think, it's caused by the LDAP-Protocol. You cant simply change the value of the attribute, when its the RDN. You have to Copy the entry and delete the old one. It's just a sugest, but maybe the reason.

Binco

Offline trapper1204

  • Newbie
  • *
  • Posts: 8
Still can not save to LDAP
« Reply #4 on: May 08, 2009, 12:28:16 PM »
I still can not save address to the address book if I am using LDAP.

The plus sign does not work, nor does adding the contact throught the roundcube interface.

I can edit an exiting entry as long as its not the Display Name Field.
I can edit any other field.. Name, Last Name, Email.. and the changes stick. there is no error.

When Creating a new contact it must be erroring on the Display Name entry.
That entry is also mandatory, I can't just leave it out.

My hunch is that Roundcube is calling it display name but the command to the LDAP backend is calling something else.. therefor the LDAP complains the field does not exist, and roundcube produces an error.

Can anyone confirm this.