[ic] SpecialSub admin_init

Mike Heins mike at perusion.com
Tue Feb 24 16:33:02 UTC 2009


Quoting Ton Verhagen (ton at verhagen.net):
> 
> 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....

I would check it again, because it should work. I have used it that
way before.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  tollfree 800-949-1889 <mike at perusion.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer



More information about the interchange-users mailing list