ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 6th, 2005, 02:18 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 270 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 6 h 57 m 16 sec
Reputation Power: 4
Roles

Quick question on Roles...I have them working for me, I worked through an example in my book...but...

In the query they used, they did this...

<CFQUERY Name="getuser" Datasource="whatever">
Select ID, fname, userrole
From contacts LEFT OUTER JOIN USERROLES
ON contact.UserRoleID = UserRoles.UserRoleID
Where UserLogin = '#Form.userlogin#'
AND UserPassword = '#Form.userpassword#'
</CFQUERY>

I don't understand these two lines...

From contacts LEFT OUTER JOIN USERROLES
ON contact.UserRoleID = UserRoles.UserRoleID

The from contacts is obvious, and a Left outer join is an SQL thing, but I don't understand what it's there for.

I was getting an error saying "userroles object invalid" so I removed thoes two lines and it works properly.

And when I use
<CFIF IsUserInRole("Admin")
whatever
</CFIF>

it works properly, ie. if i'm not an admin it won't show that code.

If somebody could explain it, that would be awesome

Thanks
Caden

Reply With Quote
  #2  
Old April 7th, 2005, 12:55 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
You're asking about two totally different things. The INNER JOIN in the SQL statement is used to relate two tables together. More information can be found here.

The isUserInRoles() function is a CFML function used with the <cflogin> tag. It doesn't have anything to do with SQL, it deals with checking for security permissions.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Roles


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway