Revision 26d25791

b/flowspec/views.py
202 202
@never_cache
203 203
def user_login(request):
204 204
    try:
205
        error_username = None
206
        error_orgname = None
207
        error_affiliation = None
205
        error_username = False
206
        error_orgname = False
207
        error_affiliation = False
208
        error_mail = False
209
        has_affiliation = False
208 210
        error = ''
209 211
        username = request.META['HTTP_EPPN']
210 212
        if not username:
......
220 222
            error_affiliation = True
221 223
        if not organization:
222 224
            error_orgname = True
225
        if not mail:
226
            error_mail = True
223 227
        if error_username:
224
            error = "Your idP should release the HTTP_EPPN attribute towards this service\n"
228
            error = "Your idP should release the HTTP_EPPN attribute towards this service<br>"
225 229
        if error_orgname:
226
            error = error + "Your idP should release the HTTP_SHIB_HOMEORGANIZATION attribute towards this service\n"
230
            error = error + "Your idP should release the HTTP_SHIB_HOMEORGANIZATION attribute towards this service<br>"
227 231
        if error_affiliation:
228
            error = error + "Your idP should release an appropriate HTTP_SHIB_EP_ENTITLEMENT attribute towards this service"
229
        if error_username or error_orgname or error_affiliation:
232
            error = error + "Your idP should release an appropriate HTTP_SHIB_EP_ENTITLEMENT attribute towards this service<br>"
233
        if error_mail:
234
            error = error + "Your idP should release the HTTP_SHIB_INETORGPERSON_MAIL attribute towards this service"
235
        if error_username or error_orgname or error_affiliation or error_mail:
230 236
            return render_to_response('error.html', {'error': error,},
231 237
                                  context_instance=RequestContext(request))
232 238
        user = authenticate(username=username, firstname=firstname, lastname=lastname, mail=mail, organization=organization, affiliation=affiliation)
b/templates/error.html
8 8
<link rel="stylesheet" type="text/css" href="/static/css/base.css">
9 9
<link rel="stylesheet" type="text/css" href="/static/css/smoothness/jquery-ui-1.8.13.custom.css">
10 10
<script type="text/javascript" src="/static/js/jquery-ui-1.8.12.custom.min.js"></script>
11
<script type="text/javascript" src="/static/js/jquery.tooltip.min.js"></script>
11 12

  
13
<script type="text/javascript">
14
$(document).ready(function(){
15
	$(".relogin").tooltip({ position: "bottom center", opacity: 0.7});
16
	});
17
</script>
18
<style type="text/css">
19

  
20
    .tooltip {
21
        display: none;
22
        background: transparent url(/static/black_arrow_updown.png);
23
        font-size: 12px;
24
        height: 70px;
25
        width: 160px;
26
        padding: 25px;
27
		padding-top: 30px;
28
        color: #fff;
29
    }
30

  
31
</style>
12 32
</head>
13 33

  
14 34

  
......
27 47
						{% if user.is_authenticated %}
28 48
						<span class="topmenuuser">{% trans "Welcome" %} <strong>{{user}}</strong></span>
29 49
						{% endif %}
50
						{% comment %}
30 51
						<span {% if user.is_authenticated %}class="topmenuaction"{% else %}class="topmenuuser"{% endif %} >
31
							<form action="{% url django.views.i18n.set_language %}" method="post" style="display:inline;" id="langform">
52
								<form action="{% url django.views.i18n.set_language %}" method="post" style="display:inline;" id="langform">
32 53
								{% csrf_token %}
33 54
								<input name="next" type="hidden" value="{{ next }}" />
34 55
								<input id="langsel" name="language" type="hidden" value="" />
......
36 57
								{% endfor %}
37 58
							</form>
38 59
						</span>
60
						{% endcomment %}
39 61
						{% if user.is_authenticated %}
40 62
						<span class="topmenuaction"><a href="{% url user-profile %}">{% trans "My profile" %}</a></span>
41 63
{% if user.is_superuser %}
......
43 65
{% endif %}
44 66
						<span class="topmenuaction"><a href="{% url logout %}">{% trans "Logout" %}</a></span>
45 67
						{% else %}
46
						<span class="topmenuaction"><a href="{% url login %}">{% trans "Login" %}</a></span>
68
						<span class="topmenuaction relogin" title="After clicking Retry Login, it is strongly suggested to close your browser and visit the page again"><a href="{% url logout %}">{% trans "Retry Login" %}</a></span>
47 69
						{% endif %}
48 70
					</div>
49 71
					
......
57 79
				
58 80
				{% endblock %}
59 81
				{% block content %}
60
				A required shibboleth attribute was not released towards this service<br>
61
				{% if error %}Details: {{error}}<br>{% endif %}
82
				{% if error %}<h2>Error</h2>{% endif %}
83
				<div>
84
				<p>One or more required shibboleth attributes were not released towards this service</p>
85
				<p style="color: red;">{% autoescape off %}{{error}}{% endautoescape %}</p>
86
				<p>
62 87
				Required shibboleth attributes:<br>
63
				<strong>HTTP_EPPN</strong><br>
64
				<strong>HTTP_SHIB_HOMEORGANIZATION</strong>
65
				<br><br>
66
				Optional Attributes:<br>
67
				<strong>HTTP_SHIB_INETORGPERSON_GIVENNAME</strong><br>
68
				<strong>HTTP_SHIB_PERSON_SURNAME</strong><br>
69
				<strong>HTTP_SHIB_INETORGPERSON_MAIL</strong><br>
88
				<ul>
89
				<li>HTTP_EPPN</li>
90
				<li>HTTP_SHIB_HOMEORGANIZATION</li>
91
				<li>HTTP_SHIB_INETORGPERSON_MAIL</li>
92
				<li>An appropriate HTTP_SHIB_EP_ENTITLEMENT</li>
93
				</ul>
94
				Optional Attributes:
95
				<ul>
96
				<li>HTTP_SHIB_INETORGPERSON_GIVENNAME</li>
97
				<li>HTTP_SHIB_PERSON_SURNAME</li>
98
				</ul>
99
				</p>
100
				</div>
70 101

  
71 102
				{% endblock %}
72 103

  

Also available in: Unified diff