Trying to do a simple login via CFC. Query SQL db and
return a field
value (BrokerID).
Returning the following error:
ReferenceError: Error #1069: Property resut not found on
mx.rpc.events.ResultEvent and there is no default value.
I tried doing it by returning the query and couldn't get it to work,
and now tried a structure. Help. ??????????
<cffunction name="login" access="remote">
<!-- make sure we have username and password -->
<cfargument name="username" required="true"
type="string" />
<cfargument name="password" required="true"
type="string" />
<cfquery name="getUser" datasource="dentalsales">
SELECT *
FROM Users
WHERE Logon = '#arguments.username#'
AND password = '#arguments.password#'
</cfquery>
<!-- if username and password are correct -->
<cfif getUser.recordCount eq 1>
<cfset userInfo = structNew()>
<cfset userInfo.isLoggedIn = "true">
<cfset userInfo.username = getUser.logon>
<cfset userInfo.BrokerID = getUser.BrokerID>
<cfreturn userInfo />
</cfif>
----------------------------------------------------------
private function login_result(event: Object):void
{
// login successful, remember the user.
if( (event.result) )
{
// assign BrokerID
this.BrokerID = event.resut.UserInfo.BrokerID;
trace(BrokerID);
if( this.rememberLogin.selected )
{
this.lso.data['username'] = this.username.text;
this.lso.data['password'] = this.password.text;
}
else
{
this.lso.data['username'] = null;
this.lso.data['password'] = null;
}
this.dispatchEvent( new Event('loginSuccessful') );
}
else
{
// login didn't work. show message
errorMessage("Login unsuccessful");
}
}
</cffunction>