Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Menu and Security » Setting up a limited user (unable to log in and reach correct menu)
Setting up a limited user [message #1871] Sun, 23 November 2008 11:34 Go to next message
David Lee is currently offline  David Lee
Messages: 44
Registered: June 2006
Member
Hi
I have set up a role JC_KEY_LOOKUP with a start menu of building, and without global access, but with specific access to both the main menu and the building menu. However, I can not log in with such settings, but get the following error report:
Fatal Error: menu - Access to task 'menu' has not been allowed. (# 256).

Error in line 1513 of file '/home/radicore/includes/include.session.inc'.

Script: /radicore/menu/logon.php

User Id: JCUSER

Remote Address: 192.168.0.187

Request URI: /radicore/menu/logon.php

Page Stack:

0: array =
  function: string = errorHandler
  args: array =
    0: integer = 256
    1: string = menu - Access to task 'menu' has not been allowed.
    2: string = /home/radicore/includes/include.session.inc
    3: integer = 1513
    4: array =
      task_id: string = menu
      where: string = 
      selection: string = 
      task_array: string = null
      current_menu: string = null
      current_task: string = null
      menu_buttons: array =
      messages: array =
      page_stack: array =
      script_vars: array =
        script_count: integer = 1
      PHP_SELF: string = /menu/logon.php
      curr_task: string = logon
      page_data: array =
        task_id: string = logon
        task_array: array =
          logon: boolean = 1
        logon: array =
          script_count: integer = 1
        pattern_id: string = logon
      page: string = /menu/logon.php
      test_task_id: string = logon
      query_string: string = selection=building
      settings_bf: string = null
      errors: array =
        0: string = Access to task 'menu' has not been allowed.
1: array =
  file: string = /home/radicore/includes/include.session.inc
  line: integer = 1513
  function: string = trigger_error
  args: array =
    0: string = menu - Access to task 'menu' has not been allowed.
    1: integer = 256
2: array =
  file: string = /var/www/radicore/menu/logon.php
  line: integer = 149
  function: string = scriptNext
  args: array =
    0: string = menu
    1: string = null
    2: string = null
    3: array =
      query_string: string = selection=building



Stepping through the code, it appears that the following lines from mnu_task.class.inc return access_allowed as N

        $this->sql_select = 'mnu_task.task_id, task_desc, button_text, task_type, pattern_id, script_id, subsys_dir, initial_passthru, selection_fixed, selection_temp, settings, order_by, is_disabled, global_access, keep_data, log_sql_query, screen_refresh, use_https, max_execution_time'
                           .", CASE WHEN mnu_role_task.role_id IS NOT NULL THEN 'Y' ELSE 'N' END AS access_allowed";
        $this->sql_from   = 'mnu_task '
                          . 'LEFT JOIN mnu_subsystem ON (mnu_subsystem.subsys_id=mnu_task.subsys_id) '
                          . "LEFT JOIN mnu_role_task ON (mnu_role_task.task_id=mnu_task.task_id AND mnu_role_task.role_id='$role_id') "
                          . "LEFT JOIN mnu_role ON (mnu_role.role_id='$role_id')";
        $this->sql_where  = '';

        $this->errors = array();

        $fieldarray = $this->getData_raw("mnu_task.task_id='" .addslashes($task_id) ."'");


Does this indicate I have set something up incorrectly?

Why, when the start task is building, is it checking and going to the menu task?
Re: Setting up a limited user [message #1872 is a reply to message #1871] Sun, 23 November 2008 13:30 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
The start task for a role can only be of type MENU, not PROC. This is so that the first page which is displayed after logging on is the home page. This is described in http://www.tonymarston.net/php-mysql/menuguide/mnu_menu.html.

Re: Setting up a limited user [message #1885 is a reply to message #1872] Mon, 24 November 2008 17:57 Go to previous messageGo to next message
David Lee is currently offline  David Lee
Messages: 44
Registered: June 2006
Member
My mistake.

I had enabled access to "menu01", not "main_menu". Main menu is needed for all access. The "menu01" item is the menu and security subsystem. Names can get quite confusing here when you start looking at the code as well, and get variables just called "menu", but the answer there is not to get it wrong.

It still seems strange to me that with the initial task for a user defined as the menu (not proc) task "building", I also need to enable the main menu, but once it is known, it is so little extra effort that it is not worth worrying about.
Re: Setting up a limited user [message #1886 is a reply to message #1885] Mon, 24 November 2008 19:31 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
MENU01 and MAIN_MENU are the identities of different lists of items (there can be many others), while the MENU task is what is used to display a list of items. It may sound confusing to begin with, but once you see the error message "Access to task 'menu' has not been allowed" it is easy to fix - simply add task "menu" to the access list for each role and off you go.

Re: Setting up a limited user [message #1887 is a reply to message #1886] Wed, 26 November 2008 10:50 Go to previous message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
In the next release I shall change the "Add Role" function so that it automatically allows access to the following tasks:

  • menu
  • mnu_user(upd1)a
  • mnu_user(upd1)b
  • mnu_user(upd1)c


Previous Topic: RBAC and LDAP
Next Topic: Control visibility of records
Goto Forum:
  


Current Time: Thu Nov 21 14:36:55 EST 2024

Total time taken to generate the page: 0.03472 seconds