Commit 1f83e8db authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Added smarter email parsing from request.META dict

parent 1f9082cd
......@@ -962,7 +962,13 @@ def user_login(request):
error_username = True
firstname = request.META['HTTP_SHIB_INETORGPERSON_GIVENNAME']
lastname = request.META['HTTP_SHIB_PERSON_SURNAME']
mail = request.META['mail'] or request.META['HTTP_SHIB_INETORGPERSON_MAIL']
if 'mail' in request.META:
mail = request.META['mail']
elif ('HTTP_SHIB_INETORGPERSON_MAIL' in request.META):
mail = request.META['HTTP_SHIB_INETORGPERSON_MAIL']
else:
mail = ''
#organization = request.META['HTTP_SHIB_HOMEORGANIZATION']
entitlement = request.META['HTTP_SHIB_EP_ENTITLEMENT']
if settings.SHIB_AUTH_ENTITLEMENT in entitlement.split(";"):
......@@ -1013,7 +1019,7 @@ def user_login(request):
return render_to_response('status.html', {'error': error,},
context_instance=RequestContext(request))
except Exception:
error = _("Invalid login procedure")
error = _("Invalid login procedure. Error: %s"%e)
return render_to_response('status.html', {'error': error,},
context_instance=RequestContext(request))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment