1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API for add 'secondary_group_ids'

Discussion in 'XenForo Development Discussions' started by EricB, Nov 27, 2013.

  1. EricB

    EricB New Member


    depending the rights in my portal the user should get access to serveral forums.

    Is there a API for adding new "secondary_group_ids" to a user?

    Or do i have to read the given id´s for a user, walk through an array and check if a id is already existing? And if not, add the ID the die comma-seperated id-list?

    Thank you
  2. Jeremy

    Jeremy Well-Known Member

  3. EricB

    EricB New Member

    Thanks, was really easy:

    $userModel->addUserGroupChange($UserID, 'unique-key', 6);

    Without any save or else!
  4. Jeremy

    Jeremy Well-Known Member

    Note, if you manually remove them from the secondary group and do not remove the necessary upgrade record, the function will silently fail and do nothing.

Share This Page