Hi

I have created a login system in Coldfusion and it works great.

However I would like to restrict some links on the main menu to certain users

For example

<CFIF Session.status = ?? WHAT GOES HERE ???

Display menu for users with a session.status of administrator only

<CFELSE>

Display other menu items for all users and the administrator to view
</CFIF>


How is this achieveable in Coldfusion through cfif statements ??


This is what I have at the moment, this checks the users login details and sets session variables for that session.

In my case I have added one called Session.status

---------------------------------
<CFQUERY DATASOURCE="#Application.DSN#" NAME="Security">
SELECT *
FROM admin
WHERE Username = '#form.Username#' AND Password = '#form.Password#'
</CFQUERY>

<CFIF Security.RecordCount IS 0>
<CFLOCATION URL="" ADDTOKEN="No">

<!--- If validation is succesful then set the username, password from the preceding login form that matched the admin query and was validated as Session variable. Also set the user ID from the admin query as a session id, then send them staright to their administration page --->

<CFELSE>

<CFSET Session.Password = "#Security.Password#">
<CFSET Session.Username = "#Security.username#">
<CFSET Session.ID = "#Security.ID#">
<CFSET Session.Fname = "#Security.Fname#">
<CFSET Session.Lname = "#Security.Lname#">
<CFSET Session.status = "#Security.Status#">

<CFLOCATION URL="" ADDTOKEN="No">
</CFIF>

--------------------------------------



[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to