User Group questions


Well-known member
1) XenForo_DataWriter_UserGroup
2) Use a user group promotion, it'll be the easiest. Here's a snippet from my license validation code:
        $userModel = XenForo_Model::create('XenForo_Model_User');
        $userModel->removeUserGroupChange($userId, 'xiLicenseValidationValidated'); // remove the record so that if they aren't in the group, they'll be promoted.
        $userModel->addUserGroupChange($userId, 'xiLicenseValidationValidated', XenForo_Application::get('options')->xilicensevalidationGroup);
3. Where are you checking user group membership?

Robin De Schepper

New member
1) Could you post a little example snippet? If it's too much I'll just try to figure it out myself.
3) Either inside a ControllerPublic action or View's renderHtml.


Well-known member
If you are checking it inside of a view, you should just use the xen helper ismemberof. See Brogan's resource, he explains how to use it. As for creating it, you should look into how XenForo_ControllerAdmin_UserGroup::actionSave() uses XenForo_DataWriter_UserGroup.