23/03/23 - 16h
parent
861cbfd6b3
commit
9d998e6e36
|
@ -4,8 +4,14 @@
|
|||
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="21/03/23 - 22h">
|
||||
<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$/Template/MySy_Create_PRO_account_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_Create_PRO_account_tpl.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Template/MySy_account_pro_enabled_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_account_pro_enabled_tpl.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/strype_payement.py" beforeDir="false" afterPath="$PROJECT_DIR$/strype_payement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.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" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
1735
Log/log_file.log
1735
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -65,7 +65,7 @@
|
|||
<tr>
|
||||
<td bgcolor="#ffffff" height="165" style="height:165px; padding: 0.7rem;" width="600">
|
||||
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff"
|
||||
style="background-color:#ffffff">
|
||||
style="background-color:#ffffff">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" height="165"
|
||||
|
@ -83,17 +83,22 @@
|
|||
<p> Bonjour {{ params.user_name }}</p>
|
||||
|
||||
<p style="text-align:justify">
|
||||
<p style="text-align:justify">
|
||||
<p style="text-align:justify;font-size:12px">
|
||||
Vous avez fait une demande de création d'un compte
|
||||
professionnel sur mysy-training.com.</p>
|
||||
|
||||
<p style="text-align:justify">La sécurité de vos données
|
||||
est primordiale pour nous. Une fois que vous aurez
|
||||
activé votre compte vous allez recevoir <font
|
||||
color="red"> une clé secrète </font> nécessaire
|
||||
pour vous connecter.</p>
|
||||
<p style="text-align:justify;font-size:12px">Après l'activation de
|
||||
votre compte, vous allez recevoir <u><font color="red">
|
||||
une clé secrète </font></u>
|
||||
nécessaire pour la saisie et la modification de vos
|
||||
modes de payement.<br />
|
||||
|
||||
<p style="text-align:justify">Pour activer votre compte,
|
||||
Seules les personnes autorisées à utiliser vos
|
||||
moyens de payement doivent connaitre cette clé.
|
||||
</p>
|
||||
|
||||
|
||||
<p style="text-align:justify;font-size:12px">Pour activer votre compte,
|
||||
veuillez cliquer sur le lien ci-dessous. </p>
|
||||
</p>
|
||||
|
||||
|
@ -107,18 +112,13 @@
|
|||
</a>
|
||||
|
||||
<p style="text-align:justify">
|
||||
<p
|
||||
style="text-align:justify; color: red; text-decoration: underline;">
|
||||
Important </p>
|
||||
<p style="text-align:justify">
|
||||
Pour vous connecter entant que professionnel sur le
|
||||
site mysy-training.com, la clé secrète et le mot de
|
||||
passe sont nécessaires.</p>
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<p
|
||||
style="font-size:x-small;margin-top: 1rem; line-height: normal; margin-bottom: 1rem;">
|
||||
style="font-size:12px;margin-top: 1rem; line-height: normal; margin-bottom: 1rem;">
|
||||
Cordialement<br />
|
||||
MySy Training Technology<br />
|
||||
Contact : +337 69 20 39 45<br />
|
||||
|
@ -162,7 +162,7 @@
|
|||
Training 1 Cr du Havre, 75008 Paris ou par mail :
|
||||
contact@mysy-training.com.
|
||||
<br />
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<tr>
|
||||
<td bgcolor="#ffffff" height="165" style="height:165px; padding: 0.7rem;" width="600">
|
||||
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff"
|
||||
style="background-color:#ffffff">
|
||||
style="background-color:#ffffff">
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -84,10 +84,10 @@
|
|||
<p> Bonjour {{ params.user_name }}</p>
|
||||
|
||||
<p style="text-align:justify">
|
||||
<p style="text-align:justify">
|
||||
<p style="text-align:justify;font-size:12px">
|
||||
|
||||
Vous venez d'activer votre compte professionnel sur
|
||||
le moteur de recherche MySy-Training. Tout s'est
|
||||
le site MySy-training.com Tout s'est
|
||||
bien déroulé.
|
||||
</p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
|
@ -104,20 +104,22 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<p style="text-align:justify">
|
||||
<p style="text-align:justify;font-size:12px">
|
||||
|
||||
Vous pouvez dès à présent vous connecter à l'aide de
|
||||
votre email, mot de passe et votre <font
|
||||
color="red"> clé secrète </font> pour utiliser
|
||||
les services proposés par MySy.</p>
|
||||
votre email et votre mot de passe.<br />
|
||||
Conservez votre <font color="red"> clé secrète
|
||||
</font> pour la gestion de vos modes de paiement.
|
||||
</p>
|
||||
|
||||
<p style="text-align:justify">Votre clé secrète est : {{
|
||||
params.secrete }}<br />url de connexion :
|
||||
https://www.mysy-training.com/PartnerLogin </p>
|
||||
<p style="text-align:justify;font-size:12px">Votre clé
|
||||
secrète est : {{
|
||||
params.secrete }}<br />
|
||||
Rendez-vous sur le site <a href="https://www.mysy-training.com/"> https://www.mysy-training.com/ </a> pour vous connecter</p>
|
||||
</p>
|
||||
|
||||
<p
|
||||
style="font-size:x-small;margin-top: 1rem; line-height: normal;margin-bottom: 1rem;">
|
||||
style="font-size:12px;margin-top: 1rem; line-height: normal;margin-bottom: 1rem;">
|
||||
Cordialement<br />
|
||||
MySy Training Technology<br />
|
||||
Contact : +337 69 20 39 45<br />
|
||||
|
@ -161,7 +163,7 @@
|
|||
Training 1 Cr du Havre, 75008 Paris ou par mail :
|
||||
contact@mysy-training.com.
|
||||
<br />
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,developpement,1,0.5,5Disc_0008,title
|
||||
1,1,personnel,1,0.5,5Disc_0008,title
|
||||
0,0,praticien,1,0.33,MYSY_Test_AR,title
|
||||
1,1,aromatherapie,1,0.33,MYSY_Test_AR,title
|
||||
2,2,integrative,1,0.33,MYSY_Test_AR,title
|
||||
|
|
|
|
@ -1,3 +1,4 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 developpement 1 0.5 5Disc_0008 title
|
||||
1 personnel 1 0.5 5Disc_0008 title
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 praticien 1 0.33 MYSY_Test_AR title
|
||||
1 aromatherapie 1 0.33 MYSY_Test_AR title
|
||||
2 integrative 1 0.33 MYSY_Test_AR title
|
|
@ -166,39 +166,73 @@ def Create_MySy_LMS_User(diction):
|
|||
for username, email_canonical in cur:
|
||||
print(f"username: {username}, email_canonical : {email_canonical}")
|
||||
"""
|
||||
# Verification d'abord si le compte exite.
|
||||
query_compte_exist = " Select count(*), user_id From user WHERE username = '"+username+"' "
|
||||
print(" ### query_compte_exist = ", query_compte_exist)
|
||||
query_compte_exist_exec = cur.execute(query_compte_exist)
|
||||
|
||||
# insert information
|
||||
my_query = "INSERT INTO user SET id='"+str(new_lms_user_id)+"' , " \
|
||||
"user_id='"+str(new_lms_user_id)+"' , " \
|
||||
"lastname = '"+lastname+"', " \
|
||||
"firstname = '"+firstname+"', " \
|
||||
"username = '"+username+"', " \
|
||||
"salt = '"+str(salt)+"'," \
|
||||
" registration_date = '"+registration_date+"'," \
|
||||
" credentials_expired='0', " \
|
||||
"enabled='1', " \
|
||||
"expired='0', " \
|
||||
"created_at='" + str( registration_date) + "'," \
|
||||
" updated_at='" + str( registration_date) + "', " \
|
||||
" status = '1', " \
|
||||
"password = '"+str(hashed_pwd)+"', " \
|
||||
"locked = '0', " \
|
||||
"username_canonical = '"+username+"', " \
|
||||
" email_canonical = '"+email+"', " \
|
||||
"email = '"+email+"'," \
|
||||
" official_code = '"+official_code+"', " \
|
||||
"creator_id = '1', " \
|
||||
"auth_source = 'platform'," \
|
||||
"roles = 'a:0:{}', " \
|
||||
"language = 'french'," \
|
||||
"active = '1';"
|
||||
query_compte_exist_exec = ""
|
||||
query_compte_exist_exec_val = "0"
|
||||
for query_compte_exist_exec in cur:
|
||||
query_compte_exist_exec_val = query_compte_exist_exec[0]
|
||||
new_lms_user_id = query_compte_exist_exec[1]
|
||||
conn.commit()
|
||||
|
||||
|
||||
if( int(mycommon.tryInt(query_compte_exist_exec_val)) > 0 ):
|
||||
# Le compte existe, il faut donc faire une mise à jour
|
||||
my_query = "UPDATE user SET salt = '" + str(salt) + "', credentials_expired='0', " \
|
||||
"updated_at='" + str(registration_date) + " ', " \
|
||||
"password = '" + str(
|
||||
hashed_pwd) + "', " \
|
||||
"enabled='1', " \
|
||||
"expired='0', " \
|
||||
"locked = '0', " \
|
||||
"auth_source = 'platform'," \
|
||||
"roles = 'a:0:{}', " \
|
||||
"language = 'french'," \
|
||||
"username_canonical = '" + username + "', " \
|
||||
" email_canonical = '" + email + "', " \
|
||||
"email = '" + email + "'," \
|
||||
" official_code = '" + official_code + "', " \
|
||||
"active = '1' WHERE username='" + str(
|
||||
email) + "' ;"
|
||||
else:
|
||||
# Le compte n'existe pas, il faut le créer
|
||||
|
||||
|
||||
# insert information
|
||||
my_query = "INSERT INTO user SET id='"+str(new_lms_user_id)+"' , " \
|
||||
"user_id='"+str(new_lms_user_id)+"' , " \
|
||||
"lastname = '"+lastname+"', " \
|
||||
"firstname = '"+firstname+"', " \
|
||||
"username = '"+username+"', " \
|
||||
"salt = '"+str(salt)+"'," \
|
||||
" registration_date = '"+registration_date+"'," \
|
||||
" credentials_expired='0', " \
|
||||
"enabled='1', " \
|
||||
"expired='0', " \
|
||||
"created_at='" + str( registration_date) + "'," \
|
||||
" updated_at='" + str( registration_date) + "', " \
|
||||
" status = '1', " \
|
||||
"password = '"+str(hashed_pwd)+"', " \
|
||||
"locked = '0', " \
|
||||
"username_canonical = '"+username+"', " \
|
||||
" email_canonical = '"+email+"', " \
|
||||
"email = '"+email+"'," \
|
||||
" official_code = '"+official_code+"', " \
|
||||
"creator_id = '1', " \
|
||||
"auth_source = 'platform'," \
|
||||
"roles = 'a:0:{}', " \
|
||||
"language = 'french'," \
|
||||
"active = '1';"
|
||||
|
||||
try:
|
||||
#print(" ### my_query = ", my_query)
|
||||
print(" ### my_query = ", my_query)
|
||||
#cur.execute("INSERT INTO employees (first_name,last_name) VALUES (?, ?)", ("Maria", "DB"))
|
||||
cur.execute(my_query)
|
||||
except mariadb.Error as e:
|
||||
print(f"Error: {e}")
|
||||
#print(f"Error: {e}")
|
||||
mycommon.myprint(" Impossible de créer l'utilisateur LMS "+str({e}))
|
||||
return False, "Impossible de créer l'utilisateur LMS "+str({e}), False
|
||||
|
||||
|
@ -218,7 +252,7 @@ def Create_MySy_LMS_User(diction):
|
|||
|
||||
new_dicton = {}
|
||||
new_dicton['token'] = my_token
|
||||
new_dicton['lms_user_id'] = str(cur.lastrowid)
|
||||
new_dicton['lms_user_id'] = str(new_lms_user_id)
|
||||
new_dicton['mysy_pack'] = my_partner['pack_service']
|
||||
new_dicton['mysy_nb_formation'] = my_partner['nb_formation']
|
||||
|
||||
|
@ -243,7 +277,7 @@ def Create_MySy_LMS_User(diction):
|
|||
)
|
||||
|
||||
|
||||
return True, " Creation du compte LMS OK. l'id = "+str(lastrowid), str(lastrowid)
|
||||
return True, " Creation du compte LMS OK. l'id = "+str(new_lms_user_id), str(new_lms_user_id)
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
|
|
12
main.py
12
main.py
|
@ -1579,6 +1579,18 @@ def removeLSaccount():
|
|||
return jsonify(status=status, message=message)
|
||||
|
||||
|
||||
"""
|
||||
API de suppression du compte de Nicole"""
|
||||
@app.route('/myclass/api/removeNBaccount/', methods=['GET','POST'])
|
||||
@crossdomain(origin='*')
|
||||
def removeNBaccount():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = request.form.to_dict()
|
||||
print(" ### removeNBaccount payload = ", str(payload))
|
||||
status, message = mycommon.removeNBaccount()
|
||||
return jsonify(status=status, message=message)
|
||||
|
||||
|
||||
"""
|
||||
Pour des test, et seulement pour les test
|
||||
cette fonction permet de mettre les formation du user "ls"
|
||||
|
|
|
@ -187,12 +187,12 @@ def add_partner_account(diction):
|
|||
|
||||
ret_val = coll_name.insert_one(mydata)
|
||||
mail.send_partner_account_mail(ret_val.inserted_id, str(mydata['email']))
|
||||
return True, " Le partenaire a été créé"
|
||||
return True, "Le compte utilisateur a été correctement créé. Vous allez recevoir un email avec les informations de connexion."
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de créer le partenaire"
|
||||
return False, "Impossible de créer le compte utilisateur"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2272,6 +2272,23 @@ def removeLSaccount():
|
|||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False
|
||||
|
||||
"""
|
||||
Suppression du compte de Nicole"""
|
||||
def removeNBaccount():
|
||||
try:
|
||||
coll = MYSY_GV.dbname["partnair_account"]
|
||||
myquery = {"email": "nicole.beauchesne@hotmail.fr"}
|
||||
x = coll.delete_many(myquery)
|
||||
print(x.deleted_count, " documents deleted.")
|
||||
return True, str(x.deleted_count) + " documents deleted."
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction verifier si une url est une image.
|
||||
elle permet si besoin de verifier la taille de l'image
|
||||
|
|
Loading…
Reference in New Issue