Commit a21406f5 authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

[chgpass] On décore la fonction de changement pour éviter les crashes

 * En gros, on appelle lc_ldap_admin que quand c'est nécessaire
parent 1317aab7
......@@ -25,7 +25,6 @@ import lc_ldap.attributs
import smtplib
encoding = "UTF-8"
ldap = lc_ldap.shortcuts.lc_ldap_admin()
current_user = os.getenv("SUDO_USER") or os.getenv("USER") or os.getenv("LOGNAME") or getpass.getuser()
def check_password(password, no_cracklib=False, dialog=False):
......@@ -125,7 +124,8 @@ def check_password(password, no_cracklib=False, dialog=False):
return False, msg
def change_password(arguments):
@lc_ldap.shortcuts.with_ldap_conn(retries=2, delay=5, constructor=lc_ldap.shortcuts.lc_ldap_admin)
def change_password(arguments, ldap):
"""
Change le mot de passe en fonction des arguments
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment