-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathApplication.cfc
More file actions
executable file
·42 lines (33 loc) · 1.45 KB
/
Application.cfc
File metadata and controls
executable file
·42 lines (33 loc) · 1.45 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
<cfcomponent displayname="Applicaiton" hint="Application.cfc" output="false">
<cfscript>
this.name = "hackableType";
this.customtagpaths = expandPath('/tags');
this.sessionManagement = true;
this.scriptProtect = "none";
this.compileExtForInclude = "*";
</cfscript>
<cffunction name="onApplicationStart" access="public" returntype="void" output="false">
<cfset application.dsn = "hackableType" />
<cfset application.siteRoot = listDeleteAt(cgi.SCRIPT_NAME, ListLen(cgi.SCRIPT_NAME, "/"), "/") />
<cfset application.config = CreateObject("component", "components.Configuration").init(application.dsn)>
<cfset application.lessonFactory = CreateObject("component", "components.LessonFactory").init(application.config)>
<cfset application.encoder = createObject('java', 'org.owasp.esapi.reference.DefaultEncoder') />
</cffunction>
<cffunction name="onSessionStart" access="public" returntype="void" output="false">
</cffunction>
<cffunction name="onRequestStart" access="public" returntype="void" output="false">
<cfheader name="X-XSS-Protection" value="0">
<cfset onApplicationStart() />
</cffunction>
<cffunction name="onError" access="public" returntype="void" output="false">
<cfargument name="exception" />
<cfargument name="event" />
<cfif exception.type eq "database">
<cfinclude template="database.cfm" />
<cfabort>
<cfelse>
<cfinclude template="error.cfm" />
<cfabort>
</cfif>
</cffunction>
</cfcomponent>