diff options
author | Johan Lundberg <lundberg@nordu.net> | 2011-05-27 14:09:49 +0200 |
---|---|---|
committer | Johan Lundberg <lundberg@nordu.net> | 2011-05-27 14:09:49 +0200 |
commit | 1fcfc08280991ac25afcf78723340279ac79594f (patch) | |
tree | 31bab9e4f86831aa4192977a1bfd8137829ac680 /views.py | |
parent | 650d1fce18fc1d3632dc42028d6ecdf131177096 (diff) |
Updated so that password strength follows NORDUnet security guidelines.
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -18,7 +18,7 @@ def _reset_password(request, user, new_password): ''' # ret = your_pw_change_module.reset_password(user, new_password) return 0 - + def _change_other(request, *args): ''' Use this to call your change function. @@ -53,9 +53,10 @@ def _select_template(request, s): the suffix if the request comes from a mobile device. 'changepw/change_password.html' -> 'changepw/change_password_m.html' ''' - p = re.compile('(iphone|ipod|blackberry|android|palm|windows\s+ce)', re.IGNORECASE) + p = re.compile('(iphone|ipod|blackberry|android|palm|windows\s+ce)', + re.IGNORECASE) if p.search(request.META['HTTP_USER_AGENT']): - parts = s.split('.') + parts = s.split('.') tmpl = "%s_m.%s" % (parts[0], parts[1]) else: tmpl = s @@ -66,11 +67,11 @@ def index(request): ''' Greets the user and presents the choices available. ''' + username = _get_username(request) try: - full_name = '%s %s' % (request.user.firstname, request.user.lastname) + full_name = request.user.get_full_name() except AttributeError: - full_name = _get_username(request) - username = _get_username(request) + full_name = username tmpl = _select_template(request, 'changepw/index.html') return render_to_response(tmpl, {'full_name': full_name, 'username': username}, @@ -129,7 +130,7 @@ def change_other(request, *args): return_value = _change_other(request, *args) return render_to_response(tmpl, {'username': username, 'return_value': return_value}, - context_instance=RequestContext(request)) + context_instance=RequestContext(request)) else: return render_to_response(tmpl, {'username': username, 'return_value': None}, |