summaryrefslogtreecommitdiff
path: root/src/meetingtools/apps
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-04-05 12:36:58 +0200
committerLeif Johansson <leifj@sunet.se>2011-04-05 12:36:58 +0200
commit838b9d6fdbb9112ee70a72b8846f739e8a3b8879 (patch)
treec210512b1054e882d455de6466097705f3a485e7 /src/meetingtools/apps
parent79383e47a772e7d9197179c2be8e6b66e160806c (diff)
new skin
Diffstat (limited to 'src/meetingtools/apps')
-rw-r--r--src/meetingtools/apps/auth/views.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/meetingtools/apps/auth/views.py b/src/meetingtools/apps/auth/views.py
index a95a2bd..d74377a 100644
--- a/src/meetingtools/apps/auth/views.py
+++ b/src/meetingtools/apps/auth/views.py
@@ -9,9 +9,11 @@ import datetime
from django.views.decorators.cache import never_cache
import logging
from meetingtools.apps.userprofile.models import UserProfile
-from meetingtools.multiresponse import redirect_to
+from meetingtools.multiresponse import redirect_to, make_response_dict
from meetingtools.apps.room.views import _acc_for_user
from meetingtools.ac import ac_api_client
+from django.shortcuts import render_to_response
+from django.contrib import auth
def meta(request,attr):
v = request.META.get(attr)
@@ -37,6 +39,15 @@ def _is_member_or_employee(affiliations):
lpa = map(_localpart,affiliations)
return 'student' in lpa or 'staff' in lpa or ('member' in lpa and not 'student' in lpa)
+@never_cache
+def logout(request):
+ auth.logout(request)
+ return HttpResponseRedirect('/Shibboleth.sso/Logout')
+
+@never_cache
+def login(request):
+ return render_to_response('apps/auth/login.html',make_response_dict(request,{'next': request.REQUEST.get("next")}));
+
def accounts_login_federated(request):
if request.user.is_authenticated():
profile,created = UserProfile.objects.get_or_create(user=request.user)
@@ -122,9 +133,3 @@ def accounts_login_federated(request):
else:
pass
return redirect_to("/")
-
-@never_cache
-def logout(request):
- from django.contrib.auth import logout
- logout(request)
- return HttpResponseRedirect("/Shibboleth.sso/Logout") \ No newline at end of file