Révision 6a622bf4
Ajouté par Serghei Mihai (congés, retour 15/05) il y a environ 9 ans
uauth/views.py | ||
---|---|---|
43 | 43 |
if is_organization_idp(eduPersonTargetedID_NameQualifier, organization): |
44 | 44 |
username = uuid4().get_hex() |
45 | 45 |
password = uuid4().get_hex() |
46 |
create_radius_user(username, password) |
|
47 |
params = QueryDict(self.request.session[organization.slug], mutable=True) |
|
48 |
hotspot_url = organization.hotspot_url |
|
49 |
|
|
50 |
if 'login_url' in params: |
|
51 |
hotspot_url = params.pop('login_url')[0] |
|
52 |
|
|
53 |
context = {'organization': organization, |
|
54 |
'params': params.urlencode(), |
|
55 |
'hotspot_url': hotspot_url, |
|
56 |
'data': {'username': username, |
|
57 |
'password': password |
|
58 |
} |
|
59 |
} |
|
60 |
prefix = organization.hotspot_type |
|
61 |
return render_to_response('uauth/%s_login_successfull.html' % organization.hotspot_type, |
|
62 |
context) |
|
46 |
context = {'organization': organization} |
|
47 |
if create_radius_user(username, password): |
|
48 |
params = QueryDict(self.request.session[organization.slug], mutable=True) |
|
49 |
hotspot_url = organization.hotspot_url |
|
50 |
|
|
51 |
if 'login_url' in params: |
|
52 |
hotspot_url = params.pop('login_url')[0] |
|
53 |
|
|
54 |
context.update({'params': params.urlencode(), |
|
55 |
'hotspot_url': hotspot_url, |
|
56 |
'data': {'username': username, |
|
57 |
'password': password |
|
58 |
} |
|
59 |
}) |
|
60 |
return render_to_response('uauth/%s_login_successfull.html' % organization.hotspot_type, |
|
61 |
context) |
|
63 | 62 |
return render_to_response('uauth/login_failed.html', context) |
64 | 63 |
|
65 | 64 |
login = csrf_exempt(LoginView.as_view()) |
Formats disponibles : Unified diff
fail login if ldap not available (#6827)