summaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/views.py b/views.py
index 2f09b8e..b09ea9e 100644
--- a/views.py
+++ b/views.py
@@ -3,6 +3,18 @@ from apps.changepw.models import ChangePasswordForm
from django.shortcuts import render_to_response
from django.template import RequestContext
+def _change_password(user, new_password):
+ '''
+ Use this to call your change password function.
+ '''
+ return 0
+
+def _reset_password(user, new_password):
+ '''
+ Use this to call your reset password function.
+ '''
+ return 0
+
def _get_username(request):
'''
Returns the actual username from the Shibboleth uid.
@@ -31,7 +43,7 @@ def index(request):
context_instance=RequestContext(request))
@login_required(login_url='/sso/accounts/login/')
-def change_password(request, func):
+def change_password(request):
'''
If the user is authenticated and the form is valid the password
changing script will be run with the username and new password.
@@ -41,7 +53,7 @@ def change_password(request, func):
form = ChangePasswordForm(request.POST)
if form.is_valid():
new_password = form.cleaned_data['new_password']
- return_value = func(request.user, new_password)
+ return_value = _change_password(request.user, new_password)
return render_to_response('changepw/change_password.html',
{'return_value': return_value},
context_instance=RequestContext(request))
@@ -61,7 +73,7 @@ def reset_password(request, func):
password_length = 8 # chars
username = _get_username(request)
new_password = _generate_password(password_length)
- return_value = func(request.user, new_password)
+ return_value = _reset_password(request.user, new_password)
return render_to_response('changepw/reset_password.html',
{'username': username, 'new_password': new_password,
'return_value': return_value},