Exactly. Take a list:

alpha,beta,raymond,gamma

You want to see if ray is in the list.

If you use listContains(list,"ray") it will return 3 since ray is in
raymond.

What you really want is listFind (or listFindNoCase).

A blog entry on this:
http://www.camdenfamily.com/morpheus/blog/index.cfm?mode=entry&entry=23

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Tony Weeg [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 17, 2003 7:56 AM
> To: CF-Talk
> Subject: RE: Can the user's role in CFLOGIN be a list?
> 
> 
> ahhh listContains doesn't mean "whole" word, it like a match 
> anywhere in the string will match?
> 
> tony weeg
> uncertified advanced cold fusion developer
> tony at navtrak dot net
> www.navtrak.net
> office 410.548.2337
> fax 410.860.2337
> 
> 
> -----Original Message-----
> From: Raymond Camden [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 17, 2003 9:55 AM
> To: CF-Talk
> Subject: RE: Can the user's role in CFLOGIN be a list?
> 
> 
> Folks, please do not remember that listContains is NOT the 
> function you wanto use 99% of the time. Imagine your security 
> system only wants a person who has a role of "admin". If you 
> do listContains and I have
> 
> "foolishadmin,gorf" 
> 
> listContains will return 1 because it will match _inside_ item one. 
> 
> listFind or listFindNoCase is the function you want.
> 
> Now, that being said, I'm sure there are times when you do 
> want to use listContains. I'm not saying it never has a user, 
> but 99% of the time when I see someone use it, it's being 
> used incorrectly.
> 
> ==============================================================
> ==========
> ===
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> (www.mindseye.com)
> Member of Team Macromedia 
> (http://www.macromedia.com/go/teammacromedia)
> 
> Email    : [EMAIL PROTECTED]
> Blog     : www.camdenfamily.com/morpheus/blog
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda 
> 
> > -----Original Message-----
> > From: Tony Weeg [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 17, 2003 7:43 AM
> > To: CF-Talk
> > Subject: RE: Can the user's role in CFLOGIN be a list?
> > 
> > 
> > how about a listContains in there :)
> > 
> > <cfif listContains(roleList,'admin')>
> > --admin stuff
> > </cfif>
> > <cfif listContains(roleList,'creative')>
> > --creative stuff
> > </cfif>
> > 
> > 
> > tony weeg
> > uncertified advanced cold fusion developer
> > tony at navtrak dot net
> > www.navtrak.net
> > office 410.548.2337
> > fax 410.860.2337
> > 
> > 
> > -----Original Message-----
> > From: Jeff Small [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 17, 2003 9:37 AM
> > To: CF-Talk
> > Subject: Can the user's role in CFLOGIN be a list?
> > 
> > 
> > I had always thought, that if I put a column in my table
> > for users' "roles" that it could be a list, and
> > IsUserInRole() would return a true or false if the user's 
> > role was contained in the role assigned in the cfloginuser 
> > tag.
> > 
> > In other words, I had always thought you could have a role 
> column in a 
> > table with values like, "creative, admin" and both of the following 
> > would return true for the same
> > person:
> > IsUserInROle("creative")
> > IsUserInRole("admin")
> > 
> > However, I can have two roles for myself, and create two 
> little areas 
> > one wrapped in an "admin" role, and another wrapped in a 
> "programmer" 
> > role, and I don't see the second one.
> > 
> > In my table, it's stored as "admin, creative".
> > On the page it's just two areas wrapped by the following: <cfif
> > IsUserInRole("admin")> --admin stuff
> > </cfif>
> > <cfif IsUserInRole("creative")>
> > --creative stuff
> > </cfif>
> > 
> > But I don't see the second one. I've logged out and logged back in, 
> > cleared cookies, etc.
> > 
> > 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to