After a few weeks of searching, trying and debugging how to apply multi-groups to users in Joomla and in Kunena (= a forum for Joomla), I found the solution for fixing this!
After a Google-search, I found this helpful topic, but after trying, it wasn’t that good. You can only apply 2 groups to your users. Not 3 or more!
So, let’s edit the suggested code. Here’s the final code for class.kunena.php (line 913-972):
function getAllowedForums($uid = 0, $gid = 0, &$kunena_acl) { $kunena_db = &JFactory::getDBO(); /*function _has_rights(&$kunena_acl, $gid, $access, $recurse) { if ($gid == $access) return 1; if ($recurse) { $childs = $kunena_acl->get_group_children($access, 'ARO', 'RECURSE'); return (is_array($childs) and in_array($gid, $childs)); } return 0; }*/ function _has_rights($uid, &$kunena_acl, $gid, $access, $recurse) { $kunena_db = &JFactory::getDBO(); $query = "SELECT id_group from #__noixacl_multigroups where id_user='{$uid}'"; $kunena_db->setQuery($query); $rows = $kunena_db->loadObjectList(); if($rows){ foreach($rows as $row) { if ($row->id_group == $access) return 1; $recurse = array(); if ($recurse) { $childs = $kunena_acl->get_group_children($access, 'ARO', 'RECURSE'); return (is_array($childs) and in_array($row->id_group, $childs)); } } } if ($gid== $access) return 1; if ($recurse) { $childs = $kunena_acl->get_group_children($access, 'ARO', 'RECURSE'); return (is_array($childs) and in_array($gid, $childs)); } return 0; } $catlist = ''; $query = "SELECT c.id, c.pub_access, c.pub_recurse, c.admin_access, c.admin_recurse, c.moderated" . ",(m.userid IS NOT NULL) AS ismod FROM #__fb_categories c" . " LEFT JOIN #__fb_moderation m ON c.id=m.catid AND m.userid='{$uid}' WHERE published='1'"; $kunena_db->setQuery($query); $rows = $kunena_db->loadObjectList(); check_dberror("Unable to load category list."); if ($rows) { foreach($rows as $row) { if (($gid == 24 || $gid == 25) or ($row->moderated and $row->ismod) or ($row->pub_access == 0) or ($row->pub_access == -1 and $uid > 0) or /*($row->pub_access > 0 and _has_rights($kunena_acl, $gid, $row->pub_access, $row->pub_recurse)) or ($row->admin_access > 0 and _has_rights($kunena_acl, $gid, $row->admin_access, $row->admin_recurse))*/ ($row->pub_access > 0 and _has_rights($uid, $kunena_acl, $gid, $row->pub_access, $row->pub_recurse)) or ($row->admin_access > 0 and _has_rights($uid, $kunena_acl, $gid, $row->admin_access, $row->admin_recurse)) ) $catlist .= (($catlist == '')?'':',').$row->id; } } return $catlist; } } // end of class
After this, you should clear the user-cache of the Kunena forum in the settings:
To bad nor Joomla 1.5.15, nor Kunena or nor the combination NOIXACL-Kunena-Joomla can do this automatically… Hopefully things will change with Joomla 1.6!






