Copy link to clipboard
Copied
I am having issues getting the server to process the cflogin. It aapears that the server is ignoring the tag all together. It is not processing anything within the tag. The cflogin in located in my application.cfm and is in a subdirectory of my main website, along with the other files for this application. Below is most of the application.cfm file. Everything else calls information set within the cflogin tag, i.e. session.userid and session.role, and is therefore not functioning. Please help.
<cfapplication name="tools" sessionmanagement="Yes" sessionTimeout="#createtimespan(0,8,0,0)#"> <cfif IsDefined("Form.logout")> <cflogout> <cfabort> </cfif> <cflogin applicationtoken="tools" idletimeout="24400"> <cfif IsDefined("cflogin")> <cfif cflogin.name EQ "" OR cflogin.password EQ ""> <cfoutput> <H2>You must enter text in both the User Name and Password fields</H2> </cfoutput> <cfinclude template="loginform.cfm"> <cfabort> <cfelse> <cfquery name="loginQuery" dataSource="dc02_web"> SELECT UserID, Role, firstname, lastname, email, lastlogin FROM users WHERE UserID = '#cflogin.name#' AND Password = '#HASH(cflogin.password,"SHA")#' </cfquery> <cfif loginQuery.recordcount EQ "1"> <cfloginuser name="#cflogin.name#" Password = "#cflogin.password#" roles="#loginQuery.Role#"> <cfset SESSION.firstname = loginQuery.firstname> <cfset SESSION.lastname = loginQuery.lastname> <cfset SESSION.role = loginQuery.role> <cfset SESSION.lastlogin = loginQuery.lastlogin> <cfset SESSION.userid=loginQuery.userid> <cfset SESSION.email = loginQuery.email> <cfquery name="lastlogin" datasource="dc02_web"> UPDATE Users SET lastlogin='#TimeFormat(Now(),"hh:mm:ss tt")# on #DateFormat(Now(), "dddd mmmm d, yyyy")#' where userid='#cflogin.name#' </cfquery> <cfelse> <cfoutput> <cfquery name="loginpassQuery" dataSource="dc02_web"> SELECT UserID FROM users WHERE UserID = '#cflogin.name#' </cfquery> <cfif loginpassQuery.recordcount EQ "1"> <H2>The password you entered is not valid.<br>Please Try again.</H2> <cfelseif loginpassQuery.recordcount GT "1"> <H2>There is a problem with your account.<br>Please contact the administrator.</H2> <cfelse> <H2>The user name you entered is not valid.<br>Please Try again.</H2> </cfif> </cfoutput> <cfinclude template="loginform.cfm"> <cfabort> </cfif> </cfif> <cfelse> <cfinclude template="loginform.cfm"> <cfabort> </cfif> </cflogin>
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It was a problem within the cf admin. "