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 (722 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<cfcomponent output="false">

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

<cfset var headers = GetHttpRequestData().headers />
<cfset var authString = "" />

<cfif StructKeyExists(headers,"Authorization")>
<cfset authString = ToString(BinaryDecode(ListLast(headers.Authorization, " "),"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