Try GetAuthUser(). That will give you the name of the authenticated user.

Frank Velazquez wrote:
> Hey ppl what's up?
>
> I'm using <cflogin> to log into my Admin part of my site. this is working 
> perfectly.
> How do I pull the info from the logged in user? I want to have at the top of 
> my site Welcome #userName#, I don't know how to get the record from the 
> logged in user. Could someone help me? Here is my code:
>
> [code] 
>
>     <cffunction name="OnRequestStart" access="public" returntype="void">
>         <cflogin>
>             
>             <cfif IsDefined ("FORM.UserName")>
>                 <cfquery datasource="admin" name="qUser">
>                     SELECT * FROM Admin
>                     WHERE     UserName = '#FORM.UserName#'
>                     AND               Password = '#FORM.Password#'
>                 </cfquery>
>                 
>                 <cfif qUser.RecordCount IS 1>
>                     <cfloginuser
>                                 name="#qUser.AdminFirstName# 
> #qUser.AdminLastName#"
>                                 password="#FORM.Password#"
>                                 roles="#qUser.AdminRole#">
>                 <cfelse>
>                     <cfinclude template="login.cfm">
>                     <cfabort>            
>                 </cfif>
>             <cfelse>
>                 <cfinclude template="login.cfm">
>                 <cfabort>
>             </cfif>
>                 
>         </cflogin>
>     </cffunction>
>
> [/code] 
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3410
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to