I have a site that requires a user to be authenticated outside of Mach II when the user clicks the login link. When the user clicks the login link I send the user to the login event which has a filter that checks if the user session is currently set and that checks if the user is currently logged in. If the user session is not set and the user is not logged in, I send the user outside of Mach II to be authenticated. I do this by using a cflocation in the filter that directs the user to the outside source, which is used to authenticate the user. Once the user is authenticated, the user is then redirected back to the website; however, the outside source is not aware of mach ii and its events, so it sees the referrer as index.cfm, which is not the event the user is currently on. To get around the referrer issue I have an intermediate page that the login filter calls with URL parameters. I wanted to be able to use getPreviousEvent to get the previous event name and put that name in the URL parameters, but that doesn’t work because, I’m guessing, I called a new event. The solution was to have a filter build the login url with the current event name, for example, index.cfm? event=login&previousEvent=someEvent. The intermediate page then checks to see if previousEvent is defined. If it is defined, a URL is built with previousEvent as the event and then the user is redirected back to mach II from the intermediate page.
It seems I misinterpreted how getPreviousEvent works. Thanks, Jeremy On Aug 20, 7:49 pm, "Peter J. Farrell" <[email protected]> wrote: > When in the request lifecycle and where in your code are you calling > getPreviousEvent()? > > .Pjf > > -----Original Message----- > From: "[email protected]" <[email protected]> > > Date: Thu, 20 Aug 2009 16:14:11 > To: Mach-II for CFML<[email protected]> > Subject: [Mach-II] getPreviousEvent > > Why does getPreviousEvent return the current event even though a > previous event has been handled? According to the Mach-II 1.5 > documentation, getPreviousEvent returns the previously handled event. > > Thanks, > Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to Mach-II for CFML list. 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/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ -~----------~----~----~----~------~----~------~--~---
