[ic] user login dealer test...

Mike Heins interchange-users@icdevgroup.org
Fri Aug 9 21:34:00 2002


Quoting Dan Browning (dbml@kavod.com):
> At 11:49 AM 8/8/2002 -0400, you wrote:
> >I want to be able to test and see if a user is logged in as a "dealer" or not.
> >
> >I have the dealer prices and everything all set up great, but i want to be 
> >able to test and display different messages in my pages like this:
> >
> >[if data userdb::dealer::[username] =~ /1/i]
> >   dealer html stuff...
> >[else]
> >    regular user html stuff...
> >[/else]
> >[/if]
> >
> >but it doesn't seem to work.
> >
> >
> >when I test product groups like this:
> >
> >[if data products::group_field::[item-code] =~ /name_of_group/i]
> >
> >it works fine, I guess I need to find the equivelent of [item-code] for 
> >the userdb.
> >
> >but maybe there is a more secure way to test this?
> >
> >Thanks
> >
> >rick
> 
> For Foundation, [if scratch dealer] works fine, but your code was really 
> close as well:
> 
> [if data userdb::dealer::[value mv_username] =~ /1/]
> 

I don't think that will work....the [value ...] tag should not
be interpolated.

[data session username] is the reliable place for the user name -- values
can be reset at any time.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
 -- Winston Churchill