[JDEV] Patch to mod_groups.c to add remove capability for admins

Nathan Sharp spamnps+jabber at phoenix-int.com
Tue May 28 11:33:47 CDT 2002


Using mod_groups you can add groups which are forced into everyone's 
rosters from the server-side.  As an admin, you can send <iq> packets 
which add users to groups in the xdb backend.  The problem was that 
there was no equivalent remove capability.  This patch adds the ability 
to remove users with a slightly modified <iq>.  Note that this has no 
effect on users "registering" and "unregistering" themselves from public 
groups, only on <required> groups which the admin maintains.  

The IQ to add a user looks more or less like:
<iq type="set" to="domain.com/groups/MyGroup" from="adminUser at domain.com">
  <query xmlns="jabber:iq:browse">
    <user jid='someUser at domain.com' name='UserAlias' />
  </query>
</iq>

And to remove add an action='remove' to the <user> tag:
<iq type="set" to="domain.com/groups/MyGroup" from="adminUser at domain.com">
  <query xmlns="jabber:iq:browse">
    <user action="remove" jid='someUser at domain.com' name='UserAlias' />
  </query>
</iq>

Note that this patch includes a patch I found somewhere a while back 
which fixes a bug w/ the admin <iq>s.   This patch should be applied 
against the 1.4.2 jabberd server.  

  Nathan

-- 
Nathan P Sharp
Phoenix Integration
1715 Pratt Dr
Suite 2000
540-961-7215
540-961-5831 (fax)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mod_groups.c.patch
URL: <https://www.jabber.org/jdev/attachments/20020528/933b54bb/attachment-0002.txt>


More information about the JDev mailing list