Checking For Authentication And Authorization - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

272
<!--- Security error in login occurred,
show login again --->
<H3>Invalid Login</H3>
<CFSET showLogin = "Yes">
</CFCATCH>
</CFTRY>
<CFELSE>
<!--- The login was not detected --->
<CFSET showLogin = "Yes">
</CFIF>
<CFIF showLogin>
<!--- Recreate the url used to call this template --->
<CFSET url = "#cgi.script_name#">
<CFIF cgi.query_string is not "">
<CFSET url = url & "?#cgi.query_string#">
</CFIF>
<!--- Populate the login with the recreated url --->
<CFOUTPUT>
<FORM ACTION="#url#" METHOD="Post">
<TABLE>
<TR>
<TD>username:</TD>
<TD><INPUT TYPE="text" NAME="username"></TD>
</TR>
<TR>
<TD>password:</TD>
<TD><INPUT TYPE="password" NAME="password"></TD>
</TR>
</TABLE>
<INPUT TYPE="submit" VALUE="Login">
</FORM>
</CFOUTPUT>
<CFABORT>
</CFIF>
</CFIF>

Checking for authentication and authorization

Inside application pages, developers can use the IsAuthorized function to check
whether an authenticated user is authorized to access the protected resources, and
then display only the authorized resources.
The following sample page appears to users who pass the authentication test in the
Application.cfm
authenticated users are allowed to update or select data from a datasource.
page above. It uses the IsAuthorized function to test whether
Developing Web Applications with ColdFusion

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

This manual is also suitable for:

Coldfusion 4.5

Table of Contents