mirror of
https://github.com/moepman/bk-dss
synced 2024-11-17 23:09:11 +01:00
Minor cleanup.
This commit is contained in:
parent
c3c76ec772
commit
3dde9cb790
8
index.py
8
index.py
@ -54,17 +54,17 @@ def edit():
|
||||
|
||||
if form.validate_on_submit():
|
||||
opwd = rdb.hget(session['uuid'], 'pswd')
|
||||
pswd = form.pswd.data
|
||||
npwd = form.pswd.data
|
||||
l = ldap.initialize(app.config.get('LDAP_URI', 'ldaps://127.0.0.1'))
|
||||
try:
|
||||
l.simple_bind_s(user, opwd)
|
||||
l.passwd_s(user, opwd, pswd)
|
||||
l.passwd_s(user, opwd, npwd)
|
||||
except ldap.INVALID_CREDENTIALS as e:
|
||||
# TODO error message
|
||||
# TODO display error message
|
||||
l.unbind_s()
|
||||
else:
|
||||
rdb.hset(session['uuid'], 'pswd', pswd)
|
||||
# TODO show a success message
|
||||
# TODO display success message
|
||||
return redirect(url_for('index'))
|
||||
|
||||
form.user.data = user
|
||||
|
Loading…
Reference in New Issue
Block a user