AW: [Zope-dev] Re: [Zope3-Users] How do I automatically login a user

Zvezdan Petkovic zvezdan at zope.com
Wed Apr 9 10:15:51 EDT 2008


On Apr 9, 2008, at 5:07 AM, kevin gill wrote:
> 1.	IP Extraction
>
> Extract the IP Address from the credentials and store it. Return the  
> IP Address in the dictionary from extractCredentials().
>
> The value from request._environ['HTTP_X_FORWARDED_FOR'] will be used  
> if present.  otherwise request._environ['REMOTE_ADDR'].


On a basis of "privacy" of attributes starting with underscore, such  
as _environ, I would suggest using request.headers (for X-Forwarded- 
For) and request.environment instead.  These are defined in the public  
interface API.

-- 
Zvezdan Petkovic <zvezdan at zope.com>



More information about the Zope-Dev mailing list