[ic] user login dealer test...

Ed LaFrance interchange-users@icdevgroup.org
Thu Aug 8 12:21:01 2002


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.

Just gotta get that syntax right:

[if data userdb::dealer::[data session username] == 1]

-- or --

[if type=data term="userdb::dealer::[data session username]" op"==" compare=1]

...if the dealer field is empty for non-dealers, you can just do:

[if type=data term="userdb::dealer::[data session username]"]

...which will evaluate to true only if there is some kind of data in the 
dealer field. And finally, since all userdb values are loaded at login, you 
can also do:

[if value dealer == 1]
...
[else]
...
[/else]
[/if]

...assuming that [value dealer] has not been mucked with to make it invalid 
for the current session.

- Ed L.







>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
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users

===============================================================
Increase profits from your Interchange store...
http://www.newmediaems.com/cgi-bin/nm/software_fus.html
===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================