Try the following changes:
First, let's change the allowed user groups to only 29.
Change the following code in the constructor:
Code:
$this->allowed_usergroups = Array(2, 5, 6, 7);
to
Code:
$this->allowed_usergroups = Array(29);
And then, change the following code in the function userExists
Code:
if (in_array($vb_userinfo['usergroupid'], $this->allowed_usergroups)) {
to the following:
Code:
$vb_usergroups = explode(",", $vb_userinfo['membergroupids']); // make an array of membergroupids
$vb_usergroups[] = $vb_userinfo['usergroupid']; // add the primary usergroup to the array
foreach ( $vb_usergroups as $vb_groupiter )
if (in_array( $vb_groupiter, $this->allowed_usergroups))
return TRUE;
This last piece of code checks the user's 'primary' group id as well as any other member group the user may belong to (membergroupids).
Notice that I haven't run this code, so it may not work, or it may have some small syntax errors ... :-)