cflearning
Technical User
I'm using ultra dev 4.01 and can't get the server behaviour of restrict access to page to do anything much at all. In IE, it simply shows the cf code and the page beneath. In netscape, you move directly to the page with no trouble. I'm using a simple access database to authenticate users -- this is working fine. It's the page that I'm authenticating to that is the problem -- type in the url and you're there even though restrict access is in place
Here's the goods:
<cfscript>
<cfapplication name="name"
sessionmanagement="yes">
// *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="";
MM_authFailedURL="../failedlogin.cfm";
MM_grantAccess=false;
MM_Session = IIf(IsDefined("Session.MM_Username","Session.MM_Username",DE("");
if (MM_Session IS NOT "" {
if (true OR (Session.MM_UserAuthorization IS "" OR (Find(Session.MM_UserAuthorization, MM_authorizedUsers) GT 0)) {
MM_grantAccess = true;
}
}
if (NOT MM_grantAccess) {
MM_qsChar = "?";
if (Find("?",MM_authFailedURL) GT 0) MM_qsChar = "&";
MM_referrer = CGI.SCRIPT_NAME;
if (CGI.QUERY_STRING IS NOT "" MM_referrer = MM_referrer & "?" & CGI.QUERY_STRING;
MM_authFailedURL_Trigger = MM_authFailedURL & MM_qsChar & "accessdenied=" & URLEncodedFormat(MM_referrer);
}
</cfscript>
<cfif IsDefined("MM_authFailedURL_Trigger">
<cflocation url="#MM_authFailedURL_Trigger#" addtoken="no">
</cfif>
Here's the goods:
<cfscript>
<cfapplication name="name"
sessionmanagement="yes">
// *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="";
MM_authFailedURL="../failedlogin.cfm";
MM_grantAccess=false;
MM_Session = IIf(IsDefined("Session.MM_Username","Session.MM_Username",DE("");
if (MM_Session IS NOT "" {
if (true OR (Session.MM_UserAuthorization IS "" OR (Find(Session.MM_UserAuthorization, MM_authorizedUsers) GT 0)) {
MM_grantAccess = true;
}
}
if (NOT MM_grantAccess) {
MM_qsChar = "?";
if (Find("?",MM_authFailedURL) GT 0) MM_qsChar = "&";
MM_referrer = CGI.SCRIPT_NAME;
if (CGI.QUERY_STRING IS NOT "" MM_referrer = MM_referrer & "?" & CGI.QUERY_STRING;
MM_authFailedURL_Trigger = MM_authFailedURL & MM_qsChar & "accessdenied=" & URLEncodedFormat(MM_referrer);
}
</cfscript>
<cfif IsDefined("MM_authFailedURL_Trigger">
<cflocation url="#MM_authFailedURL_Trigger#" addtoken="no">
</cfif>