My favorites | Sign in
Project Home Downloads Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 137 attachment: Application.cfc (765 bytes)

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
<cfcomponent output="true">


<cffunction name="onRequestStart" returnType="boolean" output="true">
<cfargument type="String" name="targetPage" required=true/>

<cfset var authHeader = GetPageContext().getRequest().getHeader("Authorization") />
<cfset var authString = "" />

<cfsetting showDebugOutput="false" />

<cfif IsDefined("authHeader")>
<cfset authString = ToString(BinaryDecode(ListLast(authHeader, " "),"Base64")) />
<cfif GetToken(authString,1,":") eq "username" AND GetToken(authString,2,":") eq "password">
<cfreturn true />
</cfif>
</cfif>

<cfheader statusCode="401" statusText="UNAUTHORIZED" />
<cfheader name="WWW-Authenticate" value="Basic realm=""MXUnit""" />
<cfreturn false />

</cffunction>

</cfcomponent>
Powered by Google Project Hosting