Revision 26d25791 flowspec/views.py

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)

Also available in: Unified diff