Instead of replacing $destination with $login_session, I recommend simply adding $login_session as an additional parameter to the plugin filter. (Like $user is).
On Feb 15, 2009, at 1:24 PM, Andrew Rickmann wrote: > > I just got around to using this new hook and noticed that it doesn't > pass $login_session, which is a copy of the 'login' session-set which > is retrieved and cleared before this hook is called. > > This means it isn't possible to access the original page the user was > on (stored in $login_session['original')] when they did something that > passed them to the login page. Passing the destination after it has > been calculated will give you a link to admin in general or a specific > admin page, but if the user wasn't on a page with a URL that includes > 'admin/' then there is no way to find out what that page was. > > Can I suggest that the destination that is passed be changed to a copy > of $login_session['original'], as it seems to me, (and this is the use > I want it for) that if you don't want to pass the user to an admin > page when they login it is likely you will need to pass the user to > the page they came from within the site itself. > > Andrew > > 2009/2/9 Chris Meller <[email protected]>: >> Added in r3138. Note that the plugin filter changed to >> 'login_redirect_dest' >> and it receives the destination and the user object. >> >> On Mon, Feb 9, 2009 at 12:42 PM, Andrew Rickmann <[email protected] >> > >> wrote: >>> >>> Although my original suggest was for an action I have added it as a >>> filter instead as it seemed possible to remove some code, instead of >>> just adding an extra line. >>> >>> https://trac.habariproject.org/habari/ticket/859 >>> >>> Andrew >>> >>> 2009/2/9 Chris Meller <[email protected]>: >>>> >>>> I actually looked at this earlier, but apparently got distracted >>>> before I finished and committed it. >>>> >>>> I agree it's a great place to add a filter, so if someone else >>>> wants >>>> to tackle it before I get to it, feel free. >>>> >>>> >>>> >>>> On Feb 8, 2009, at 8:04 PM, Michael Harris <[email protected] >>>> > >>>> wrote: >>>> >>>>> >>>>> There are definitely use cases where you don't want to send a >>>>> logged >>>>> in user to any admin page, so I think a login_redirect_before >>>>> hook is >>>>> reasonable. >>>>> >>>>> -- >>>>> Michael C. Harris, School of CS&IT, RMIT University >>>>> http://twofishcreative.com/michael/blog >>>>> IRC: michaeltwofish #habari >>>>> >>>>>> >>>> >>>>> >>>> >>> >>> >> >> >>> >> > > > --~--~---------~--~----~------------~-------~--~----~ 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/habari-dev -~----------~----~----~----~------~----~------~--~---
