Page 1 of 1

OpenKM 5: OpenLDAP + Mails

PostPosted:Wed Jan 05, 2011 2:16 pm
by flekschas
Hi,
at first we're happy about the new version of OpenKM. Nearly everything works fine. There is just one old problem I'm unable to solve.
We're using OpenLDAP for authentication. In order to organize our users and their roles we have different groups in our directory. When trying to get the mail addresses of all users for notification we're unable to read out more than one group.

Our user directory looks like this:
Code: Select all
dc=de
   dc=charite
      ou=users
         ou=groupA
            uid=user1
            uid=user2
         ou=groupB
            uid=user3
      ou=roles
And our config
Code: Select all
principal.adapter=com.openkm.principal.LdapPrincipalAdapter
principal.ldap.server=ldap://localhost:389
principal.ldap.security.principal=cn=admin,dc=charite,dc=de
principal.ldap.security.credentials=***

principal.ldap.user.search.base=ou=users,dc=charite,dc=de
principal.ldap.user.search.filter=(objectclass=inetOrgPerson)
principal.ldap.user.attribute=uid
principal.ldap.users.by.role.search.filter=(&(objectClass=inetOrgPerson)(uid={0}))
principal.ldap.role.search.base=ou=roles,dc=charite,dc=de
principal.ldap.role.search.filter=(objectclass=groupOfNames)
principal.ldap.role.attribute=cn
principal.ldap.roles.by.user.search.filter=(&(objectClass=groupOfNames)(cn={0}))
principal.ldap.mail.search.base=uid={0},ou=groupA,ou=users,dc=charite,dc=de
principal.ldap.mail.search.filter=(objectclass=inetOrgPerson)
principal.ldap.mail.attribute=mail
In general I though about changing the mail setting to:
principal.ldap.mail.search.base=uid={0},ou=groupA,ou=users,dc=charite,dc=de (deleted)
principal.ldap.mail.search.filter=(&(objectclass=inetOrgPerson)(uid={0})) (added)
OpenKM should look for any user below the base and filter out the user's mail of the current uid. But unfortunately this does not work.

Any ideas how I could solve this problem?
Thanks

Re: OpenKM 5: OpenLDAP + Mails

PostPosted:Wed Jan 05, 2011 6:48 pm
by jllort
The problem is that's needed more complex query for getting more than one branch, and openkm by default not makes it. The solution to special ldap structure and other is creating a minimal class inspired in LdapPrincipalAdapter you can found here http://openkm.svn.sourceforge.net/viewv ... principal/

You need to compile it class, and build openkm, really it's not complicated ( it's easy ), but need some extra job ( install developer environment basically )

Re: OpenKM 5: OpenLDAP + Mails

PostPosted:Mon Jan 10, 2011 1:02 pm
by flekschas
Okay thanks! So now I know what to do.