2018-05-10, 06:56 AM
(2016-09-13, 12:57 PM)Shade Wrote: Not sure if anyone has pointed this out already, but there's an issue with usergroups. File inc/plugins/mysubs.php, line 580:
if($sub['accepted_gids'] != 'all') { $gids = explode(',', $user['additionalgroups']); $gids[] = $user['usergroup']; $matched = array_intersect($gids, explode(',', $sub['accepted_gids'])); if(empty($matched)) $accepted_gid = false; }
This does not work as the $sub variable hasn't been initialized. Instead, you should use $item which is loaded with the actual subscription.
if($item['accepted_gids'] != 'all') { $gids = explode(',', $user['additionalgroups']); $gids[] = $user['usergroup']; $matched = array_intersect($gids, explode(',', $item['accepted_gids'])); if(empty($matched)) $accepted_gid = false; }
Without this correction, if one of the subscriptions has a blank field as allowed usergroups the whole process will fail.
Thanks, trying this out now. Hopefully works out for me.