Merge origin/master
Conflicts: src/java/com/test/forms/AuthentifForm.java web/WEB-INF/PompierJSP.jsp
This commit is contained in:
		| @@ -33,10 +33,10 @@ public class PompierMySql { | ||||
|     } | ||||
|      | ||||
|    /** | ||||
|      * Creation du client passé en paramètre dans la table client | ||||
|      * Creation du pompier passé en paramètre dans la table pompier | ||||
|      * Requête non préparée | ||||
|      * @param c objet de type Client (sans identifiant) | ||||
|      * @return int : id du client créé | ||||
|      * @param p objet de type Pompier (sans identifiant) | ||||
|      * @return int : id du Pompier créé | ||||
|      */ | ||||
|     public int create(Pompier p) { | ||||
|         int id = -1; | ||||
| @@ -76,10 +76,10 @@ public class PompierMySql { | ||||
|     } | ||||
|      | ||||
|       /** | ||||
|      * Creation du client passé en paramètre dans la table client | ||||
|      * Creation du pompier passé en paramètre dans la table pompier | ||||
|      * Requête préparée | ||||
|      * @param c objet de type Client (sans identifiant) | ||||
|      * @return int : id du client créé | ||||
|      * @param p objet de type Pompier (sans identifiant) | ||||
|      * @return int : id du pompier créé | ||||
|      */ | ||||
|     public int createRP(Pompier p) { | ||||
|         int id = -1; | ||||
|   | ||||
| @@ -11,11 +11,11 @@ import java.util.Objects; | ||||
|  * | ||||
|  * @author clementine.desrucques | ||||
|  */ | ||||
| public class User { | ||||
| public class UserP { | ||||
|     private String pseudo; | ||||
|     private String mdp; | ||||
| 
 | ||||
|     public User(String pseudo, String mdp) { | ||||
|     public UserP(String pseudo, String mdp) { | ||||
|         this.pseudo = pseudo; | ||||
|         this.mdp = mdp; | ||||
|     } | ||||
| @@ -55,7 +55,7 @@ public class User { | ||||
|         if (getClass() != obj.getClass()) { | ||||
|             return false; | ||||
|         } | ||||
|         final User other = (User) obj; | ||||
|         final UserP other = (UserP) obj; | ||||
|         if (!Objects.equals(this.pseudo, other.pseudo)) { | ||||
|             return false; | ||||
|         } | ||||
| @@ -64,5 +64,7 @@ public class User { | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|      | ||||
|      | ||||
| } | ||||
| @@ -6,7 +6,7 @@ | ||||
| package com.test.forms; | ||||
|  | ||||
| import com.test.beans.Pompier; | ||||
| import com.test.beans.User; | ||||
| import com.test.beans.UserP; | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| @@ -40,9 +40,14 @@ public class AuthentifForm { | ||||
|      */ | ||||
|      | ||||
|     public boolean controlerRole(HttpServletRequest request) { | ||||
|         Pompier p =  | ||||
|                  | ||||
|       | ||||
|         /*  Comparaison entre l'utilisateur admin et un utilisateur créé  | ||||
|             avec le pseudo et le mdp saisi */ | ||||
| //        UserP ChefCaserne = new UserP("Michel", "mRANN"); | ||||
|         UserP userSaisi = new UserP(  request.getParameter("ztPseudo"),  | ||||
|                                     request.getParameter("ztMDP")); | ||||
|         if(request.getParameter("ztPseudo").equals(request)){ | ||||
|         boolean isChef = userSaisi; | ||||
|         } | ||||
|         // Mise à jour de l'attribut resultat | ||||
|         setResultat(isChef ? "Vous êtes chef de caserne" : "Vous n'êtes pas chef de caserne"); | ||||
|          | ||||
|   | ||||
| @@ -48,6 +48,7 @@ | ||||
|                         <td><c:out value="${unPompier.getAdrCP()}"/></td> | ||||
|                         <td><c:out value="${unPompier.getAdrVille()}"/></td> | ||||
|                         <td><c:out value="${unPompier.getGrade()}"/></td> | ||||
|                         <td><c:out value="${unPompier.getCom()}"/></td> | ||||
|                     </tr>                               | ||||
|                 </c:forEach> | ||||
|                  | ||||
|   | ||||
| @@ -9,9 +9,10 @@ | ||||
| <html> | ||||
|     <head> | ||||
|         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||||
|         <title>JSP Page</title> | ||||
|         <title>Pompier</title> | ||||
|     </head> | ||||
|     <body> | ||||
|         <h1>PompierJSP</h1> | ||||
|         <h1>Hello World!</h1> | ||||
|         <a href="ModifPompier"><input type="button" name="btModifP" value="Modifier la fiche pompier"/></a> | ||||
|     </body> | ||||
| </html> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user