Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Code to add user to group

Quote Reply
Code to add user to group
I noticed that when my AutoLogin plugin adds users to GForum it doesn't add them as a "registered user" to the UserGroup table. So even though their User record says they are registered they behave as if they are not.

I assume that I need to add a bit of code that adds new users to the UserGroup table as registered, but I can't figure it out. If this is indeed the case, can someone share what they think this code should be?

hint:
GForum::Group::add_user({ group_id => '2', user_username => $username }); does not work.

If I am on the wrong track as far as "registering" new users I would appreciate a correction Wink
Michael Coyne
seaturtle.org
Quote Reply
Re: [mcoyne] Code to add user to group In reply to
NEVERMIND!

It works perfectly when I take out the completely unnecessary brackets Blush
Michael Coyne
seaturtle.org
Quote Reply
Re: [mcoyne] Code to add user to group In reply to
Perhaps someone on the GT team can tell me if this is an acceptable way to get a user listed as registered in the UserGroup table. Is there another way that I should be doing that? Is it even necessary (it seems to be)?

thanks,
Michael Coyne
seaturtle.org