-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.cfc
More file actions
71 lines (52 loc) · 2.66 KB
/
Application.cfc
File metadata and controls
71 lines (52 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<cfcomponent>
<cfset this.name="application_2_1_1">
<cfset this.wsChannels=[{name="world",cfcListener="myChannelListener"}]>
<cfset this.datasource="ecommerece">
<cfset this.sessionManagement=true>
<!--- <cfset this.clientManagement=true>--->
<cfset this.applicationTimeout=#createTimespan(0, 12, 0, 0)#>
<cfset this.sessionTimeout=#createTimespan(0, 4,0, 0)#>
<cfset this.ormEnabled=true>
<cfset this.ormSettings.dbcreate="update">
<cfset this.invokeimplicitaccessor=true>
<cffunction name="onWSAuthenticate" returntype="boolean" access="public" output="false">
<cfargument name="userName" required="true" type="string">
<cfargument name="password" required="true" type="string">
<cfargument name="connectionInfo" required="true" type="struct">
<cfset ARGUMENTS.connectionInfo=#ARGUMENTS.userName#>
<cfreturn true>
</cffunction>
<cffunction name="onSessionStart" output="false" access="public" returntype="void">
<cfcookie name="CFID" value="#SESSION.CFID#" />
<cfcookie name="CFTOKEN" value="#SESSION.CFTOKEN#" />
<!--- Store date the session was created. --->
<cfset SESSION.DateInitialized = Now() />
</cffunction>
<cffunction name="onApplicationStart" returntype="boolean" output="false" access="public">
<cfreturn true>
</cffunction>
<cffunction name="onMissingTemplate" output="false" access="public" returntype="boolean" >
<cfargument name="targetPage" required="true" type="string"/>
<cflocation url="/common/pageNotFound.cfm" addtoken="false" />
<cfreturn true>
</cffunction>
<cffunction name="onSessionEnd" returntype="void">
<cfargument name="SessionScope" required="true">
<cfargument name="ApplicationScope" required="false">
<cfinvoke method="doLogOutOfSession" component="db.userLogoutComponent.doUserLogout" userID=#ARGUMENTS.SessionScope.stLoggedInUser.userID#/>
<!---<cfquery name="deletequery">
delete from OnlineUser
WHERE
userID=<cfqueryparam value=#ARGUMENTS.SessionScope.stLoggedInUser.userID# cfsqltype="cf_sql_int" >
</cfquery>--->
</cffunction>
<cffunction name="onError" output="false" returntype="void" access="public" >
<cfargument name="exception" type="any" required="true">
<cfargument name="eventName" type="string" required="true">
<cfset errorDetails="Details :" & #exception.detail# & " Type :" & #exception.type# & "Message :" & #exception.Message#>
<cflog file="ecommerece" text="#errorDetails#" application="true" >
<cfif arguments.exception EQ "coldfusion.runtime.UndefinedElementException: Element STLOGGEDINUSER.USERID is undefined in SESSION.">
<cflocation url="/view/signin.cfm" addtoken="false" >
</cfif>
</cffunction>
</cfcomponent>