WIP: Add ungleich_ldap and use it to reset password
This commit is contained in:
parent
6a28b51354
commit
f6f688dcb5
2 changed files with 153 additions and 5 deletions
14
dal/views.py
14
dal/views.py
|
|
@ -342,11 +342,15 @@ class ResetRequest(View):
|
|||
if len(password1) < 8:
|
||||
return render(request, 'error.html', { 'service': service, 'error': 'The password is too short, please use a longer one. At least 8 characters.' } )
|
||||
# everything checks out, now change the password
|
||||
with get_pool().next() as rpc:
|
||||
pwd = r'%s' % password1
|
||||
result = rpc.changepassword.change_password(user, pwd)
|
||||
# password change successfull
|
||||
if result == True:
|
||||
|
||||
from .ungleich_ldap import LdapManager
|
||||
ldap_manager = LdapManager()
|
||||
result = ldap_manager.change_password(
|
||||
("uid={uid}," + settings.LDAP_CUSTOMER_DN).format(uid=user),
|
||||
password1
|
||||
)
|
||||
# password change successful
|
||||
if result:
|
||||
return render(request, 'changedpassword.html', { 'user': user } )
|
||||
# Something went wrong while changing the password
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue