Tweaking Registrant Group Add-on
Permalink Browser Info Environment
Hi,
I'm trying to tweak the controller so it only adds users to a group if they've entered a certain code (12345):
This doesn't seem to work, any ideas?
Thanks
Dave
I'm trying to tweak the controller so it only adds users to a group if they've entered a certain code (12345):
public function on_user_add($userInfo) { // Get attribute $ak = CollectionAttributeKey::getByHandle('membership_code'); if ( $ak == "12345") { $co = new Config(); $gID = $co->get('REGISTRANT_GROUP_ID'); if (!empty($gID)) { Loader::model('groups'); $group = Group::getByID($gID); if (!empty($group)) { //check that group wasn't deleted $userInfo->getUserObject()->enterGroup($group); } } }
This doesn't seem to work, any ideas?
Thanks
Dave
Type: | Discussion |
---|---|
Status: | New |