macromedia flash flash remoting:
I can not get my flash form to actually login into a ColdFusion application.
I have used Flash forms before for this purpose and had no trouble.
My form sends the login data and returns the AuthUser and the Roles.
This part works because I have tested it in flash and it returns the proper
results.
When I put the file into a ColdFusion application and test it I cant get it to
actually login.
This form can be tested at:
www.digitalrorschach.com/MembersArea.cfm Username:Jillian Password:Jillian
Here is my ActionScript:
on(press) {
#include "NetServices.as"
#include "DataGlue.as"
if (inited == null)
{
inited = true;
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
myconnection = NetServices.createGatewayConnection();
myconnection.setCredentials(_root.User1.text, _root.Password1.text);
myservice = myconnection.getService("Luciddaydreamer", this);
}
myservice.GetAuthUser();
function GetAuthUser_Result(result){
trace(result) // in testing this returns the expected results everytime
_global.Stats = "Web"
}
}
on(release) {
getURL("BravoBlueDreamer.cfm", "_self")
}
Here is my ColdFusion Code in GetAuthUser.cfm:
<cfif GetAuthUser() NEQ "">
<cfset LoggedStatus = ArrayNew(1)>
<cfset LoggedStatus[1] = "#GetAuthUser()#">
<cfset LoggedStatus[2] = #IsUserInRole("Webmaster")#>
<cfset Flash.result = LoggedStatus>
<cfelse>
<cfset Flash.result = "Not Logged In">
</cfif>
Here is the login structure in my Application.cfm:
<cflogin>
<cfif NOT IsDefined("cflogin")>
<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<p> </p>
<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="#Request.DSN#">
SELECT UserID, Roles
FROM Login
WHERE
UserID = '#cflogin.name#'
AND Password = '#cflogin.password#'
</cfquery>
<cfif loginQuery.Roles NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"
roles="#loginQuery.Roles#">
<cfelse>
<cfoutput>
<H2>Your login information is not valid.<br>
Please Try again</H2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>
Like I said I used this exact same file (making the appropriate changes) and
it works fine on another site.
Any thoughts?
Please?
Kelly