What is ultimately seeing the USER_EMAIL variable. A Python web
application, a PHP application, a CGI script or something else?

What you want to do is possible but only with help of a separate
package to mod_wsgi which doesn't make it necessarily practical at the
moment, especially since there has never been enough interest in the
separate package to make it worthwhile maintaining it.

Graham

On 2 September 2011 02:21, Dominik Ruf <[email protected]> wrote:
> Hi,
> I currently use a mod_python fixuphandler to set an environment variable
> USER_EMAIL.
> The value for this variable I get from a ldap request based on the user name
> that had been set by an apache auth module.
> def fixuphandler(req):
>     remote_user = req.user.split('\\')[-1]
>     l = ldap.initialize("ldap://myserver:389";)
>     l.simple_bind_s("","")
>     r = l.search_s("o=myorg", ldap.SCOPE_SUBTREE, "uid=%s" % remote_user)
>     req.subprocess_env['USER_EMAIL'] = r[0][1]['mail'][0]
>     return apache.OK
>
> Since mod_python is dead (or dying) I am wondering if this is possible with
> mod_wsgi.
> cheers
> Dominik
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/yooYURHwJmMJ.
> 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/modwsgi?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" 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/modwsgi?hl=en.

Reply via email to