Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • nevilix Friend
    #158526

    I haven’t tested the other menus yet but the mega menu is not hiding/showing links as it should. When I set a link to the access level of Registered the link will not show when logged in. I have double checked the access level settings and everything is set correct. I am using the package installer of t3 2.0. Any ideas how to fix this? :p

    aman204 Friend
    #371068

    Please ensure that you are updated to latest version of T3 system plugin ::

    http://www.joomlart.com/forums/downloads.php?do=file&id=1518

    nevilix Friend
    #371126

    I am using JA T3 System plugin for Joomla 1.6 (779.4 KB) 1.1.0. I even tried uninstalling and reinstalling the plugin with no success.

    nevilix Friend
    #371138

    To reproduce the problem: Download Quickstart t3 framework v2, Install with sample data, goto main menu and set a menu item to registered or any other access level besides public, login the the front end using admin account. When you do this you will notice that it will not display the link regardless of the access level settings.

    nevilix Friend
    #371183

    I solved this myself until a fix is released.

    I dont know if this is the best way to do it but in
    coremenubase.class.php lines 48 – 73


    // Get user access levels in array 1.6
    jimport( 'joomla.access.access' );
    $authorised = array_flip(JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')));

    $aid = 1;
    // If no active menu, use default
    $active = ($menu->getActive()) ? $menu->getActive() : $menu->getDefault();

    $this->open = isset($active) ? array_reverse($active->tree) : array();

    $rows = $menu->getItems('menutype',$this->getParam('menutype'));

    if(!count($rows)) return;
    // first pass - collect children
    $children = array ();
    $cacheIndex = array();
    $this->items = array();
    foreach ($rows as $index => $v) {
    //1.6 compatible
    if (isset ($v->title)) $v->name = $v->title;
    if (isset ($v->parent_id)) $v->parent = $v->parent_id;

    $v->name = str_replace ('&', '&', str_replace ('&', '&', $v->name));
    if (array_key_exists($v->access, $authorised)) {

    $pt = $v->parent;
    $list = @ $children[$pt] ? $children[$pt] : array ();

    These are the only lines modified to make the menu work correctly.


    // Get user access levels in array 1.6
    jimport( 'joomla.access.access' );
    $authorised = array_flip(JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')));

    if (array_key_exists($v->access, $authorised)) {

    I know this may not be the best method to accomplish this but works for now ! :laugh:

    stevetsi Friend
    #374892

    Thanks. I was just working on a fix for this, but it looks like you got it first. I exploded the $users array, but couldn’t get something useful out of it (at least by simply referancing a single element in the array).

    Any, I test the code modification above and it works.

    It looks like Joomlart never finished this part, otherwise they would not have left a hard-code “$aid = 1;”. What was that all about?!

    Too bad, since menu restrictions are, you know, *critical* in implementing a good portion of the access restriction improvements in Joomla 1.6.

    nevilix Friend
    #374926

    <em>@stevetsi 219084 wrote:</em><blockquote>Thanks. I was just working on a fix for this, but it looks like you got it first. I exploded the $users array, but couldn’t get something useful out of it (at least by simply referancing a single element in the array).

    Any, I test the code modification above and it works.

    It looks like Joomlart never finished this part, otherwise they would not have left a hard-code “$aid = 1;”. What was that all about?!

    Too bad, since menu restrictions are, you know, *critical* in implementing a good portion of the access restriction improvements in Joomla 1.6.</blockquote>

    Yeah it was something that was top priority to me to have working also, so I just figured it out myself instead of waiting. :laugh: It works perfectly for all access levels even the guest levels.

    cartman Friend
    #374963

    Is there a possibility to do this ACL-based menu switching with complete menus ?
    I have a multiple level ACL and every level has its own menu after login.
    It worked fine with the normal templates but not with T3.
    A workaround would be to put them all into one menu and show/hide depending on
    the login level, but it would be nice for keeping the overwiew to have them devided.
    Is there any chance ?

    TIA

    nevilix Friend
    #375029

    <em>@cartman 219187 wrote:</em><blockquote>Is there a possibility to do this ACL-based menu switching with complete menus ?
    I have a multiple level ACL and every level has its own menu after login.
    It worked fine with the normal templates but not with T3.
    A workaround would be to put them all into one menu and show/hide depending on
    the login level, but it would be nice for keeping the overwiew to have them devided.
    Is there any chance ?

    TIA</blockquote>

    Here is the attached modified file. This modification allows you to set the access level on any menu item and if the group the user is in is not assigned that access level the menu item will not be displayed. It works for all levels of menu items.

    I have tested only with the mega menu but would think it works for all the menus.

    Just replace this file with the attached file
    pluginssystemjat3jat3coremenubase.class.php

    This is with plg_system_jat3.v1.2.1 and J1.6 Stable


    1. base.class_.zip
    cartman Friend
    #375355

    I replaced the file with the given one, but still does not work as with the standard templates.
    I have three access classes : public and two own
    The main menu (public) is for users not logged in, but it still appears after the login.
    The adminmenu (myadmin) should be shown after an admin logs in, but there is still only the
    main menu. The same with the 3rd access class.
    When I put all entries into the main menu, I am able to switch the admin´s menu items on and off, but the
    public entries are still there.
    With template beez2 it all worked fine.

    nevilix Friend
    #376760

    <em>@cartman 219737 wrote:</em><blockquote>I replaced the file with the given one, but still does not work as with the standard templates.
    I have three access classes : public and two own
    The main menu (public) is for users not logged in, but it still appears after the login.
    The adminmenu (myadmin) should be shown after an admin logs in, but there is still only the
    main menu. The same with the 3rd access class.
    When I put all entries into the main menu, I am able to switch the admin´s menu items on and off, but the
    public entries are still there.
    With template beez2 it all worked fine.</blockquote>

    If you are logging in as the Super Admin by default it seems to give you access to view everything regardless of restrictions. Try to set the permissions and log in using a different user account. The ACL setup should be as follows:

    Goto Groups and create a group named: Guest
    Goto users -> config and set the “Guest” account to group “Guest”
    Goto Access Levels and make a new Access Level called “Guest” and set the view permissions to group “Guest”.
    Goto Access Levels select “Public” group and select “Guest” under view permissions.
    Make sure you logged out to clear any prior session data.
    Login using a member account to check if the menu items are displayed correctly..

    With this setup and that small modification the menu hides and shows depending on the acl setting and the users group access. Are these settings set right like the example above?

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 11 replies, has 4 voices, and was last updated by  nevilix 13 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum