JACLPlus worked fine when I used the delivered Joomla menu. After I installed ja_transmenu module, the menu items displayed fine to non-registered people, but all registered people saw the same menu items (which was everything on the menu). Their ACLs still prevented them form accessing the _link_s that they were not authorized for, but I didn't like displaying menu items that non-authorized users could see, but not use.
I'm really new to this hacking stuff, but once I looked at this it seemed really easy.
I have 0 knowledge or understanding of the Joomla architecture, security structures, or JACLPlus, but I was able to fumble my way through and with the addition of about 10 lines of code I was able to get the desired results.
For anyone else interested here is what I did:
Replace lines 41-43 that were originally:
| Code: : |
$sql = "SELECT m.* FROM #__menu AS m"
. "_CRLF_WHERE menutype='". $this->_params->get( 'menutype' ) ."' AND published='1' AND access gid'"
. "_CRLF_ORDER BY parent,ordering";
|
with:
| Code: : |
if ($my->gid == 0) {
$sql = "SELECT m.* FROM #__menu AS m"
. "_CRLF_WHERE menutype='". $this->_params->get( 'menutype' ) ."' AND published='1' AND access gid'"
. "_CRLF_ORDER BY parent,ordering";
}
else {
$sql = "SELECT mm.jaclplus from #__core_acl_aro_groups as mm "
. "_CRLF_where mm.group_id = '$my->gid'";
$database->SetQuery($sql);
$ACL_groups=$database->LoadResult();
$sql = "SELECT m.* FROM #__menu AS m"
. "_CRLF_WHERE menutype='". $this->_params->get( 'menutype' ) ."' AND m.published='1' "
. "_CRLF_AND m.access IN ($ACL_groups)"
. "_CRLF_ORDER BY parent,ordering";
}
|
Not sure it is the best way or the right way, but it works.