I would like to see a 2nd mod_python handler. one which takes the REMOTE_USER parameter passed to it and for it to use that as the user-id so that I can hook my app into the default intranet security system we use over here.
here is the patch to the original to make that the case.
NOTE: it creates a user-record if none exist for the user.
Helios:/src/django_newadmin/django/core/handlers ianh$ diff
modpython_apacheauth.py modpython.py
102,103c102
< #user_id = self.session[users.SESSION_KEY]
< user_id = self._req.user
---
> user_id = self.session[users.SESSION_KEY]
106,117c105,106
< try:
< self._user = users.get_object(username__exact=user_id)
< except (users.UserDoesNotExist):
< from django.models.auth import User
< import md5
< import datetime
< password_md5 = md5.new('fake').hexdigest()
< now = datetime.datetime.now()
< self._user = User(None, user_id,'','', user_id+'@cnet.com',password_md5,False,True,False,now,now)
< self._user.save()
< #except (AttributeError, KeyError, ValueError, users.UserDoesNotExist):
< except (AttributeError, KeyError, ValueError):
---
> self._user = users.get_object(pk=user_id)
> except (AttributeError, KeyError, ValueError, users.UserDoesNotExist):
120d108
<