SimplePortal

Customization => Custom Coding => Topic started by: heumannt on September 07, 2011, 02:01:08 AM

Title: Add a user to a membergroup
Post by: heumannt on September 07, 2011, 02:01:08 AM
Hello all. I am hoping someone can at least point me in the right direction.

I am creating a PHP page that will allow a newly registered member to click a link that will load this page, and the code on the page will add the user to an "All Users" membergroup. The purpose is a kind of verification stage that this is actually a person. The "All Users" membergroup is what gives them access to the board.

What I don't know how to do is code the page to add the user to the membergroup. I'm not sure if there's a place for me to look for the functions that I need, and if it's a SP function or a SMF function.

If anyone has code to do this, I would very much appreciate it, but if anyone can just tell me where to look, I don't mind researching it myself.

Thanks everyone. SP is so awesome, and the help in this forum has already be awesome for me, just reading other posts.
Title: Re: Add a user to a membergroup
Post by: heumannt on September 07, 2011, 11:41:15 AM
I love being the 1st to update my own post. I think I may have found my answer, but feel free to correct me if I'm wrong.

SMF has a built in function called addMembersToGroup(). This looks like what would be used to add a member to a membergroup.

   void addMembersToGroup (mixed $members, int $group[, string $type[, bool $permissionCheckDone]])

http://support.simplemachines.org/function_db/index.php?action=view_function;id=593
SimplePortal 2.3.8 © 2008-2024, SimplePortal