mirror of
https://github.com/moepman/bk-dss
synced 2024-12-22 17:24:25 +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():
|
if form.validate_on_submit():
|
||||||
opwd = rdb.hget(session['uuid'], 'pswd')
|
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'))
|
l = ldap.initialize(app.config.get('LDAP_URI', 'ldaps://127.0.0.1'))
|
||||||
try:
|
try:
|
||||||
l.simple_bind_s(user, opwd)
|
l.simple_bind_s(user, opwd)
|
||||||
l.passwd_s(user, opwd, pswd)
|
l.passwd_s(user, opwd, npwd)
|
||||||
except ldap.INVALID_CREDENTIALS as e:
|
except ldap.INVALID_CREDENTIALS as e:
|
||||||
# TODO error message
|
# TODO display error message
|
||||||
l.unbind_s()
|
l.unbind_s()
|
||||||
else:
|
else:
|
||||||
rdb.hset(session['uuid'], 'pswd', pswd)
|
rdb.hset(session['uuid'], 'pswd', pswd)
|
||||||
# TODO show a success message
|
# TODO display success message
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
form.user.data = user
|
form.user.data = user
|
||||||
|
Loading…
Reference in New Issue
Block a user