summaryrefslogtreecommitdiff
path: root/meetingtools/apps/auth/utils.py
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@nordu.net>2014-10-22 16:56:23 +0200
committerJohan Lundberg <lundberg@nordu.net>2014-10-22 16:56:23 +0200
commit837b730407b580ead2d241050f8690ab5cbb9617 (patch)
treef8b4354d412fd58918d84c310be4c913af531430 /meetingtools/apps/auth/utils.py
parent52c48f15214d3c2c1b228052d6ce60a04e86e4e0 (diff)
Added storage report views.
Diffstat (limited to 'meetingtools/apps/auth/utils.py')
-rw-r--r--meetingtools/apps/auth/utils.py14
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