Roundcube Community Forum

 

LDAP address book images are not displayed

Started by dmrc, October 25, 2015, 11:14:57 PM

Previous topic - Next topic

dmrc

rouncube 1.1.2
openldap 2.4
Google translation :)

config:

$rcmail_config['address_book_type'] = 'ldap';
$rcmail_config['ldap_public']['addressbook'] = array(
     ...
    'LDAP_Object_Classes' => array('inetOrgPerson'),
    'required_fields'     => array('cn', 'sn', 'mail'),
    'LDAP_rdn'      => 'cn',
    'search_fields' => array('mail', 'cn'),
     ...
    'filter'        => '(objectClass=inetOrgPerson)',
     ...
);

$config['autocomplete_addressbooks'] = array('addressbook');

// 1 - Ask if sender is not in address book !
$config['show_images'] = 1;


add contacts through the rouncube:

slapd[]: ADD dn="cn=instagram,ou=addressbook,dc=example,dc=com"
slapd[]: RESULT err=0


OK :)

choose to post a message in the rouncube from [email protected]

Images are not displayed :(

slapd log:

slapd[]: SRCH base="ou=addressbook,dc=example,dc=com" scope=2 deref=0 filter="(&(objectClass=inetOrgPerson)(|([email protected])))"
slapd[]: SEARCH RESULT err=0 nentries=0


nentries=0
(|(cn= ... ))  :(

how to change the attribute cn to mail in the search box?

alec

How do you map ldap attributes to addressbook fields (fieldmap)?

dmrc

Quote from: alec on October 26, 2015, 03:12:24 AM
How do you map ldap attributes to addressbook fields (fieldmap)?


    'search_fields' => array('mail', 'cn'),
    'name_field'    => 'cn',
    'email_field'   => 'mail',
    'surname_field' => 'sn',
    'firstname_field' => 'givenName',

  'fieldmap' => array(
    'name'         => 'cn',
    'surname'      => 'sn',
    'middlename'   => 'initials',
    'firstname'    => 'givenName',
    'jobtitle'     => 'title',
    'department'   => 'departmentNumber',
    'email'        => 'mail',
    'phone:work'   => 'telephoneNumber',
    'phone:mobile' => 'mobile',
    'street'       => 'street',
    'zipcode'      => 'postalCode',
    'locality'     => 'l',
    'organization' => 'o',
    'notes'        => 'description',
    'website'      => 'labeledURI',
    'photo'        => 'jpegPhoto',
  ),



[Europe/Moscow] PHP Warning: array_walk() expects parameter 1 to be array, string given in /pach to/program/lib/Roundcube/rcube_ldap.php on line 844


PHP Version 5.4.45

where to look for the problem?

alec

The warning was fixed in 1.1.3. Upgrade, maybe this will fix the issue.

dmrc

fixed in version 1.1.3

http://trac.roundcube.net/changeset/6cdffbf1b603f827cca116e2b29716d68543aeb4/github

program/lib/Roundcube/rcube_ldap.php

            else {
                // map address book fields into ldap attributes
                $attributes = array();
                foreach ((array) $fields as $field) {
                    if ($this->coltypes[$field] && ($attrs = $this->coltypes[$field]['attributes'])) {
                        $attributes = array_merge($attributes, (array) $attrs);
                    }
                }
            }


topic closed :)