all groups > macromedia flash flash remoting > december 2004 >
You're in the

macromedia flash flash remoting

group:

CFLOGIN w/ Remoting


CFLOGIN w/ Remoting pudrocker
12/9/2004 3:33:18 AM
macromedia flash flash remoting:
Extreme newbie here, so please bear with me. Could someone please explain to me
if this code is valid?

<CFFUNCTION NAME = "myLoginFunction">
<CFLOGIN>
<CFIF isDefined("cflogin")>
<CFQUERY NAME="query"
DATASOURCE="MyDatabase">
SELECT Roles FROM SecurityRoles
WHERE username='#cflogin.name#'
and password='#cflogin.password#'
</CFQUERY>
<CFIF query.recordcount gt 0>
<CFLOGINUSER NAME = "#cflogin.name#"
PASSWORD = "#cflogin.password#"
ROLES = "#trim(query.Roles)#" >
</CFIF>
</CFIF>
</CFLOGIN>
</CFFUNCTION>

Is this possible to do? ..or is it only valid to utilize this particular code
inside of Application.cfm as in:

<CFAPPLICATION NAME="myLoginApp">
<CFLOGIN>
<CFIF isDefined("cflogin")>
<CFQUERY NAME="query"
DATASOURCE="myDatabase">
SELECT Roles FROM SecurityRoles
WHERE username='#cflogin.name#'
and password='#cflogin.password#'
</CFQUERY>
<CFIF query.recordcount gt 0>
<CFLOGINUSER NAME = "#cflogin.name#"
PASSWORD = "#cflogin.password#"
ROLES = "#trim(query.Roles)#" >
</CFIF>
</CFIF>
</CFLOGIN>

I guess I'm getting confused as how to pass access <CFLOGIN> via Actionscript,
without accessing it from calling a specific ColdFusion Function - as in:

function CallSecureCFC() {
CFCResponse_txt.text = "";
CFCError_txt.text = "";
gatewayConnection.setCredentials
(userid_txt.text, pwd_txt.text);
myCFCService.myLoginFunction();
}

Perhaps, the last example has an inner functionality in accessing
Application.cfm internally that isn't apparent on the surface?

A general push in the right direction is greatly appreciated.

Thanks,
pud

Re: CFLOGIN w/ Remoting juanjo75
12/16/2004 8:21:19 PM
Hi.. don't panic.. I also tried the same first approach, but it did not work..
I try not to write my cflogin tag at my application, but it did not work...
here is what I did, in order to avoid having the cflogin tag at application.cfm
//application.cfm, flash needs to use setCredential which will direct to
application, there is no other way around, sorry.. <cfinclude
template='application_extension/login_access.cfm' > //at my coldfusion
template page.. <cflogin> <cfif isDefined( 'cflogin' ) > <!--- check with
visit.fc_loginCheck if user is able to login ---> //i use a session object
that store an instance of my security component.... <cfif
session.struct.securityComponent.loginCheck( str_userName='#cflogin.name#',
str_userPassword='#cflogin.password#' ) eq true > <cfloginuser name =
'#session.stc_visit.USER_NAME#' password = '#session.stc_visit.PASSWORD#'
roles = '#session.stc_visit.ROLE_NAME#' > </cfif> </cfif> </cflogin>
Re: CFLOGIN w/ Remoting pudrocker
12/25/2004 12:25:42 AM
Jaunjo,

Thank you very much for your reply. I'll test this locally and post my
progress.
BTW, how would you rate the performance of your login system since you started
using remoting? Have you had any other bugs or speed issues that we should be
aware of?

I think Macromedia really needs to provide more support in this area. Sure
there are many sites on the net explaining how to do this; however, nearly
everyone explains it in a completely different way. Plus, more often than not,
there is rarely any date attached to the tutorials which makes it difficult to
assume that these methods have not been depreciated in favor of others. Some
standard practices would be nice.

Thanks Again,
pud
AddThis Social Bookmark Button