I have talked about this before (and even had a working copy but deleted
it) and I am going to ask it again.

 

I am using Model-Glue for this application and I want to setup an admin
login system with the cfc's below.

 

My error that I am getting is:

Element ADMIN.ISLOGGEDIN is undefined in VARIABLES.

 

adminLoginController.cfc:

 

<cfcomponent name="adminLoginController"
displayname="adminLoginController" hint="Admin Login Controller"
extends="ModelGlue.Core.Controller">

            <cffunction name="Init" access="Public"
returnType="adminLoginController" output="false" hint="I build a new
adminLoginController">

              <cfargument name="ModelGlue" required="true"
type="ModelGlue.ModelGlue" />

              <cfargument name="InstanceName" required="true"
type="string" />

              <cfset super.Init(arguments.ModelGlue) />

 

              <cfreturn this />

            </cffunction>

 

            <cffunction name="paramAdmin" access="public"
returntype="void" output="false" hint="If session.admin does not exist,
create it.">

                        <cfif not structKeyExists( session, 'admin' )>

                                    <cflock scope="session" timeout="10"
type="exclusive">

                                                <cfif not
structKeyExists( session, 'admin' )>

                                                            <cfset
session.admin = createObject('component',
'designcompanycfm.model.adminLogin').init() />

                                                </cfif>

                                    </cflock>

                        </cfif>

            </cffunction>                          

            

            <cffunction name="getAdmin" access="public" output="false"
hint="Return the admin object.">

                        <cfset paramAdmin() />

                        <cfreturn session.admin />

            </cffunction>

            

            <cffunction name="adminLogin" access="public" output="false"
hint="Login">

                        <cfargument name="username" required="true" />

                        <cfargument name="password" required="true" />

                        <cflock scope="session" timeout="10"
type="exclusive">

                                    <cfset
getAdmin().login(arguments.username, arguments.password) />

                        </cflock>

            </cffunction>

            

            <cffunction name="setDisplayName" access="public"
returntype="void" displayname="Set Display Name" output="false"
hint="Set the display name of the user.">

                        <cfargument name="displayname" type="string"
required="yes" />

                        <cfset paramAdmin() />

                        <cflock scope="session" timeout="10"
type="exclusive">

                                    <cfset
getAdmin().setDisplayName(arguments.displayname) />

                        </cflock>

            </cffunction>

            

            <cffunction name="getDisplayName" output="false" hint="Get
the user's display name.">

                        <cfreturn getAdmin().getDisplayName() />


            </cffunction>                                      

            

            <cffunction name="setIsLoggedIn" access="public"
returntype="void" displayname="Set Is Logged In" output="false"
hint="Set the logged in status of the user.">

                        <cfargument name="isLoggedIn" type="boolean"
required="yes" />

                        <cfset paramAdmin() />

                        <cflock scope="session" timeout="10"
type="exclusive">

                                    <cfset
getAdmin().setIsLoggedIn(arguments.isLoggedIn) />

                        </cflock>

            </cffunction>

            

            <cffunction name="getIsLoggedIn" output="false" hint="Get
the variable to see if the user is logged in.">

                        <cfreturn getAdmin().getIsLoggedIn() />

            </cffunction>

</cfcomponent>

 

adminLogin.cfc:

<cfcomponent name="adminLogin" displayname="adminLogin" hint="Admin
Login">

            <cffunction name="init"
returntype="designcompanycfm.model.adminLogin" output="false">

                        <cfparam name="variables.admin"
default="#structNew()#" />

                        <cfreturn this />

            </cffunction>

            

            <cffunction name="getAdmin" access="public" output="false"
hint="Return the user object.">

                        <cfreturn this />

            </cffunction>

            

            <cffunction name="login" output="false">

                        <cfargument name="username" type="string"
required="true" />

                        <cfargument name="password" type="string"
required="true" />

                        <cftry>

                        

                        <cfcatch>

                        

                        </cfcatch>

                        

                        </cftry>

            </cffunction>

            

            <cffunction name="setIsLoggedIn" output="false" hint="Set
the variable to see if the user is logged in.">

                        <cfargument name="value" type="boolean"
required="true" default="false">

                        <cfset variables.admin.isLoggedIn =
arguments.value>

            </cffunction>

            

            <cffunction name="getIsLoggedIn" output="false" hint="Get
the variable to see if the user is logged in.">

                        <cfreturn variables.admin.isLoggedIn>

            </cffunction>

 

            <cffunction name="setDisplayName" output="false" hint="Set
the user's display name.">

                        <cfargument name="value" type="string"
required="true">

                        <cfset variables.admin.displayName =
arguments.value>

            </cffunction>

 

            <cffunction name="getDisplayName" output="false" hint="Get
the user's display name.">

                        <cfreturn variables.admin.displayName>

            </cffunction>

</cfcomponent>

 

I know that I don't initially set the variables.admin.isLoggedIn
variable so I don't know where to go from here.  I am almost there (I
can feel it).

 

Thanks for the help.

 

Seth



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216175
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to