/// <summary> /// Reinitiliser un mot de passe oublié /// </summary> /// <returns>vrai si le changement à reusit</returns> /// private bool ValidationReset() { string user = StringNonVide(textBoxlogin, "Login"); string email = StringNonVide(textBoxPassword, "Email"); string passeProvisoirhash; Compte c; int matricule = -1; // DONE: Verifier si user et email sont presents dans la bd matricule = RequetesSQL.ChercherCompteSelonEmail(email); c = RequetesSQL.SQLChercherCompteAvecMatricule(matricule); if (matricule != -1) { if (c == null) { return(false); } } // Envoyer un email avec un mot de passe provisoire bool envoie = Utilitaires.sendResetMessage(textBoxPassword.Text, out passeProvisoirhash); if (envoie) { // DONE: ModifierLe hashDans la bd pour ce compte c.ModifierPasse(passeProvisoirhash); RequetesSQL.SupprimerCompte(c.Matricule.ToString()); RequetesSQL.AjouterCompte(c); MB.Avertir("un message vous est envoyé !"); } else { MB.Avertir("Un problème est survenu"); } return(envoie); }