diff options
Diffstat (limited to 'meetingtools/apps/auth')
-rw-r--r-- | meetingtools/apps/auth/utils.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meetingtools/apps/auth/utils.py b/meetingtools/apps/auth/utils.py index 0651eba..c792b4a 100644 --- a/meetingtools/apps/auth/utils.py +++ b/meetingtools/apps/auth/utils.py @@ -5,6 +5,8 @@ Created on Jul 7, 2010 """ from uuid import uuid4 +from django.conf import settings as django_settings + def nonce(): return uuid4().hex @@ -19,4 +21,14 @@ def groups(request): if request.user.is_authenticated(): groups = request.user.groups - return groups
\ No newline at end of file + return groups + + +def report_auth(request): + auth_data = request.META.get('HTTP_X_REPORT_AUTH', None) + if auth_data and ':' in auth_data: + report_users = getattr(django_settings, 'REPORT_USERS') + requester, key = auth_data.split(':') + if report_users[requester]['key'] == key: + return report_users[requester] + return False
\ No newline at end of file |