CFCorey
07-20-2004, 11:22 PM
I am fairly new to Cold Fusion, I used to use a program called Tango. I use Dreamweaver in my web development. I just created a table in SQL Server for my usernames, passwords, and roles. Set up my datasource and followed all the instructions. Why is it when I use the Insert > Application Objects > User Authentication > Log In User in Dreamweaver and answer all the questions in the GUI window and try testing it, it always sends me to the login fail page that I choose. Even though I'm entering a correct username and password.
Everything is set correctly. Is this a known issue, or am I not doing something additional that needs to be done. Do I have to change something in the Application.cfm
Here is the code that is generated by Dreamweaver:
<cfif IsDefined("FORM.UserName")>
<cfset MM_redirectLoginSuccess="main.cfm">
<cfset MM_redirectLoginFailed="http://www.und.edu">
<cfquery name="MM_rsUser" datasource="CDI" username="xxxxxx" password="xxxxx">
SELECT username,password FROM dbo.ce_user WHERE username='#FORM.UserName#'
AND password='#FORM.Password#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.UserName>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
Thanks.
corey
Everything is set correctly. Is this a known issue, or am I not doing something additional that needs to be done. Do I have to change something in the Application.cfm
Here is the code that is generated by Dreamweaver:
<cfif IsDefined("FORM.UserName")>
<cfset MM_redirectLoginSuccess="main.cfm">
<cfset MM_redirectLoginFailed="http://www.und.edu">
<cfquery name="MM_rsUser" datasource="CDI" username="xxxxxx" password="xxxxx">
SELECT username,password FROM dbo.ce_user WHERE username='#FORM.UserName#'
AND password='#FORM.Password#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.UserName>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
Thanks.
corey



