On Sat, Nov 15, 2008 at 12:03 PM, Thomas Johnson <[EMAIL PROTECTED]> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Kevin Baker wrote:
>> I am writing a custom authentication system. I am adding "action" level
>> authentication.
>>
>> How would I go about getting the current "action" in my login module?
>>
>> I'm thinking something like this
>>
>> currentAction = c.currentAction
>>
>> if (currentAction in self.secureActionList)
>>
>> redirect_to(controller="pageController", action"login")
>>
>>
>>
>>
>>
>> >
> Not sure if this is the "correct" way or not but you can get the
> requested action like this:
>
> current_request = request.environ.get("pylons.routes_dict")
> then you can reference current_request["action"]
That is the most direct way to get it. The most convenient way is
c.action (and likewise for other routing variables), which should
always work on Pylons 0.9.6. On 0.9.7 I think there's an option to
enable it, and I'm not sure if it's default on or off (or what it's
called).
--
Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---