I use two methods in my basic login form. The form can be included
with cfinclude, or it can be called directly with a link.  So, using
both, I have this code at the top of the file...

<cfset ThisPage=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
        <cfset ThisPage=ThisPage & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>

<cfif IsDefined("FORM.username")>
        <cfset loginInfo = StructNew()>
    <cfset loginInfo.username = FORM.username>
    <cfset loginInfo.password = FORM.password>
        <cfset REQUEST.mcp.call('secure:login',loginInfo)>

    <!--- if page passed as a URL, transfer to this page instead after
a login attempt --->
    <cfif StructKeyExists( URL, 'page' )>
        <cflocation url="#URL.page#" addtoken="no" />
    </cfif>
    <!--- Reload this page, if login succeeded, it will proceed as
normal --->
    <cflocation url="#ThisPage#" addtoken="no">

</cfif>

<cfform ...>
</cfform>

At the top of the including page I have...

<cfif NOT AUTHORIZED check roles etc >
        <div align="center">
        Some text above login form<br><br>
        </div>
        <cfinclude template="#REQUEST.PATH.lib#/login.cfm" />
<cfelse>
.. rest of page to authorized viewers
</cfif>

so the include method works well too, because once proper access
authorized, it returns to the right page, because technically it never
left it, and executes the remainder of the code.

--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to