Author Topic: LDAP address book images are not displayed  (Read 3833 times)

Offline dmrc

  • Newbie
  • *
  • Posts: 8
LDAP address book images are not displayed
« on: October 25, 2015, 11:14:57 PM »
rouncube 1.1.2
openldap 2.4
Google translation :)

config:
Code: [Select]
$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:
Code: [Select]
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 no-reply@mail.instagram.com

Images are not displayed :(

slapd log:
Code: [Select]
slapd[]: SRCH base="ou=addressbook,dc=example,dc=com" scope=2 deref=0 filter="(&(objectClass=inetOrgPerson)(|(cn=no-reply@mail.instagram.com)))"
slapd[]: SEARCH RESULT err=0 nentries=0

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

how to change the attribute cn to mail in the search box?
« Last Edit: October 27, 2015, 04:46:11 PM by dmrc »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: LDAP address book images are not displayed
« Reply #1 on: October 26, 2015, 03:12:24 AM »
How do you map ldap attributes to addressbook fields (fieldmap)?

Offline dmrc

  • Newbie
  • *
  • Posts: 8
Re: LDAP address book images are not displayed
« Reply #2 on: October 27, 2015, 11:45:37 AM »
How do you map ldap attributes to addressbook fields (fieldmap)?

Code: [Select]
    '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',
  ),

Code: [Select]
[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?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: LDAP address book images are not displayed
« Reply #3 on: October 27, 2015, 04:35:42 PM »
The warning was fixed in 1.1.3. Upgrade, maybe this will fix the issue.

Offline dmrc

  • Newbie
  • *
  • Posts: 8
Re: LDAP address book images are not displayed
« Reply #4 on: October 27, 2015, 04:37:52 PM »
fixed in version 1.1.3

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

program/lib/Roundcube/rcube_ldap.php
Code: [Select]
            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 :)

Offline dmrc

  • Newbie
  • *
  • Posts: 8
Re: LDAP address book images are not displayed
« Reply #5 on: October 27, 2015, 04:43:47 PM »
Thank you, alec.