Roundcube Community Forum

Release Support => Pending Issues => Topic started by: dmrc on October 25, 2015, 11:14:57 PM

Title: LDAP address book images are not displayed
Post by: dmrc on October 25, 2015, 11:14:57 PM
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?
Title: Re: LDAP address book images are not displayed
Post by: alec on October 26, 2015, 03:12:24 AM
How do you map ldap attributes to addressbook fields (fieldmap)?
Title: Re: LDAP address book images are not displayed
Post by: dmrc on October 27, 2015, 11:45:37 AM
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?
Title: Re: LDAP address book images are not displayed
Post by: alec on October 27, 2015, 04:35:42 PM
The warning was fixed in 1.1.3. Upgrade, maybe this will fix the issue.
Title: Re: LDAP address book images are not displayed
Post by: dmrc on October 27, 2015, 04:37:52 PM
fixed in version 1.1.3

http://trac.roundcube.net/changeset/6cdffbf1b603f827cca116e2b29716d68543aeb4/github (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 :)
Title: Re: LDAP address book images are not displayed
Post by: dmrc on October 27, 2015, 04:43:47 PM
Thank you, alec.