Author Topic: Groups in LDAP Addressbook  (Read 5166 times)

Offline vldmrmail

  • Newbie
  • *
  • Posts: 2
Groups in LDAP Addressbook
« on: December 03, 2016, 06:43:27 PM »
Hello, friends.

Please help me with groups in LDAP Addressbook. I have my own configuration file in Roundcube 1.2. Contacts in LDAP Addressbook work normal, but I can't create my own groups.

Code: [Select]
$config['ldap_public']['public'] = array(
    'name'                  => 'LDAP Contacts',
    'hosts'                 => array('127.0.0.1'),
    'port'                  => 389,
    'use_tls'               => false,

    'base_dn'               => 'ou=abook,dc=hell,dc=local',
    'bind_dn'               => 'cn=Manager,dc=hell,dc=local',
    'bind_pass'             => 'password',
    'user_specific'         => false,
    'writable'              => true,

    'LDAP_Object_Classes'   => array("top", "inetOrgPerson"),
    'LDAP_rdn'              => 'mail',

    'name_field'            => 'cn',
    'firstname_field'       => 'gn',
    'surname_field'         => 'sn',
    'email_field'           => 'mail',
    'phone:work_field'      => 'telephoneNumber',
    'phone:workfax_field'   => 'facsimileTelephoneNumber',
    'phone:mobile_field'    => 'mobile',
    'address_field'         => 'postalAddress',
    'notes_field'           => 'description',

    'search_fields'         => array ('mail','cn','sn'),
    'required_fields'       => array('cn','sn','mail'),
    'sort'                  => 'cn',
    'scope'                 => 'sub',
    'filter'                => '(objectClass=inetOrgPerson)',
    'global_search'         => true,
    'fuzy_search'           => true,

    'groups'  => array(
        'base_dn'           => '',
        'scope'             => 'sub',
        'filter'            => '(objectClass=groupOfNames)',
        'object_classes'    => array('top', 'groupOfNames'),
        'member_attr'       => 'member',
        'name_attr'         => 'cn',
        'email_attr'        => 'mail',
        'member_filter'     => '(objectclass=*)',
        'vlv'               => false,
        'class_member_attr' => array(
            'groupofnames'       => 'member',
            'groupofuniquenames' => 'uniquemember'
        ),
    ),
);

When i push button to create group in Roundcube, i have a window with error. In Roundcube logfile i see that:

Code: [Select]
[03-Dec-2016 23:22:27 Europe/Moscow] PHP Warning:  ldap_add(): Add: Object class violation in /usr/local/www/roundcube/vendor/kolab/net_ldap3/lib/Net/LDAP3.php on line 209
[03-Dec-2016 23:22:27 +0300]: <04h6bir6> PHP Error: LDAP: Adding entry cn=Grp1,ou=abook,dc=hell,dc=local failed. Object class violationcn=Grp1,ou=abook,dc=hell,dc=local (POST /?_task=addressbook&_action=group-create)

Also, I trying to create empty group manually with ldapadd command, but my group don't displayed in Roundcube :(

Code: [Select]
dn: cn=ACDC,ou=abook,dc=hell,dc=local
objectClass: top
objectClass: groupOfNames
cn: ACDC
member:

Please help me to get woring groups in LDAP addressbook.



Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Groups in LDAP Addressbook
« Reply #1 on: December 05, 2016, 02:40:04 AM »
This may help: https://github.com/roundcube/roundcubemail/pull/290 Also, if you enable ldap_debug option in Roundcube you can see more info about what queries are sent to the ldap server and what it returns, in the log.

Offline vldmrmail

  • Newbie
  • *
  • Posts: 2
Re: Groups in LDAP Addressbook
« Reply #2 on: December 05, 2016, 09:00:49 AM »
This may help: https://github.com/roundcube/roundcubemail/pull/290 Also, if you enable ldap_debug option in Roundcube you can see more info about what queries are sent to the ldap server and what it returns, in the log.
YES! Thanx a lot for solution! One string of code help me to get nirvana :)