[ic] SpecialSub admin_init

Ton Verhagen ton at verhagen.net
Tue Feb 24 15:35:17 UTC 2009


Quoting Mike Heins wrote:

> Quoting Ton Verhagen (tverhagen at alamerce.nl):
>> Dear All,
>>
>> I am trying to accomplish following:
>>
>> Providing admin users with their own set of menus based on username.
>>
>>
>>
>> Contents catalog.cfg:
>>
>> # Menus based on user
>> SpecialSub  admin_init  on_admin_init
>>
>> Sub on_admin_init <<EOS
>> sub {
>> #    my $user = $Session->{username};
>>     my $user = $Values->{mv_username};
>>
>>     if ($user eq 'john_jones') {
>>         $Variable->{MV_MENU_DIRECTORY} = 'include/menus/shipping';
>
> Try instead:
>
> 	    unshift @{$Config->{TemplateDir}}, 'include/menus/shipping';
>
>>     }
>> }
>> EOS
>>
>> Directory 'include/menus/shipping' contains menu files with the same
>> name as in the default location (include/menus), with different
>> content however.
>>
>> The variable MV_MENU_DIRECTORY is being set to 'include/menus/
>> shipping' for admin user john_jones, but unfortunately the dedicated
>> menus are not shown.

Thank you or the pointer, Mike.

Unfortunately this does not make any difference.

Still all 'default' menus are shown. So no dedicated menus show up....

Best regards,

Ton






More information about the interchange-users mailing list