diff --git a/src/components/Account.js b/src/components/Account.js index 3defc3c..6873adf 100644 --- a/src/components/Account.js +++ b/src/components/Account.js @@ -19,7 +19,7 @@ import Header from "./Header"; import UpgradeToPro from "./UpgradeToPro" import Profil_Objectif from "./ProfilObjectif"; import { useLocation } from "react-router-dom"; - +import { FaHandPointRight } from "react-icons/fa"; import Intranet_Factures_Client from "./Intranet_Factures_Client"; import Intranet_Tous_Documents from "./Intranet_Tous_Documents"; import Modules_Mes_Documents from "./Modules_Mes_Documents"; @@ -85,6 +85,11 @@ function Account() { displayProfil_Objectif(); } + if (location && location.state && location.state.firstconnexion) { + setfirstConnexion(location.state.firstconnexion); + } + + }, []); @@ -126,6 +131,8 @@ function Account() { } + const [firstConnexion, setfirstConnexion] = useState(""); + function logout_confirmation() { /* si c'est une connexion partner qui est active */ @@ -201,6 +208,7 @@ function Account() { }; + const [connected_user_data, setconnected_user_data] = useState(); function GetUserNameFromToken(event) { @@ -212,15 +220,17 @@ function Account() { var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_user_account/"; axios.post(myurl, form).then(res => { + // console.log(" In GetUserNameFromToken res.data.status = " + res.data.status); + // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message); if (String(res.data.status) === String("true")) { - //console.log(" In GetUserNameFromToken res.data.status = " + res.data.status); - //console.log(" In GetUserNameFromToken res.data.message = " + res.data.message); + setusername(JSON.parse(res.data.message).email); if (JSON.parse(res.data.message).migrated && String(JSON.parse(res.data.message).migrated) === String("1")) { setmigratedaccount(String(JSON.parse(res.data.message).migrated)); } + setconnected_user_data(JSON.parse(res.data.message)); //setmyApiResponse("true"); @@ -236,7 +246,7 @@ function Account() { }).catch((error) => { - console.warn('In GetUserNameFromToken Not good man :( mysearchtext = '); + console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ', error); //setmyApiResponse("false"); //setmyApimyApiMessage("") }) @@ -443,6 +453,18 @@ function Account() {
+ + {String(firstConnexion) === "1" && +
+
+ Cher Utilisateur, c'est votre première connexion,
 
+ Nous sommes ravis de vous accueillir. Nous vous invitons à modifier votre mot de passe à partir du menu "MES INFORMATIONS" ==> Pavé "SECURITE" puis "MODIFIER"

+
+  
Merci. +
+ +
} + {String(myApiResponse) === String("true") &&
{result} diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index c5607de..7f25bb3 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -1060,7 +1060,7 @@ const AddClassManual = (props) => { //document.getElementsByName("objectif")[0].value = ""; //document.getElementsByName("programme")[0].value = ""; //document.getElementsByName("prerequis")[0].value = ""; - alert(" La formation a été correctement supprimée."); + // alert(" La formation a été correctement supprimée."); history.push({ pathname: "/Partner/", diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index 02ec5b1..a842cca 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -630,6 +630,9 @@ const AddParnerClient = (props) => { setformedit_mode_invoice("1"); } + setp_new_pwd(""); + setp_conf_new_login(""); + }, [props.client_mail,]); @@ -3112,6 +3115,8 @@ const AddParnerClient = (props) => { const [Dialog_mysy_intranet_account_open, setDialog_mysy_intranet_account_open] = React.useState(false); const Dialog_mysy_intranet_account_handleClose = () => { + setp_new_pwd(""); + setp_conf_new_login(""); setDialog_mysy_intranet_account_open(false) }; @@ -3134,13 +3139,13 @@ const AddParnerClient = (props) => { const handleClickShowPassword = () => { if (currentpawdvisible == false) { - document.getElementsByName("new_pwd")[0].type = "text"; - document.getElementsByName("conf_new_login")[0].type = "text"; + document.getElementsByName("new_pwd011")[0].type = "text"; + document.getElementsByName("conf_new_login011")[0].type = "text"; setcurrentpawdvisible(true); } else if (currentpawdvisible == true) { - document.getElementsByName("new_pwd")[0].type = "password"; - document.getElementsByName("conf_new_login")[0].type = "password"; + document.getElementsByName("new_pwd011")[0].type = "password"; + document.getElementsByName("conf_new_login011")[0].type = "password"; setcurrentpawdvisible(false); } }; @@ -3188,7 +3193,7 @@ const AddParnerClient = (props) => { if (p_client_intranet_account_id && String(p_client_intranet_account_id).length > 3) { // Il s'agit d'une mise à jour de mot de passe myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Pwd_Partner_Client_Intranet_Account/"; - // console.log(" ### mise à jour INTRANET "); + // console.log(" ### mise à jour INTRANET "); } else { console.log(" ### creation INTRANET "); @@ -3254,7 +3259,7 @@ const AddParnerClient = (props) => {
{/*** Affichage des messages d'alerte*/} - display_alert_mysy = {display_alert_mysy}
+ {display_alert_mysy && String(display_alert_mysy) === "1" && { { } } + inputProps={{ + autocomplete: 'new-password', + form: { + autocomplete: 'off', + }, + }} + />
@@ -3386,7 +3404,7 @@ const AddParnerClient = (props) => { } {!p_client_intranet_account_id || String(p_client_intranet_account_id).length <= 3 && - } + }
@@ -3955,17 +3973,27 @@ const AddParnerClient = (props) => { - +
diff --git a/src/components/Intranet_Mes_Stagiaires.js b/src/components/Intranet_Mes_Stagiaires.js index cc6e9a9..8d118b9 100644 --- a/src/components/Intranet_Mes_Stagiaires.js +++ b/src/components/Intranet_Mes_Stagiaires.js @@ -799,7 +799,7 @@ const Intranet_Mes_Stagiaires = (props) => { form.append("client_rattachement_id", props.partner_client_id); } - console.log(" ### Getall_TrainingParticipant form = ", form) + // console.log(" ### Getall_TrainingParticipant form = ", form) var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Statgaire_List_Partner_with_filter/"; diff --git a/src/components/Module_Connexion_Intranet_Client.js b/src/components/Module_Connexion_Intranet_Client.js index c7a2f29..b8cb7b8 100644 --- a/src/components/Module_Connexion_Intranet_Client.js +++ b/src/components/Module_Connexion_Intranet_Client.js @@ -89,14 +89,16 @@ function Module_Connexion_Intranet_Client() { var partner_connexion = ""; var url_login = ""; - - url_login = process.env.REACT_APP_API_URL + "myclass/api/login/"; setmenucompte("user"); partner_connexion = "user"; + // console.log( " ### full url_login = ", url_login) + + // Gestion des Cookies + const stored_partner = cookie_part.tokenmysypart; const stored_user = cookie.tokenmysych; const formData = new FormData(); @@ -119,6 +121,7 @@ function Module_Connexion_Intranet_Client() { + // si c'est une connexion user qui est active if (typeof (stored_user) != "undefined" && String(stored_user) !== String('')) { //alert(" c'est une connexion USERR qui est active"); @@ -139,56 +142,24 @@ function Module_Connexion_Intranet_Client() { var val = result['status']; if (String(val) === String("true")) { + setCookie("tokenmysych", result['message']); - if (String(partner_connexion) === String("partner")) { - - // recuperation et stockage des cookies sur les droit d'acces - setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' }); - - var acces_right_token_name = String(JSON.parse(result['message']).token) + "_uar"; - var acces_right_token_val = JSON.parse(result['message']).user_access_right; - - //acces_right_token_val = [{'key1':'val1'}, {'key2':'val2'}]; - - ///console.log(" acces_right_token_val = ", acces_right_token_val); - - setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' }); - - // recuperation et stockage des cookie sur les paramettres de connexion - var returned_connexion_data = JSON.parse(result['message']) - if (returned_connexion_data.list_connexion_context) { - - const new_data = returned_connexion_data.list_connexion_context.map((x) => { - // recuperation et stockage des cookies sur les droit d'acces - if (x['code'] && x['code_value']) { - setCookie(String(x['code']), String(x['code_value']), { path: '/' }); - - } - - - }); - - } - - //setCookie("tokenmysypart", result['message']); - history.push("/Partner"); - + // Verification vers quelle page les renvoyer + if (obj === "training" && String(objid).length > 0) { + // redirection vers l'affichage d'une formation + history.push("/Display-Detail-formation/" + objid); } - - else if (String(partner_connexion) === String("user")) { - setCookie("tokenmysych", result['message']); - - // Verification vers quelle page les renvoyer - if (obj === "training" && String(objid).length > 0) { - // redirection vers l'affichage d'une formation - history.push("/Display-Detail-formation/" + objid); - } - else { - // Redirection par defaut vers la compte utilisateur - history.push("/mysy-user-account"); - } + else { + // Redirection par defaut vers la compte utilisateur + history.push({ + pathname: "/mysy-user-account", + state: { + firstconnexion: String(result['firstconnexion']) + } + }); } } + else { setisconnected("false"); setmyApimyApiMessage(result['message']); @@ -202,6 +173,7 @@ function Module_Connexion_Intranet_Client() { }); } + const location = useLocation(); useEffect(() => { @@ -424,7 +396,7 @@ function Module_Connexion_Intranet_Client() {
- + @@ -434,7 +406,7 @@ function Module_Connexion_Intranet_Client() {
- +
{currentpawdvisible ? : } diff --git a/src/components/Mon_Intranet_Public.js b/src/components/Mon_Intranet_Public.js index ca3dcc7..fad9213 100644 --- a/src/components/Mon_Intranet_Public.js +++ b/src/components/Mon_Intranet_Public.js @@ -957,7 +957,7 @@ const Mon_Intranet_Public = (props) => { async function fetchData() { // const result = await axios('https://geolocation-db.com/json/',); - + /* setuserIp("172.71.122.128"); setcountry_code("FR"); diff --git a/src/components/Partner.js b/src/components/Partner.js index f15a271..be70a53 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -1766,7 +1766,7 @@ const Partner = (props) => { { /********* Fin Dialog redaction email */} - + {left_menu === true &&