Ask a Question related to Coldfusion Database Access, Design and Development.
-
camenzka #1
Log in User
I have just downloaded Cold fusion 7 and have it up and running fine, problem
is when I try to use the Log-in user Server Behaviour on the page, it wont
recognize when a correct username and password has been entered and direct to
the page set. I have posted the code of my test below, I cant see what I am
doing wrong as I have set this up in ASP lots of times without this issue?.any
help would be great.
<cfif IsDefined("FORM.textfield")>
<cfset MM_redirectLoginSuccess="main.cfm">
<cfset MM_redirectLoginFailed="default.cfm">
<cfquery name="MM_rsUser" datasource="cfttest">
SELECT rsusername,rspassword FROM users WHERE rsusername='#FORM.textfield#'
AND rspassword='#FORM.textfield1#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.textfield>
<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>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form ACTION="<cfoutput>#MM_loginAction#</cfoutput>" name="form1"
method="POST">
<table width="100%" >
<tr>
<td><input type="text" name="textfield">
<input name="textfield1" type="text" id="textfield1">
<input type="submit" name="Submit" value="Submit"></td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
camenzka Guest
-
Web Service uses ASPNET user although changed to administrator user in IIS
Hi My problem is this In the Website (of my webservice) in the IIS, I've changed the ASPNET user in the Directory Security to administrator user,... -
user levels, cell phones, and user registration, plus cookies
I need to quote a client on the following and need to know how much work is involved, ie hours. The programming may be done in PHP (unless its... -
Can we fire a user control event when the user does the action
Can we fire a user control event when the user does the action not in the webservers or custom control event? What actaully I want is to handle a... -
Number of admin user accounts and old user name still working
Is it recommended to have more than one administrator for a computer? The reason I ask is I read that the built-in administrator account is only... -
User changing something on a form makes asp.net take user to login page
Hi, I have an application that displays the database table records on the web page, the user can navigate thru the contents and make changes and... -
Ken Ford - *TMM* & PVII #2
Re: Log in User
Do you have an Application.cfm page that allows session variables?
[url]http://www.macromedia.com/go/tn_16564[/url]
--
Ken Ford
PVII Support Team
[url]http://www.projectseven.com[/url]
Team Macromedia Volunteer - Dreamweaver
Certified Dreamweaver MX 2004 Developer
"camenzka" <webforumsuser@macromedia.com> wrote in message news:d0v3sa$7ps$1@forums.macromedia.com...>I have just downloaded Cold fusion 7 and have it up and running fine, problem
> is when I try to use the Log-in user Server Behaviour on the page, it wont
> recognize when a correct username and password has been entered and direct to
> the page set. I have posted the code of my test below, I cant see what I am
> doing wrong as I have set this up in ASP lots of times without this issue?.any
> help would be great.
>
> <cfif IsDefined("FORM.textfield")>
> <cfset MM_redirectLoginSuccess="main.cfm">
> <cfset MM_redirectLoginFailed="default.cfm">
> <cfquery name="MM_rsUser" datasource="cfttest">
> SELECT rsusername,rspassword FROM users WHERE rsusername='#FORM.textfield#'
> AND rspassword='#FORM.textfield1#'
> </cfquery>
> <cfif MM_rsUser.RecordCount NEQ 0>
> <cftry>
> <cflock scope="Session" timeout="30" type="Exclusive">
> <cfset Session.MM_Username=FORM.textfield>
> <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>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Untitled Document</title>
> </head>
>
> <body>
> <form ACTION="<cfoutput>#MM_loginAction#</cfoutput>" name="form1"
> method="POST">
> <table width="100%" >
> <tr>
> <td><input type="text" name="textfield">
> <input name="textfield1" type="text" id="textfield1">
> <input type="submit" name="Submit" value="Submit"></td>
> <td> </td>
> </tr>
> </table>
> </form>
> </body>
> </html>
>
Ken Ford - *TMM* & PVII Guest
-



Reply With Quote

