[ejabberd] Roster module

Leif Johansson leifj at it.su.se
Fri Aug 6 05:13:07 MSD 2004

Antoine MALGRAS wrote:
> Hi,
> I have nearly finish my first module for ejabberd.
> This module creates/updates the roster of users depending of ldap informations.
> It retreives the groups the user belong to and all the members of those groups.
> For each value it inserts two mnesia items in the roster table, and
> auto-subscribe the two users. But there is a problem, instead of two
> {both, none} status, after auto-subscription I get one user with {to,
> in} status and the other with {both, none} ...
> In order to use it, you must :
> - insert 'groups' values in ldap (at least 2 users must have the same
> group for their rosters to be updated)
> - save mod_roster_2.erl in the src folder
> - replace mod_roster by mod_roster_2 in ejabberd.cfg
> Could you please have a look to my module and tell me what do you
> think about the auto-subscription part.

imo it is a good start but the correct way to find group membership in
ldap is to search for objects of type groupOfUniqueNames or groupOfNames
where uniqueMember/member=<the DN>. The attributes/objectClasses should
be configurable at run-time.

To control which groups are used to define roster entries you should
optionally check for a (configurable) objectClass (eg jabberRosterGroup)
or attribute (eg locallyDefinedGroupProperty=jabbergroup)

	Cheers Leif

More information about the ejabberd mailing list