update 28/02/2022 - 12h00
parent
0274e09612
commit
de74aaa636
12528
Log/log_file.log
12528
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -665,11 +665,11 @@ changement du mot de passe d'un user
|
|||
def change_user_pwd(diction):
|
||||
try:
|
||||
# Dictionnaire des champs utilisables
|
||||
field_list = ['token','new_pwd']
|
||||
field_list = ['token', 'pwd', 'new_pwd', 'conf_new_pwd']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
mycommon.myprint(" Le champ '" + val + "' n'existe pas, requete annulée")
|
||||
mycommon.myprint(" Le champ '" + val + "' n'est pas autorisé, requete annulée")
|
||||
return False, " Impossible de recuperer le user account"
|
||||
|
||||
'''
|
||||
|
@ -683,26 +683,47 @@ def change_user_pwd(diction):
|
|||
return False, " Impossible de recuperer le user account"
|
||||
|
||||
|
||||
|
||||
# recuperation des paramettre
|
||||
email_value = ""
|
||||
token_value = ""
|
||||
pwd = ""
|
||||
new_pwd = ""
|
||||
conf_new_pwd = ""
|
||||
|
||||
mydata ={}
|
||||
|
||||
if diction['token']:
|
||||
token_value = diction['token']
|
||||
if ("pwd" in diction.keys()):
|
||||
if diction['pwd']:
|
||||
pwd = diction['pwd']
|
||||
|
||||
if diction['new_pwd']:
|
||||
new_pwd = diction['new_pwd']
|
||||
mydata['pwd'] = diction['new_pwd']
|
||||
if ("conf_new_pwd" in diction.keys()):
|
||||
if diction['conf_new_pwd']:
|
||||
conf_new_pwd = diction['conf_new_pwd']
|
||||
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token_value = diction['token']
|
||||
|
||||
if ("new_pwd" in diction.keys()):
|
||||
if diction['new_pwd']:
|
||||
new_pwd = diction['new_pwd']
|
||||
mydata['pwd'] = diction['new_pwd']
|
||||
|
||||
|
||||
# Verification de la validité du token/mail dans le cas des user en mode connecté
|
||||
if ( len(str(token_value)) <= 0):
|
||||
mycommon.myprint("Le token est vide")
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le token est vide")
|
||||
return False, "Le token est vide"
|
||||
|
||||
if ( len(str(pwd)) <= 0):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " Le mot de passe est vide")
|
||||
return False, "Le token est vide"
|
||||
|
||||
|
||||
if (str(new_pwd) != str(conf_new_pwd)):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Les mots de passe ne sont pas identiques")
|
||||
return False, " Les mots de passe ne sont pas identiques "
|
||||
|
||||
retval = mycommon.check_token_validity("", token_value)
|
||||
|
||||
if retval is False:
|
||||
|
|
Loading…
Reference in New Issue