Author Topic: LDAP Address Book  (Read 1865 times)

Offline sharbich

  • Newbie
  • *
  • Posts: 5
LDAP Address Book
« on: May 15, 2021, 12:56:10 AM »
Hello,
I added an LDAP address book in Roundcube. That works so far. Only when I wanted to add my work address to my private address.
Code: [Select]
. . .
       // Roundcube   => LDAP
    'name'           => 'cn',
    'surname'        => 'sn',
    'firstname'      => 'givenName',
    'birthday'       => 'birthDate',
    'jobtitle'       => 'title',
    'email'          => 'mail',
    'phone:home'     => 'homePhone',
    'phone:work'     => 'telephoneNumber',
    'phone:mobile'   => 'mobile',
    'address:home'   => 'homePostalAddress',
    'address:work'   => 'postalAddress',
    'street'         => 'street',
    'zipcode'        => 'postalCode',
    'locality'       => 'l',
    'organization'   => 'o',
    'notes'          => 'description',
. . .
I got the following error message while saving:
Code: [Select]
Mai 15 06:48:16 dsme01 roundcube[480]: PHP Warning:  ldap_mod_replace(): Value array must have consecutive indices 0, 1, ... in /var/www/html/roundcube/program/lib/Roundcube/rcube_ldap_generic.php on line 153
Mai 15 06:48:16 dsme01 roundcube[480]: <id67ocms> PHP Error: ldap_mod_replace() failed with Success (POST /?_task=addressbook&_framed=1&_orig_source=Local&_action=save)
There's something wrong with the uniqueness. What am I doing wrong?

Greetings from Stefan Harbich

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: LDAP Address Book
« Reply #1 on: May 15, 2021, 02:48:41 AM »
I'm afraid most people use LDAP addressbook in readonly mode, so there might be some bugs in the code that writes to LDAP. Any debug logs for this case?

Offline sharbich

  • Newbie
  • *
  • Posts: 5
Re: LDAP Address Book
« Reply #2 on: May 15, 2021, 04:48:57 AM »
Roundcube connects the "homePostalAddress" and "postalAddress" with street, ZIP code and location as an array.
The word array is in the folder "homePostalAddress" and "postalAddress" as an array. The allocation of the place, street and ZIP code must be done differently.
Code: [Select]
Mai 15 09:27:47 dsme01 roundcube[1578]: <vnm4pq9n> C: Add uid=erich-richard.ahrens,ou=users,dc=example,dc=com: Array
Mai 15 09:27:47 dsme01 roundcube[1578]:     [homepostaladdress] => Array
Mai 15 09:28:28 dsme01 roundcube[1533]: <vnm4pq9n> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:28:28 dsme01 roundcube[1533]:     [homepostaladdress] => Array
Mai 15 09:28:28 dsme01 roundcube[1533]:             [0] => Array
Mai 15 09:28:28 dsme01 roundcube[1533]: <vnm4pq9n> C: Add uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:28:50 dsme01 roundcube[1531]: <vnm4pq9n> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:28:50 dsme01 roundcube[1531]:     [homepostaladdress] => Array
Mai 15 09:28:50 dsme01 roundcube[1531]:             [0] => Array
Mai 15 09:29:14 dsme01 roundcube[2624]: <vnm4pq9n> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:29:14 dsme01 roundcube[2624]:     [homepostaladdress] => Array
Mai 15 09:29:14 dsme01 roundcube[2624]:             [0] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]: <dt146m3g> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:34:16 dsme01 roundcube[4290]:     [homepostaladdress] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]:             [0] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]:             [1] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]:     [street] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]:     [postalcode] => Array
Mai 15 09:34:16 dsme01 roundcube[4290]:     [l] => Array
Mai 15 09:34:48 dsme01 roundcube[4286]: <dt146m3g> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:34:48 dsme01 roundcube[4286]:     [homepostaladdress] => Array
Mai 15 09:34:48 dsme01 roundcube[4286]:             [0] => Array
Mai 15 09:34:48 dsme01 roundcube[4286]:     [street] => Array
Mai 15 09:34:48 dsme01 roundcube[4286]:     [postalcode] => Array
Mai 15 09:34:48 dsme01 roundcube[4286]:     [l] => Array
Mai 15 09:36:07 dsme01 roundcube[4286]: <dt146m3g> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:36:07 dsme01 roundcube[4286]:     [homepostaladdress] => Array
Mai 15 09:36:07 dsme01 roundcube[4286]:             [0] => Array
Mai 15 09:38:31 dsme01 roundcube[5802]: <sdjs03q1> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:38:31 dsme01 roundcube[5802]:     [homepostaladdress] => Array
Mai 15 09:38:31 dsme01 roundcube[5802]:             [0] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]: <sdjs03q1> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:38:39 dsme01 roundcube[5793]:     [homepostaladdress] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]:             [0] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]:             [1] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]:     [street] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]:     [postalcode] => Array
Mai 15 09:38:39 dsme01 roundcube[5793]:     [l] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:40:24 dsme01 roundcube[6315]:     [homepostaladdress] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]:             [0] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]:             [1] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]:     [street] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]:     [postalcode] => Array
Mai 15 09:40:24 dsme01 roundcube[6315]:     [l] => Array
Mai 15 09:40:37 dsme01 roundcube[6318]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:40:37 dsme01 roundcube[6318]:     [homepostaladdress] => Array
Mai 15 09:40:37 dsme01 roundcube[6318]:             [0] => Array
Mai 15 09:42:00 dsme01 roundcube[6316]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:00 dsme01 roundcube[6316]:     [homepostaladdress] => Array
Mai 15 09:42:00 dsme01 roundcube[6316]:             [0] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:17 dsme01 roundcube[6315]:     [homepostaladdress] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]:             [0] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]:     [street] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]:     [postalcode] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]:     [l] => Array
Mai 15 09:42:17 dsme01 roundcube[6315]: <7q77a8lu> C: Add uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:17 dsme01 roundcube[6315]:     [postaladdress] => Array
Mai 15 09:42:36 dsme01 roundcube[6369]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:36 dsme01 roundcube[6369]:     [homepostaladdress] => Array
Mai 15 09:42:36 dsme01 roundcube[6369]:             [0] => Array
Mai 15 09:42:36 dsme01 roundcube[6369]: <7q77a8lu> C: Add uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:36 dsme01 roundcube[6369]:     [postaladdress] => Array
Mai 15 09:42:56 dsme01 roundcube[6316]: <7q77a8lu> C: Replace uid=sarah.harbich,ou=users,dc=example,dc=com: Array
Mai 15 09:42:56 dsme01 roundcube[6316]:     [homepostaladdress] => Array
Mai 15 09:42:56 dsme01 roundcube[6316]:             [0] => Array
Mai 15 09:42:56 dsme01 roundcube[6316]:     [street] => Array
Mai 15 09:42:56 dsme01 roundcube[6316]:     [postalcode] => Array
Mai 15 09:42:56 dsme01 roundcube[6316]:     [l] => Array
I have set the address book to read-only. Now everything is displayed correctly.