05/07/23 - 12h

master
cherif 2023-07-05 12:01:22 +02:00
parent 384e51d5a3
commit a99328c6e9
7 changed files with 1878 additions and 22 deletions

View File

@ -1,18 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/07/23 - 10h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="04/07/23 - 17h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/appel_offre.py" beforeDir="false" afterPath="$PROJECT_DIR$/appel_offre.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/articles_avis.py" beforeDir="false" afterPath="$PROJECT_DIR$/articles_avis.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Template/MySy_User_account_change_pwd_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_User_account_change_pwd_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_factures_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_factures_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_user_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_user_account.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -335,7 +331,14 @@
<option name="project" value="LOCAL" />
<updated>1688460514460</updated>
</task>
<option name="localTasksCounter" value="38" />
<task id="LOCAL-00038" summary="04/07/23 - 17h">
<created>1688482338857</created>
<option name="number" value="00038" />
<option name="presentableId" value="LOCAL-00038" />
<option name="project" value="LOCAL" />
<updated>1688482338857</updated>
</task>
<option name="localTasksCounter" value="39" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -350,7 +353,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="23/04/23 - 19h" />
<MESSAGE value="24/04/23 - 21h" />
<MESSAGE value="25/04/23 - 21h" />
<MESSAGE value="28/04/23 - 21h" />
@ -375,6 +377,7 @@
<MESSAGE value="13/06/23 - 16h" />
<MESSAGE value="13/06/23 - 21h21" />
<MESSAGE value="04/07/23 - 10h" />
<option name="LAST_COMMIT_MESSAGE" value="04/07/23 - 10h" />
<MESSAGE value="04/07/23 - 17h" />
<option name="LAST_COMMIT_MESSAGE" value="04/07/23 - 17h" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -106,9 +106,11 @@
<a href="{{params.mysyurl}}" target="_blank" rel="noopener noreferrer" data-auth="NotApplicable" style="display:inline-block; background:#FFB800; color:#232558; font-family:Ubuntu,Helvetica,Arial,sans-serif,Helvetica,Arial,sans-serif; font-size:14px; font-weight:normal; line-height:17.5px; margin:0; text-decoration:none; text-transform:none; padding:13px 26px 13px 26px; border-radius:3px" data-linkindex="3">
<div><strong><span style="font-family:Helvetica,sans-serif;"> Réinitialisez !</span></strong></div>
</a>
</td></tr></tbody></table></td></tr></tbody></table>
</td></tr>
</tbody></table></td></tr></tbody></table>
<div> le lien : {{params.mysyurl}} </div>
<p style="text-align:justify; font-size:13px; line-height: 1.8rem;">
Si vous n'etes pas à l'origine de cette demande,

View File

@ -164,11 +164,11 @@ def add_payement_mode(diction):
# Verification de la validité du pwd et du secret
coll_tmp = MYSY_GV.dbname['partnair_account']
tmp_count = coll_tmp.count_documents({'pwd': str(my_pwd), 'active': '1', 'token':str(my_secret)})
tmp_count = coll_tmp.count_documents({'pwd': str(my_pwd), 'active': '1', 'secret_key':str(my_secret)})
if (tmp_count <= 0):
return False, "Les identifiants sont incorrectes"
tmp_account = coll_tmp.find({'pwd': str(my_pwd), 'active': '1', 'token':str(my_secret)})
tmp_account = coll_tmp.find({'pwd': str(my_pwd), 'active': '1', 'secret_key':str(my_secret)})
"""
Stripe : recuperation du stripe_account_id

View File

@ -1103,7 +1103,7 @@ def Reset_user_pwd_by_token(diction):
return False, "Le token est invalide"
# Recuperation du recid du user
user_recid = tmp_retval[0]['recid']
user_email = tmp_retval[0]['email']
mydata = {}
mydata['date_update'] = str(datetime.now())
mydata['pwd'] = new_pwd
@ -1111,14 +1111,22 @@ def Reset_user_pwd_by_token(diction):
coll_name = MYSY_GV.dbname['partnair_account']
print(" le recid PARTENAIRE = " + user_recid + " mydata = " + str(mydata))
ret_val = coll_name.find_one_and_update({'recid': user_recid, 'locked': '0', 'active': '1'},
#print(" le recid PARTENAIRE = " + user_recid + " mydata = " + str(mydata))
ret_val = coll_name.find_one_and_update({'email': user_email, 'locked': '0', 'active': '1'},
{"$set": mydata},
upsert=False,
return_document=ReturnDocument.AFTER
)
if (ret_val and ret_val['_id']):
# Deactivation du token temporaire de mise à jour
retval = MYSY_GV.dbname['partnair_account'].update_many(
{'tmp_token_pwd':str(token_value), 'active':'1'},
{"$unset": {'active': '', 'tmp_token_pwd': '', 'email':''}}
)
mycommon.myprint(str(inspect.stack()[0][3]) + " Le mot de passe a bien été mise à jour")
return True, "Le mot de passe a bien été mise à jour "
else:
@ -1747,7 +1755,7 @@ def InitUserPasswd(diction):
if ("secrete" in diction.keys()):
if diction['secrete']:
mysecrete = diction['secrete']
myquery['token'] = diction['secrete']
myquery['secret_key'] = diction['secrete']
myquery['active'] = '1'
@ -1842,6 +1850,8 @@ def InitUserPasswd(diction):
# Creation du token
mynewtoken = mycommon.create_token_urlsafe()
new_token['tmp_token_pwd'] = mynewtoken
new_token['active'] = "1"
new_token['email'] = str(myemail)
ret_val = coll_name.find_one_and_update(
{'recid': str(retVal[0]['recid']), },
@ -1936,9 +1946,18 @@ def IsUserTokenValide(diction):
tmp = coll_name_token.count_documents(myquery)
if (tmp <= 0):
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucun resultat trouvé pour " + str(myquery))
mycommon.myprint(str(inspect.stack()[0][3]) + " Aucun resultat trouvé pour la" + str(myquery))
return "Err_Connexion", "La session de connexion n'est pas valide"
""" # Deactivation du token temporaire de mise à jour
retval = MYSY_GV.dbname['partnair_account'].update_many(
myquery,
{"$unset": {'active':'', 'tmp_token_pwd':''}}
)
print(" #### IsUserTokenValide = ", retval)
"""
return True, "Le token est valdie"

View File

@ -1439,6 +1439,8 @@ def send_user_init_pwd_mail(token, account_mail, type_account):
my_url = "https://www.mysy-training.com/ResetUserPwd/" + str(token)+"/"+str(type_account)
elif (MYSY_GV.MYSY_ENV == "DEV"):
my_url = "http://localhost:3009/ResetUserPwd/" + str(token)+"/"+str(type_account)
elif (MYSY_GV.MYSY_ENV == "REC"):
my_url = "https://dev.mysy-training.com/ResetUserPwd/" + str(token) + "/" + str(type_account)
"""send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(template_id=19, params={"mysyurl": my_url,
"user_name": str(account_mail),

View File

@ -829,7 +829,7 @@ def valide_partnair_account(value):
ret_val = coll_name.find_one_and_update({'_id':ObjectId(str(value)), 'locked':'0'},
{"$set":
{'active': "1","date_update":str(now),
'token':str(my_token),
'secret_key':str(my_token),
'stripe_account_id':part_stripe_account_id,
}
},
@ -837,7 +837,7 @@ def valide_partnair_account(value):
)
if( ret_val and ret_val['_id']):
mycommon.myprint("La modif a bien ete faite Ajout Token OK, ="+str(ret_val['_id']))
mycommon.myprint("La modif a bien ete faite Ajout secret_key OK, ="+str(ret_val['_id']))
# Envoie du mail de notification
mail.Pro_Account_Token_Pass(partner_email, my_token)
return 'True', my_token