Conditional redirection

Hello.

I made a software with 4 different menus, every menu for a group of users, OK i made a security application and assign users to their groups, also i made the permissions [groups/applications].

i want to point every group to a specific menu, i am working on hospital software, so some employees work on admission software (menu 1) other group of employees are accountants, i want to point them to the accountant menu (menu 2) and so on.

I tried to edit the event (onValidateSuccess) in sec_login application but no luck.

How to customize this code to make it suitable for my purpose?

/**

  • Conditional redirection
    */

// Redirection parameters
$redir_app = ‘my_app’; // Application name
$redir_test = {field1} == ‘some_value’; // Redirection test
$redir_target = ‘_blank’; // Target window (_blank, _self, _parent or modal)
$redir_param = array( // Param list, add as many as needed
‘param_1’ => ‘value_1’,
‘param_2’ => ‘value_2’,
);

// Redirection
if ($redir_test)
{
sc_redir($redir_app, $redir_param, $redir_target);
}

That’s IMHO not a good software design … Why not create one menu with all items and then delete menu items that not necessary for a specific user group before showing the menu? Or load only the required menu items from a db table … (my way)?

Look at SC macros such as sc_menu_delete() etc.

[QUOTE=RHS;25758]That’s IMHO not a good software design … Why not create one menu with all items and then delete menu items that not necessary for a specific user group before showing the menu? Or load only the required menu items from a db table … (my way)?

Look at SC macros such as sc_menu_delete() etc.[/QUOTE]
Thank you so much.
I did that because every menu can start with its own blank application witch load an image for every group, also i have more than 500 item for all menu items it is very hard to make them all in one menu.