[ejabberd] Shared Roster, Automation, LDAP and Databases

Badlop badlop at gmail.com
Sat Aug 9 17:57:54 MSD 2008


On Fri, Aug 8, 2008 at 9:31 PM, Adam Hubscher <webmaster at x-zen.cx> wrote:
> Hey List, I was trying to register at the forums as well but it appears that
> the captcha is never correct =/

Yes, there was a problem in the website and any response to a captcha
was considered wrong. It's fixed now.

> the mod_shared_roster module only utilizes the mnesia database.

Right, it stores in an internal Mnesia table.


> I am not sure of how I could
> interact with this with a python (or otherwise) script

> I am
> wondering if there is the ability for me to, through a scripting language
> that I am familiar with (perl, python, php, or bash), to add the information
> for a shared roster group appropriately to either the mnesia database - or -

Some time ago I wrote some ejabberdctl commands in a contributed module:
http://www.ejabberd.im/mod_ctlextra

If you compiled ejabberd from source code, you can simply:
1. Copy this file to the src/ dir
  http://svn.process-one.net/ejabberd-modules/mod_ctlextra/trunk/src/mod_ctlextra.erl
2. It will be compiled and installed with all the other ejabberd modules
3. Enable the module in ejabberd.cfg . No options are required.
4. Start ejabberd
5. Execute ejabberdctl commands in a system shell


In this example, the Jabber server is the default "localhost".
I create group1, add two members, then delete both members and the group:

$ ejabberdctl srg-list-groups localhost

$ ejabberdctl srg-create group1 localhost Group_1 Test_Group group1

$ ejabberdctl srg-list-groups localhost
group1

$ ejabberdctl srg-get-info group1 localhost
name: "Group_1"
displayed_groups: ["group1"]
description: "Test_Group"
members:

$ ejabberdctl srg-user-add user1 localhost group1 localhost

$ ejabberdctl srg-get-info group1 localhost
name: "Group_1"
displayed_groups: ["group1"]
description: "Test_Group"
members: user1 at localhost

$ ejabberdctl srg-user-add user2 localhost group1 localhost

$ ejabberdctl srg-get-info group1 localhost
name: "Group_1"
displayed_groups: ["group1"]
description: "Test_Group"
members: user1 at localhost user2 at localhost

$ ejabberdctl srg-user-del user1 localhost group1 localhost

$ ejabberdctl srg-user-del user2 localhost group1 localhost

$ ejabberdctl srg-get-info group1 localhost
name: "Group_1"
displayed_groups: ["group1"]
description: "Test_Group"
members:

$ ejabberdctl srg-delete group1 localhost


 ---


More information about the ejabberd mailing list