how to make groups and let new user to choose among them ?

hi all,

I have installed ejabberd server. It Rocks !

I have a small community and would like ot allow them to create account and to choose a group to be in.

This is possible by adding them manually under the web interface but is there any way to automate it ?

for example:

I create 3 groups on server ( designer, programmer, marketing). And new users that connect to server can choose among these groups, but cannot create new group, etc...

What would be the best way to do this ?

Regards,
kollo

Not possible; one idea

If you enable mod_shared_roster, you can create groups and manually add members to them using the ejabberd Web Admin. It would be nice, but there is no way to allow a user to add himself to a group.

One idea: install mod_ctlextra from ejabberd-modules SVN. It provides several commands that you can execute in the system shell. Among those commands there are:

  • srg-user-add user server group host ---> add user@server to group on host
  • srg-user-del user server group host ---> delete user@server from group on host
  • srg-list-groups host ---> list the shared roster groups from host

Then you write a small web page (in PHP or whatever you prefer) that shows the available groups, the user introduces his JID and selects the group he wants to join. Then your page makes a shell call to add that user to the group.

mmm Should be enough :)

hello badlop,

thx for your fast anwser, I already have mod_shared_roster enabled, I played a while with it but found by myself it is not enough.

I will digg into your idea. It seems easy to setup and not so much uncomfortable ;)
thx again for your help!

regards,

oliver

Works fine but about refreshing roster on client ?

hi badlop,

I did the script and it works fine now, using ejabberdctl etc..
anyway the roster on the client is not updated until I disconnect / reconnect to the server.

Does ejabberd send something to the client when I change user's group with ejabberdctl ?

Any idea how to let the clients know that user have changed his group?

Regards,

Feature request: push group changes to members

That is not possible right now in ejabberd. So I've added a feature request: When a member is added/removed to group, send roster upgrade to group members.

If you have some spare time, you could implement it :D

thx! another thing ebout deleted SRG

hi badlop!

Seems you're arround ;)

thx for your answer, anyway I don't think I'm good enough in programming as you to make such mod without bugs ;)

Another thing about SRG:
As I saw on other posts, SRG are virtual groups that users should not be able to modify. I just deleted few SRG from my client (Gajim) and now SRG doesn't appear anymore on my client, even when disconnect / reconnect.
It seems the roster (mod_roster ?) indicate my client that these groups no more exist ?!
anyway contacts in deleted groups are now in General (default) group.

Is there a bug or is there anything to forbidden SRG deletion from client ?
I surelly missed some option :)

Best Regards,
Oliver

PS: Anyway if I found a way to developp the "push group change" without bug I'll let you know.

Edited: (to reproduce the phenomen without deleting group)

shared_roster on

SRG A
 -Doug
SRG B
 -Bill

If I move Bill to SRG A, SRG B diseapper from client (because it is empty)
If I add (from ejabberd webadmin) an another user (John) to SRG B and deco/reco client, SRG B is still not showed. Same if I use the webadmin to bring back Bill to SRG B

Check in Web Admin personal rosters: maybe Gajim adds contacts

In Gajim 0.11.4, if you delete a group of the roster but you don't delete also the contacts inside it, Gajim will add the contacts to your personal roster!

You can see that in the Web Admin -> vhosts -> your host -> Users -> your user -> Roster. When you delete the 'virtual' group using Gajim, its members are added to the personal roster.

thx , any chance to have a trick to refresh contact list ?

thank you badlop!

any chance to have a trick to refresh user's contact list when a new shared group user register ?

Actually when a new user register, he see nobody and nobody see him until he disconnect / reconnect and other users do the same.

I though about disco / reco everybody when new user register but I found it a bit ugly :/

I know you have a lot of job but maybe you have an idea on how to do a little trick while waiting for a patch.

Thx anyway for your time.

kollo

Syndicate content