Forums

This topic is locked

Server Behavior: Log In User

Posted 08 Jan 2003 17:33:41
1
has voted
08 Jan 2003 17:33:41 John Levine posted:
Can anyone provide information on what I'm missing when attempting to use server behavior "Login User". Regardless of what I key in as the username/password the result is the same - redirected to the test page for a successful login, on the initial build of the application the redirect was to the failure page (I scrapped the site and started fresh.)

I was going to post the code but it would not display when viewing this post in Preview.

Thanks to any and all that can help with this problem.

Right now I am using the evaluation copy of Dreamweaver MX 6.0. I ordered MX Studio package on December 31, 2002 so, I am eager to put this particular problem behind me before the licensed version arrive in the next couple of days.

Test Server: ColdFusion 6.0.0.48097
DB = MS Access 2000 9.0.2720
OS = Win2000 Pro 5.0.2195
Browser = IE6.0.26

Replies

Replied 08 Jan 2003 20:43:59
08 Jan 2003 20:43:59 asp asp replied:
well assuming all is ok with your login page, does your successful login page check the DB for the username and password?? try the server behavior, RESTRICT ACCESS , if not add this behavior to the "successful login" page
Replied 08 Jan 2003 22:28:15
08 Jan 2003 22:28:15 John Levine replied:
Yes. Restrict Access Based On: Username and Password

Also, I am using the code from technote in the application.cfm file.

cfapplication name = name
sessionmanagement = yes

(I know the syntax is lacking but proper coding will not post here)

Thank you. Any other ideas of where to look?
Replied 09 Jan 2003 14:43:20
09 Jan 2003 14:43:20 Dave Blohm replied:
I initially thought the same thing...the code doesn't display properly in preview...but when you actually POST it it will display correctly...

Post it and I'll take a look...

Doc
Rangewalk Digital Studios
Replied 09 Jan 2003 14:46:24
09 Jan 2003 14:46:24 Dave Blohm replied:
I initially thought the same thing...the code doesn't display properly in preview...but when you actually POST it it will display correctly...

Post it and I'll take a look...

Doc
Rangewalk Digital Studios
Replied 09 Jan 2003 16:56:53
09 Jan 2003 16:56:53 John Levine replied:
Ok.

Here is the code:

<cfif IsDefined("FORM.AssocName">
<cfset MM_redirectLoginSuccess="LoginAck.htm">
<cfset MM_redirectLoginFailed="LoginNack.htm">
<cfquery name="MM_rsUser" datasource="BDS Associate" username="system">
SELECT AssocName,AssocPWD FROM BDSAssoc WHERE AssocName='#FORM.AssocName#' AND
AssocPWD='#FORM.AssocPassword#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.AssocName>
<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 & "?" & CGI.QUERY_STRING>
</cfif>
</cfif>


Now the application.cfm:

<!---
**
* Name:Macromedia
*
* Copyright (c) 2002 Macromedia. All Rights Reserved.
* DO NOT REDISTRIBUTE THIS SOFTWARE IN ANY WAY WITHOUT THE EXPRESSED
* WRITTEN PERMISSION OF MACROMEDIA.
--->

<cfapplication name="AssociateLogin" sessionmanagement="yes">

<cftry>
<cfsetting showdebugoutput="no">
<cfset factory = createObject("java", "coldfusion.server.ServiceFactory">
<cfset request.security = factory.securityService>
<cfset checkSecurity=request.security.RDSSecurityEnabled>
<cfcatch type="any">
<cfset checkSecurity="false">
</cfcatch>
</cftry>

<cfif checkSecurity>
<cfif IsDefined('form.rdspassword')>
<cfset rdspassword="#form.rdspassword#">
<cfelseif IsDefined('URL.rdspassword')>
<cfset rdspassword="#URL.rdspassword#">
<cfelse>
<cfabort>
</cfif>

<cfif NOT request.security.checkRDSPassword(rdspassword)>
<cfif NOT request.security.checkAdminPassword(rdspassword)>
<cfabort>
</cfif>
</cfif>
</cfif>

Replied 09 Jan 2003 16:58:46
09 Jan 2003 16:58:46 John Levine replied:
asp and dave.blohm thanks for your input, it is very much appreciated.
Replied 10 Jan 2003 22:02:22
10 Jan 2003 22:02:22 Dave Blohm replied:
my apologies...coldfusion is greek to me

Doc
Rangewalk Digital Studios

Reply to this topic