Merge origin/master
Conflicts: web/WEB-INF/AuthentificationJSP.jsp
This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
package bdd;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Connexion.java
 | 
			
		||||
Classe permettant d'établir une connexion avec une base de données mySQL
 | 
			
		||||
@@ -7,10 +8,12 @@ import java.sql.Connection;
 | 
			
		||||
import java.sql.DriverManager;
 | 
			
		||||
 | 
			
		||||
public class Connexion {
 | 
			
		||||
 | 
			
		||||
    private static Connection connect;      // Variable de connexion
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Constructeur
 | 
			
		||||
     *
 | 
			
		||||
     * @param serveur nom du serveur, localhost si local
 | 
			
		||||
     * @param bdd nom de la base de données
 | 
			
		||||
     * @param nomUtil nom utilisateur
 | 
			
		||||
@@ -44,7 +47,9 @@ public class Connexion {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Retourne la connection établie (Création d'une connection si elle n'existe pas)
 | 
			
		||||
     * Retourne la connection établie (Création d'une connection si elle
 | 
			
		||||
     * n'existe pas)
 | 
			
		||||
     *
 | 
			
		||||
     * @param serveur nom du serveur, localhost si local
 | 
			
		||||
     * @param bdd nom de la base de données
 | 
			
		||||
     * @param nomUtil nom utilisateur
 | 
			
		||||
 
 | 
			
		||||
@@ -23,8 +23,7 @@ public class PompierMysql {
 | 
			
		||||
    private Connection theConnection;
 | 
			
		||||
    private Pompier unPompier;
 | 
			
		||||
 | 
			
		||||
    public PompierMysql()
 | 
			
		||||
    {
 | 
			
		||||
    public PompierMysql() {
 | 
			
		||||
        theConnection = Connexion.getConnect("localhost", "sdis29", "admin", "minda");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -68,8 +67,9 @@ public class PompierMysql {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creation du client passé en paramètre dans la table client
 | 
			
		||||
     * Requête non préparée
 | 
			
		||||
     * Creation du client passé en paramètre dans la table client Requête non
 | 
			
		||||
     * préparée
 | 
			
		||||
     *
 | 
			
		||||
     * @param c objet de type Client (sans identifiant)
 | 
			
		||||
     * @return int : id du client créé
 | 
			
		||||
     */
 | 
			
		||||
@@ -111,8 +111,9 @@ public class PompierMysql {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creation du client passé en paramètre dans la table client
 | 
			
		||||
     * Requête préparée
 | 
			
		||||
     * Creation du client passé en paramètre dans la table client Requête
 | 
			
		||||
     * préparée
 | 
			
		||||
     *
 | 
			
		||||
     * @param c objet de type Client (sans identifiant)
 | 
			
		||||
     * @return int : id du client créé
 | 
			
		||||
     */
 | 
			
		||||
@@ -140,7 +141,6 @@ public class PompierMysql {
 | 
			
		||||
            System.out.println("Requête : " + stmt.toString());
 | 
			
		||||
            int status = stmt.executeUpdate();
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            // Recherche de l'identifiant du client créé            
 | 
			
		||||
            if (status > 0) {
 | 
			
		||||
                ResultSet result = stmt.getGeneratedKeys();
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,7 @@ import java.util.Objects;
 | 
			
		||||
 * @author thomas.millot
 | 
			
		||||
 */
 | 
			
		||||
public class Pompier {
 | 
			
		||||
 | 
			
		||||
    private int id;
 | 
			
		||||
    private int idCaserne;
 | 
			
		||||
    private String nom;
 | 
			
		||||
@@ -302,5 +303,4 @@ public class Pompier {
 | 
			
		||||
        return "Pompier{" + "id=" + id + ", idCaserne=" + idCaserne + ", nom=" + nom + ", prenom=" + prenom + ", Statut=" + Statut + ", typePers=" + typePers + ", mail=" + mail + ", login=" + login + ", mdp=" + mdp + ", adresse=" + adresse + ", cp=" + cp + ", ville=" + ville + ", bip=" + bip + ", nbGardes=" + nbGardes + ", grade=" + grade + ", commentaire=" + commentaire + ", dateEnreg=" + dateEnreg + ", dateModif=" + dateModif + '}';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,11 +6,13 @@
 | 
			
		||||
package com.test.beans;
 | 
			
		||||
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author thomas.millot
 | 
			
		||||
 */
 | 
			
		||||
public class User {
 | 
			
		||||
 | 
			
		||||
    private String pseudo;
 | 
			
		||||
    private String mdp;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,5 +39,4 @@ public class AuthentifForm {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,12 @@ public class ProfilServlet extends HttpServlet {
 | 
			
		||||
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
 | 
			
		||||
            throws ServletException, IOException {
 | 
			
		||||
        response.setContentType("text/html;charset=UTF-8");
 | 
			
		||||
        try ( PrintWriter out = response.getWriter()) {
 | 
			
		||||
            /* TODO output your page here. You may use following sample code. */
 | 
			
		||||
        try ( PrintWriter out = response.getWriter()) 
 | 
			
		||||
        {
 | 
			
		||||
            out.println("<!DOCTYPE html>");
 | 
			
		||||
            out.println("<html>");
 | 
			
		||||
            out.println("<head>");
 | 
			
		||||
            out.println("<title>Servlet ProfilServlet</title>");            
 | 
			
		||||
            out.println("<title>Servlet Profil</title>");
 | 
			
		||||
            out.println("</head>");
 | 
			
		||||
            out.println("<body>");
 | 
			
		||||
            out.println("<h1>Servlet ProfilServlet at " + request.getContextPath() + "</h1>");
 | 
			
		||||
@@ -70,7 +70,8 @@ public class ProfilServlet extends HttpServlet {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
 | 
			
		||||
            throws ServletException, IOException {
 | 
			
		||||
            throws ServletException, IOException 
 | 
			
		||||
    {
 | 
			
		||||
        processRequest(request, response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,9 @@
 | 
			
		||||
<%@include file="jspf/enteteJSPF.jspf" %>
 | 
			
		||||
<div id="contenu">
 | 
			
		||||
    <h2>Merci de vous identifier pour acceder aux dossiers</h2>
 | 
			
		||||
	<form name="frmIdentification" method="POST" action="">    
 | 
			
		||||
    <form name="frmIdentification" method="POST" action="Profil">  
 | 
			
		||||
        <c:choose>
 | 
			
		||||
            <c:when test="${empty param.ztPseudo}">
 | 
			
		||||
                <fieldset><legend>Identification utilisateur</legend>
 | 
			
		||||
                    <br /><br />
 | 
			
		||||
                    <label for="nom">Nom du compte</label>
 | 
			
		||||
@@ -20,8 +22,15 @@
 | 
			
		||||
                    <input type="reset" 	name="annuler" 		value="Annuler">
 | 
			
		||||
                    </p>
 | 
			
		||||
                </fieldset>
 | 
			
		||||
            </c:when>  
 | 
			
		||||
            <c:otherwise>
 | 
			
		||||
                <!--    Si l'utilisateur s'est authentifi<66>,
 | 
			
		||||
                 Affichage du message contenu dans l'objet controlForm de type AuthentifForm -->
 | 
			
		||||
                <p>${controlForm.getResultat()}</p>
 | 
			
		||||
            </c:otherwise>
 | 
			
		||||
        </c:choose>
 | 
			
		||||
    </form>
 | 
			
		||||
    <br /><br/>
 | 
			
		||||
    
 | 
			
		||||
</div>
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,20 +6,4 @@
 | 
			
		||||
<%@include file="jspf/enteteJSPF.jspf" %>
 | 
			
		||||
<div id="contenu">
 | 
			
		||||
      <h2>Merci de vous identifier pour acceder aux dossiers</h2>
 | 
			
		||||
	<form name="frmIdentification" method="POST" action="Profil">    
 | 
			
		||||
        <fieldset><legend>Identification utilisateur</legend>
 | 
			
		||||
            <br /><br />
 | 
			
		||||
               <label for="nom">Nom du compte</label>
 | 
			
		||||
               <input id="login" 	type="text" 	name="login"  size="30" maxlength="45" 	placeholder="Entrez votre nom d'Utilisateur">
 | 
			
		||||
            </p>
 | 
			
		||||
            <p>
 | 
			
		||||
                <label for="mdp">Mot de passe</label>
 | 
			
		||||
                <input id="mdp" 	type="password"  name="mdp" size="30" 	maxlength="45" 	placeholder="Entrez votre Mot de Passe">
 | 
			
		||||
            </p><br /><br />
 | 
			
		||||
                <input type="submit" 	name="valider"		value="Valider">
 | 
			
		||||
                <input type="reset" 	name="annuler" 		value="Annuler">
 | 
			
		||||
            </p>
 | 
			
		||||
        </fieldset>
 | 
			
		||||
	</form>
 | 
			
		||||
    <br /><br />
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user