From 01d6c19051f96aafab6487f109945ec31cbd3015 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Mon, 15 Jan 2024 12:36:30 +0100 Subject: [PATCH 01/12] maj --- .../utilisateurs/DatagridUtilisateurs.razor | 17 +++++++++++++---- .../authentification/FormulaireConnexion.razor | 2 +- .../FormulaireInscription.razor | 0 .../FormulaireInscription.razor.cs | 7 +++++++ .../authentification/modele/RequeteConnexion.cs | 2 +- .../modele/RequeteInscription.cs | 9 +++++++++ .../factories/UtilisateursFactory.cs | 11 +++++++++++ .../modele/authentification/AppUtilisateur.cs | 9 ++++++++- .../authentification/UtilisateurCourant.cs | 2 +- .../AuthentificationService.cs | 14 +++++++++----- .../authentificationService/DonneurEtat.cs | 4 ++-- 11 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor create mode 100644 VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index 6181c1f..929d2c5 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -19,17 +19,26 @@ - + + + + @if (context.IsBan) { + Ban + } else { + Valide + } + + + - + + - - diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor index bc6a6b0..cdef417 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor @@ -17,7 +17,7 @@ Pseudo - + diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor new file mode 100644 index 0000000..e69de29 diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs new file mode 100644 index 0000000..74d62f7 --- /dev/null +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs @@ -0,0 +1,7 @@ +namespace VeraxShield.composants.authentification +{ + public partial class FormulaireConnexion + { + + } +} \ No newline at end of file diff --git a/VeraxShield/VeraxShield/composants/authentification/modele/RequeteConnexion.cs b/VeraxShield/VeraxShield/composants/authentification/modele/RequeteConnexion.cs index ee522ca..47a7c8a 100644 --- a/VeraxShield/VeraxShield/composants/authentification/modele/RequeteConnexion.cs +++ b/VeraxShield/VeraxShield/composants/authentification/modele/RequeteConnexion.cs @@ -8,6 +8,6 @@ namespace VeraxShield.composants.formulaires.modeles public string MotDePasse { get; set; } [Required(ErrorMessage="le champ est obligatoire !")] - public string Nom { get; set; } + public string Pseudo { get; set; } } } diff --git a/VeraxShield/VeraxShield/composants/authentification/modele/RequeteInscription.cs b/VeraxShield/VeraxShield/composants/authentification/modele/RequeteInscription.cs index 0a80f0d..9d99d90 100644 --- a/VeraxShield/VeraxShield/composants/authentification/modele/RequeteInscription.cs +++ b/VeraxShield/VeraxShield/composants/authentification/modele/RequeteInscription.cs @@ -13,5 +13,14 @@ namespace VeraxShield.composants.formulaires.modeles [Required] public string Nom { get; set; } + + [Required] + public string Prenom {get; set;} + + [Required] + public string Pseudo { get; set; } + + [Required] + public string Mail { get; set;} } } diff --git a/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs b/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs index dc5b781..57537ba 100644 --- a/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs +++ b/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs @@ -32,5 +32,16 @@ namespace VeraxShield.factories return temp; } + + public static Utilisateur toUtilisateur(AppUtilisateur appUtilisateur) + { + return new Utilisateur(appUtilisateur.Pseudo, appUtilisateur.Nom, appUtilisateur.Prenom, + appUtilisateur.Roles[0], appUtilisateur.MotDePasse, appUtilisateur.Mail, false); + } + + public static AppUtilisateur toAppUtilisateur(Utilisateur u) + { + return new AppUtilisateur(u.Pseudo, u.Nom, u.Prenom, u.Mail, u.Mdp, u.Role); + } } } diff --git a/VeraxShield/VeraxShield/modele/authentification/AppUtilisateur.cs b/VeraxShield/VeraxShield/modele/authentification/AppUtilisateur.cs index 4da82d2..662f348 100644 --- a/VeraxShield/VeraxShield/modele/authentification/AppUtilisateur.cs +++ b/VeraxShield/VeraxShield/modele/authentification/AppUtilisateur.cs @@ -2,11 +2,18 @@ public class AppUtilisateur { public string MotDePasse { get; set; } public List Roles { get; set; } + public string Pseudo { get; set; } + public string Prenom { get; set; } public string Nom { get; set; } + public string Mail { get; set; } - public AppUtilisateur(string nom, string mdp, String premierRole) + + public AppUtilisateur(string pseudo,string nom, string prenom, string mail, string mdp, String premierRole) { this.MotDePasse = mdp; + this.Pseudo = pseudo; + this.Mail = mail; + this.Prenom = prenom; this.Nom = nom; this.Roles = new List(); diff --git a/VeraxShield/VeraxShield/modele/authentification/UtilisateurCourant.cs b/VeraxShield/VeraxShield/modele/authentification/UtilisateurCourant.cs index 9cb4e08..5a1dd43 100644 --- a/VeraxShield/VeraxShield/modele/authentification/UtilisateurCourant.cs +++ b/VeraxShield/VeraxShield/modele/authentification/UtilisateurCourant.cs @@ -2,5 +2,5 @@ public class UtilisateurCourant { public Dictionary Claims { get; set; } public bool EstAuthentifie { get; set; } - public string Nom { get; set; } + public string Pseudo { get; set; } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs index ea18e2f..ea4604e 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs @@ -1,22 +1,25 @@ using System.Security.Claims; using VeraxShield.composants.formulaires.modeles; +using VeraxShield.services.UtilisateursDataService; public class AuthentificationService : IAuthentificationService { private static readonly List utilisateursApplication; + private static IUtilisateursDataService _utilisateursDataService { get; set; } static AuthentificationService() { + utilisateursApplication = new List(); - utilisateursApplication.Add(new AppUtilisateur("Admin", "Admin", "admin")); + utilisateursApplication.Add(new AppUtilisateur("Admin", "Compte", "Admin", "compte@admin.fr", "Admin", "admin")); } public void Connexion(RequeteConnexion requete) { - var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Nom == requete.Nom && w.MotDePasse == requete.MotDePasse); + var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Pseudo == requete.Pseudo && w.MotDePasse == requete.MotDePasse); if (utilisateur == null) { @@ -26,7 +29,7 @@ public class AuthentificationService : IAuthentificationService public UtilisateurCourant GetUtilisateur(string nom) { - var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Nom == nom); + var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Pseudo == nom); if (utilisateur == null) { @@ -39,13 +42,14 @@ public class AuthentificationService : IAuthentificationService return new UtilisateurCourant { EstAuthentifie = true, - Nom = utilisateur.Nom, + Pseudo = utilisateur.Pseudo, Claims = claims.ToDictionary(c => c.Type, c => c.Value) }; } public void Inscription(RequeteInscription requete) { - utilisateursApplication.Add(new AppUtilisateur(requete.Nom, requete.MotDePasse, "invite" )); + utilisateursApplication.Add(new AppUtilisateur(requete.Pseudo, requete.Nom, requete.Prenom, + requete.Mail, requete.MotDePasse, "invite")); } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs index bb0af8a..e238d32 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs @@ -22,7 +22,7 @@ public class DonneurEtat : AuthenticationStateProvider if (userInfo.EstAuthentifie) { - var claims = new[] { new Claim(ClaimTypes.Name, this._utilisateurCourant.Nom) }.Concat(this._utilisateurCourant.Claims.Select(c => new Claim(c.Key, c.Value))); + var claims = new[] { new Claim(ClaimTypes.Name, this._utilisateurCourant.Pseudo) }.Concat(this._utilisateurCourant.Claims.Select(c => new Claim(c.Key, c.Value))); identite = new ClaimsIdentity(claims, "Server authentication"); } } @@ -49,7 +49,7 @@ public class DonneurEtat : AuthenticationStateProvider this._serviceAuthentification.Connexion(requete); // No error - Login the user - var user = this._serviceAuthentification.GetUtilisateur(requete.Nom); + var user = this._serviceAuthentification.GetUtilisateur(requete.Pseudo); this._utilisateurCourant = user; NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); From 9ebacf1d1eac7adcba16984587e5fc279679802a Mon Sep 17 00:00:00 2001 From: shcascarra Date: Mon, 15 Jan 2024 16:44:26 +0100 Subject: [PATCH 02/12] les beaux boutons --- .../utilisateurs/DatagridUtilisateurs.razor | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index 6181c1f..b3891c4 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -19,12 +19,25 @@ - + + + + @if (context.IsBan) + { + Ban + } else + { + Valide + } + + + + - + From 3d43957fb4a145726f86679303b707a75a26aea7 Mon Sep 17 00:00:00 2001 From: NoaSlld <102046195+NoaSlld@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:24:42 +0100 Subject: [PATCH 03/12] page index finie --- VeraxShield/VeraxShield/pages/Index.razor | 27 +++++++++++- VeraxShield/VeraxShield/pages/Index.razor.cs | 5 +++ VeraxShield/VeraxShield/wwwroot/css/index.css | 43 +++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 VeraxShield/VeraxShield/wwwroot/css/index.css diff --git a/VeraxShield/VeraxShield/pages/Index.razor b/VeraxShield/VeraxShield/pages/Index.razor index 389d7ef..db9be41 100644 --- a/VeraxShield/VeraxShield/pages/Index.razor +++ b/VeraxShield/VeraxShield/pages/Index.razor @@ -1,5 +1,6 @@ @page "/" + Liste des utilisateurs + -> Liste des utilisateurs + +--> + + + + + + + +
+

VeraxShield

+
+ +
+
+
+ +
+
+ +
+
+
+ \ No newline at end of file diff --git a/VeraxShield/VeraxShield/pages/Index.razor.cs b/VeraxShield/VeraxShield/pages/Index.razor.cs index 0ed27c7..b6fe570 100644 --- a/VeraxShield/VeraxShield/pages/Index.razor.cs +++ b/VeraxShield/VeraxShield/pages/Index.razor.cs @@ -19,5 +19,10 @@ namespace VeraxShield.pages { NavigationManager.NavigateTo("/connexion"); } + + private void RetourVerax() + { + NavigationManager.NavigateTo("https://www.verax.com"); + } } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/wwwroot/css/index.css b/VeraxShield/VeraxShield/wwwroot/css/index.css new file mode 100644 index 0000000..1ddfd7a --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/index.css @@ -0,0 +1,43 @@ +body { + background-color: #afc1db; + margin: 0; + padding: 0; + font-family: Arial, sans-serif; +} + +header { + color: #053679; + text-align: center; + padding: 10px; + margin: 0; +} + +main { + display: flex; + justify-content: center; + align-items: center; + height: 80vh; + margin-top:10vh; +} + +.center-box { + background-color: white; + padding: 20px; + text-align: center; + border-radius: 10px; +} + +.button-container { + margin-top: 10px; +} + +.btn-link { + color: white; + background-color: #053679; + margin: 5px; + padding: 10px; + border: none; + border-radius: 5px; + display: block; + cursor: pointer; +} From 67737369976cc42341838f7d83ab8f6642cdd5a2 Mon Sep 17 00:00:00 2001 From: NoaSlld <102046195+NoaSlld@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:41:58 +0100 Subject: [PATCH 04/12] =?UTF-8?q?page=20connect=C3=A9/non=20connect=C3=A9?= =?UTF-8?q?=20finie=20avec=20navbar=20temporaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VeraxShield/VeraxShield/pages/Index.razor | 65 +++++++++++++------ VeraxShield/VeraxShield/wwwroot/css/index.css | 30 ++++++++- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/VeraxShield/VeraxShield/pages/Index.razor b/VeraxShield/VeraxShield/pages/Index.razor index db9be41..3964ac9 100644 --- a/VeraxShield/VeraxShield/pages/Index.razor +++ b/VeraxShield/VeraxShield/pages/Index.razor @@ -17,24 +17,51 @@ --> - - - - -
-

VeraxShield

-
- -
-
-
- -
-
- -
-
-
- \ No newline at end of file + + + +
+

VeraxShield

+
+ +
+
+
+ +
+
+ +
+
+
+ +
+ + + +
+

VeraxShield

+
+ + + +
+
+

Adiu : @context.User.Identity.Name!

+

Podètz veire aquest contengut solament se sètz autentificat !

+
+
+ +
+ + + diff --git a/VeraxShield/VeraxShield/wwwroot/css/index.css b/VeraxShield/VeraxShield/wwwroot/css/index.css index 1ddfd7a..a5863c7 100644 --- a/VeraxShield/VeraxShield/wwwroot/css/index.css +++ b/VeraxShield/VeraxShield/wwwroot/css/index.css @@ -1,8 +1,13 @@ -body { +/*Not Authorized + --------------------------------------------------- +*/ + +body { background-color: #afc1db; margin: 0; padding: 0; font-family: Arial, sans-serif; + width: 100%; } header { @@ -10,6 +15,7 @@ header { text-align: center; padding: 10px; margin: 0; + background-color:white; } main { @@ -41,3 +47,25 @@ main { display: block; cursor: pointer; } + +/*Authorized + --------------------------------------------------- +*/ + +.navbar { + background-color: #053679; +} + +.btn-navbar { + color: white; + background-color: none; +} + +.home-center-box { + background-color: white; + padding: 40px; + text-align: center; + border-radius: 10px; + width: 80%; + +} From 7db64c33840001a3975fc877b7ec60d2cbc9cdd8 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Tue, 16 Jan 2024 14:20:03 +0100 Subject: [PATCH 05/12] maj --- .../utilisateurs/DatagridUtilisateurs.razor | 16 ++++++++++++++++ .../AuthentificationService.cs | 6 +----- .../authentificationService/DonneurEtat.cs | 10 +++++++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index 929d2c5..484a70c 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -28,6 +28,22 @@ Valide } + @* plan d'architecture + concepts mis en place + organisation / répartition + User case + simili de Gantt + + code propre (variables et fonctions compréhensibles) + fonctionnel + Authentification + Service factice + Service réel + Formulaire + Recupérer un élément, modif, supp... + + *@ +
diff --git a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs index ea4604e..e427fac 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs @@ -6,13 +6,9 @@ public class AuthentificationService : IAuthentificationService { private static readonly List utilisateursApplication; - private static IUtilisateursDataService _utilisateursDataService { get; set; } - - - + static AuthentificationService() { - utilisateursApplication = new List(); utilisateursApplication.Add(new AppUtilisateur("Admin", "Compte", "Admin", "compte@admin.fr", "Admin", "admin")); } diff --git a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs index e238d32..aa13258 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs @@ -1,14 +1,19 @@ using System.Security.Claims; using Microsoft.AspNetCore.Components.Authorization; using VeraxShield.composants.formulaires.modeles; +using VeraxShield.factories; +using VeraxShield.modele.utilisateurs; +using VeraxShield.services.UtilisateursDataService; public class DonneurEtat : AuthenticationStateProvider { private IAuthentificationService _serviceAuthentification; private UtilisateurCourant _utilisateurCourant; + private IUtilisateursDataService _utilisateursDataService; - public DonneurEtat(IAuthentificationService service) + public DonneurEtat(IAuthentificationService service, IUtilisateursDataService utilisateursDataService) { + this._utilisateursDataService = utilisateursDataService; this._serviceAuthentification = service; } @@ -69,6 +74,9 @@ public class DonneurEtat : AuthenticationStateProvider var user = this._serviceAuthentification.GetUtilisateur(requete.Nom); this._utilisateurCourant = user; + Utilisateur temp = UtilisateursFactory.toUtilisateur(user); + await this._utilisateursDataService.AjouterUtilisateur(temp); + NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } } \ No newline at end of file From 756740957409a796e021f4671495360ec7e2e282 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Tue, 16 Jan 2024 16:51:02 +0100 Subject: [PATCH 06/12] amelioration de authentification --- .../utilisateurs/DatagridUtilisateurs.razor | 16 -------- .../FormulaireConnexion.razor.cs | 1 + .../factories/UtilisateursFactory.cs | 10 ++--- .../AuthentificationService.cs | 37 ++++++++++++------- .../authentificationService/DonneurEtat.cs | 11 ++---- .../IAuthentificationService.cs | 6 +-- .../wwwroot/data/fakeUtilisateurs.json | 9 +++++ 7 files changed, 46 insertions(+), 44 deletions(-) diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index 484a70c..929d2c5 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -28,22 +28,6 @@ Valide } - @* plan d'architecture - concepts mis en place - organisation / répartition - User case - simili de Gantt - - code propre (variables et fonctions compréhensibles) - fonctionnel - Authentification - Service factice - Service réel - Formulaire - Recupérer un élément, modif, supp... - - *@ -
diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs index 9f16970..88d5d85 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs @@ -23,6 +23,7 @@ namespace VeraxShield.composants.authentification protected override async Task OnInitializedAsync() { this.Requete = new RequeteConnexion(); + await base.OnInitializedAsync(); } public async Task OnSubmit() diff --git a/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs b/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs index 57537ba..34c2cc2 100644 --- a/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs +++ b/VeraxShield/VeraxShield/factories/UtilisateursFactory.cs @@ -33,11 +33,11 @@ namespace VeraxShield.factories return temp; } - public static Utilisateur toUtilisateur(AppUtilisateur appUtilisateur) - { - return new Utilisateur(appUtilisateur.Pseudo, appUtilisateur.Nom, appUtilisateur.Prenom, - appUtilisateur.Roles[0], appUtilisateur.MotDePasse, appUtilisateur.Mail, false); - } + // public static Utilisateur toUtilisateur(UtilisateurCourant appUtilisateur) + // { + // return new Utilisateur(appUtilisateur.Pseudo, appUtilisateur.Nom, appUtilisateur.Prenom, + // appUtilisateur.Roles[0], appUtilisateur.MotDePasse, appUtilisateur.Mail, false); + // } public static AppUtilisateur toAppUtilisateur(Utilisateur u) { diff --git a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs index e427fac..01fed08 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs @@ -1,21 +1,24 @@ +using System.Linq; using System.Security.Claims; using VeraxShield.composants.formulaires.modeles; +using VeraxShield.modele.utilisateurs; using VeraxShield.services.UtilisateursDataService; public class AuthentificationService : IAuthentificationService { - - private static readonly List utilisateursApplication; + private List UtilisateursApplication {get; set;} + private IUtilisateursDataService _utilisateursDataService; - static AuthentificationService() + public AuthentificationService(IUtilisateursDataService utilisateursDataService) { - utilisateursApplication = new List(); - utilisateursApplication.Add(new AppUtilisateur("Admin", "Compte", "Admin", "compte@admin.fr", "Admin", "admin")); + this._utilisateursDataService = utilisateursDataService; + this.UtilisateursApplication = new List(); } - public void Connexion(RequeteConnexion requete) + public async Task Connexion(RequeteConnexion requete) { - var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Pseudo == requete.Pseudo && w.MotDePasse == requete.MotDePasse); + await this.MajUtilisateurs(); + var utilisateur = this.UtilisateursApplication.FirstOrDefault(w => w.Pseudo == requete.Pseudo && w.Mdp == requete.MotDePasse); if (utilisateur == null) { @@ -23,9 +26,10 @@ public class AuthentificationService : IAuthentificationService } } - public UtilisateurCourant GetUtilisateur(string nom) + public async Task GetUtilisateur(string pseudo) { - var utilisateur = utilisateursApplication.FirstOrDefault(w => w.Pseudo == nom); + await this.MajUtilisateurs(); + var utilisateur = this.UtilisateursApplication.FirstOrDefault(w => w.Pseudo == pseudo); if (utilisateur == null) { @@ -33,7 +37,7 @@ public class AuthentificationService : IAuthentificationService } var claims = new List(); - claims.AddRange(utilisateur.Roles.Select(s => new Claim(ClaimTypes.Role, s))); + claims.Add(new Claim(ClaimTypes.Role, utilisateur.Role)); return new UtilisateurCourant { @@ -43,9 +47,16 @@ public class AuthentificationService : IAuthentificationService }; } - public void Inscription(RequeteInscription requete) + public async Task Inscription(RequeteInscription requete) + { + await this._utilisateursDataService.AjouterUtilisateur(new Utilisateur(requete.Pseudo, requete.Nom, requete.Prenom, "invite", + requete.MotDePasse, requete.Mail, false)); + + await this.MajUtilisateurs(); + } + + public async Task MajUtilisateurs() { - utilisateursApplication.Add(new AppUtilisateur(requete.Pseudo, requete.Nom, requete.Prenom, - requete.Mail, requete.MotDePasse, "invite")); + this.UtilisateursApplication = await this._utilisateursDataService.getAllUtilisateurs(); } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs index aa13258..add3e28 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs @@ -51,10 +51,10 @@ public class DonneurEtat : AuthenticationStateProvider public async Task Connexion(RequeteConnexion requete) { - this._serviceAuthentification.Connexion(requete); + await this._serviceAuthentification.Connexion(requete); // No error - Login the user - var user = this._serviceAuthentification.GetUtilisateur(requete.Pseudo); + var user = await this._serviceAuthentification.GetUtilisateur(requete.Pseudo); this._utilisateurCourant = user; NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); @@ -68,15 +68,12 @@ public class DonneurEtat : AuthenticationStateProvider public async Task Inscription(RequeteInscription requete) { - this._serviceAuthentification.Inscription(requete); + await this._serviceAuthentification.Inscription(requete); // No error - Login the user - var user = this._serviceAuthentification.GetUtilisateur(requete.Nom); + var user = await this._serviceAuthentification.GetUtilisateur(requete.Nom); this._utilisateurCourant = user; - Utilisateur temp = UtilisateursFactory.toUtilisateur(user); - await this._utilisateursDataService.AjouterUtilisateur(temp); - NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/services/authentificationService/IAuthentificationService.cs b/VeraxShield/VeraxShield/services/authentificationService/IAuthentificationService.cs index 8fc7045..6665618 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/IAuthentificationService.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/IAuthentificationService.cs @@ -2,7 +2,7 @@ using VeraxShield.composants.formulaires.modeles; public interface IAuthentificationService { - public UtilisateurCourant GetUtilisateur(String nom); - public void Connexion(RequeteConnexion requete); - public void Inscription(RequeteInscription requete); + public Task GetUtilisateur(String nom); + public Task Connexion(RequeteConnexion requete); + public Task Inscription(RequeteInscription requete); } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/wwwroot/data/fakeUtilisateurs.json b/VeraxShield/VeraxShield/wwwroot/data/fakeUtilisateurs.json index 60a0225..1e3698a 100644 --- a/VeraxShield/VeraxShield/wwwroot/data/fakeUtilisateurs.json +++ b/VeraxShield/VeraxShield/wwwroot/data/fakeUtilisateurs.json @@ -17,6 +17,15 @@ "Mdp": "SecretPassword456", "IsBan": true }, + { + "Pseudo": "Admin", + "Mail": "Admin.admin@admin.com", + "Nom": "Admin", + "Prenom": "Admin", + "Role": "admin", + "Mdp": "Admin", + "IsBan": false + }, { "Pseudo": "alice_jones", "Mail": "alice.jones@example.com", From 585b91a7b6833c9cf1441384128b0a066230c593 Mon Sep 17 00:00:00 2001 From: NoaSlld <102046195+NoaSlld@users.noreply.github.com> Date: Tue, 16 Jan 2024 17:42:29 +0100 Subject: [PATCH 07/12] vue liste utilisateurs finie --- .../utilisateurs/DatagridUtilisateurs.razor | 40 ++++++++++--------- .../DatagridUtilisateurs.razor.cs | 5 +++ .../utilisateurs/ListeUtilisateurs.razor | 17 +++++++- .../utilisateurs/datagridUtilisateurs.css | 16 ++++++++ .../pages/utilisateurs/listeUtilisateurs.css | 27 +++++++++++++ 5 files changed, 85 insertions(+), 20 deletions(-) create mode 100644 VeraxShield/VeraxShield/wwwroot/css/composants/affichages/utilisateurs/datagridUtilisateurs.css create mode 100644 VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/listeUtilisateurs.css diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index b3891c4..8b2fcbb 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -2,6 +2,10 @@ @using Microsoft.AspNetCore.Components; @using VeraxShield.composants.modals; + + + + - + + @if (context.IsBan) @@ -33,11 +38,13 @@ + + - - + + @@ -45,18 +52,21 @@ - + @context.PageNumber - - - - - @context.TotalItems total items - @context.TotalItems - + + + + + @context.TotalItems utilisateurs + @context.TotalItems + + + + @@ -71,7 +81,7 @@ - @foreach (var curPageSize in context.PageSizes) { @curPageSize @@ -80,12 +90,6 @@ -
- - Ajouter - -
-
Utilisateurs de Verax + + + +

Utilisateurs de Verax

+

Vous retrouverez ici les utilisateurs de Verax ainsi que les actions associées

+
+ +
+ + + + - diff --git a/VeraxShield/VeraxShield/wwwroot/css/composants/affichages/utilisateurs/datagridUtilisateurs.css b/VeraxShield/VeraxShield/wwwroot/css/composants/affichages/utilisateurs/datagridUtilisateurs.css new file mode 100644 index 0000000..b35a74c --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/composants/affichages/utilisateurs/datagridUtilisateurs.css @@ -0,0 +1,16 @@ +.darkBlue { + color: #053679; +} + +.editButton { + background-color: #053679; + border: none; + color: white; +} + +.biggest{ + font-weight: bold; + font-size:120%; +} + + diff --git a/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/listeUtilisateurs.css b/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/listeUtilisateurs.css new file mode 100644 index 0000000..bd50371 --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/listeUtilisateurs.css @@ -0,0 +1,27 @@ +.h1{ + text-align:center; + margin: 50px; +} + +.margin10{ + margin: 10px; +} + +.center-box { + padding: 20px; + margin: 20px auto; + text-align: center; + border-radius: 10px; + background-color: #afc1db; + width: 80%; +} + +.dataGrid { + margin: 10px auto; + width: 80%; +} + +.btn:hover { + background-color: #afc1db; + color: #053679; +} \ No newline at end of file From cca3146dc16eb5eeb350aeb674f5a8fbafe6809e Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Tue, 16 Jan 2024 18:05:51 +0100 Subject: [PATCH 08/12] travail sur l'authenfication --- .../utilisateurs/DatagridUtilisateurs.razor | 1 - .../DatagridUtilisateurs.razor.cs | 8 +- .../FormulaireConnexion.razor | 2 +- .../FormulaireConnexion.razor.cs | 5 + .../FormulaireInscription.razor | 115 ++++++++++++++++++ .../FormulaireInscription.razor.cs | 38 +++++- .../pages/authentification/Inscription.razor | 14 +++ .../AuthentificationService.cs | 3 +- .../authentificationService/DonneurEtat.cs | 7 +- .../pages/authentification/Inscription.css | 20 +++ 10 files changed, 205 insertions(+), 8 deletions(-) create mode 100644 VeraxShield/VeraxShield/pages/authentification/Inscription.razor create mode 100644 VeraxShield/VeraxShield/wwwroot/css/pages/authentification/Inscription.css diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor index 929d2c5..f54963e 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor @@ -27,7 +27,6 @@ } else { Valide } -
diff --git a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor.cs b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor.cs index bf3996e..88235eb 100644 --- a/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor.cs +++ b/VeraxShield/VeraxShield/composants/affichages/utilisateurs/DatagridUtilisateurs.razor.cs @@ -17,6 +17,9 @@ namespace VeraxShield.composants.affichages.utilisateurs [Inject] private NavigationManager NavigationManager { get; set; } + [Inject] + private DonneurEtat DonneurEtat {get; set;} + private Utilisateur? utilisateurSelectionne; [Parameter] @@ -70,7 +73,10 @@ namespace VeraxShield.composants.affichages.utilisateurs public async Task onClickBoutonSuppression(String Pseudo) { this.utilisateurSelectionne = await this.utilisateursDataService.getUtilisateurFromPseudo(Pseudo); - await this.afficherModal(); + if (this.DonneurEtat._utilisateurCourant.Pseudo != this.utilisateurSelectionne.Pseudo) + { + await this.afficherModal(); + } } public async Task onClickBoutonModification(String Pseudo) diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor index cdef417..ef2a7cb 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor @@ -44,7 +44,7 @@
- +
diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs index 88d5d85..cc8805b 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor.cs @@ -41,5 +41,10 @@ namespace VeraxShield.composants.authentification } } } + + public async Task RedirectionInscription() + { + this.NavigationManager.NavigateTo("/inscription"); + } } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor index e69de29..ffe0663 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor @@ -0,0 +1,115 @@ +@using Blazorise.Components; +@using System.ComponentModel.DataAnnotations; + + + + + +
+ +

S'inscrire

+ + + + +
+ + + Pseudo + + + + + + + + + +
+ +
+ + + Prenom + + + + + + + + + +
+ +
+ + + Nom + + + + + + + + + +
+ +
+ + + Mail + + + + + + + + + +
+ +
+ + + Mot de passe + + + + + + + + + +
+ +
+ + + Confirmer le mot de passe + + + + + + + + + +
+ +
+ + +
+ + + + +
+ +
\ No newline at end of file diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs index 74d62f7..61bfe4d 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor.cs @@ -1,7 +1,43 @@ +using Blazorise; +using Microsoft.AspNetCore.Components; +using VeraxShield.composants.formulaires.modeles; + namespace VeraxShield.composants.authentification { - public partial class FormulaireConnexion + public partial class FormulaireInscription { + [Parameter] + public Validations Validations {get; set;} + + public RequeteInscription Requete {get; set;} + + [Inject] + private NavigationManager NavigationManager {get; set;} + + [Inject] + private DonneurEtat DonneurEtat {get; set;} + + public String Erreur {get; set; } + + protected override async Task OnInitializedAsync() + { + this.Requete = new RequeteInscription(); + await base.OnInitializedAsync(); + } + + public async Task OnSubmit() + { + if (await this.Validations.ValidateAll()) + { + await DonneurEtat.Inscription(this.Requete); + NavigationManager.NavigateTo("/connexion"); + } + } + + public async Task OnAnnulation() + { + this.NavigationManager.NavigateTo("/connexion"); + } } } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/pages/authentification/Inscription.razor b/VeraxShield/VeraxShield/pages/authentification/Inscription.razor new file mode 100644 index 0000000..f975387 --- /dev/null +++ b/VeraxShield/VeraxShield/pages/authentification/Inscription.razor @@ -0,0 +1,14 @@ +@using VeraxShield.composants.authentification; + +@page "/inscription" + + + + + +
+ +
+ +
+
\ No newline at end of file diff --git a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs index 01fed08..5dcae23 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/AuthentificationService.cs @@ -11,6 +11,7 @@ public class AuthentificationService : IAuthentificationService public AuthentificationService(IUtilisateursDataService utilisateursDataService) { + Console.WriteLine("Passage dans le constructeur !"); this._utilisateursDataService = utilisateursDataService; this.UtilisateursApplication = new List(); } @@ -52,7 +53,7 @@ public class AuthentificationService : IAuthentificationService await this._utilisateursDataService.AjouterUtilisateur(new Utilisateur(requete.Pseudo, requete.Nom, requete.Prenom, "invite", requete.MotDePasse, requete.Mail, false)); - await this.MajUtilisateurs(); + await this.MajUtilisateurs(); } public async Task MajUtilisateurs() diff --git a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs index add3e28..2e8b302 100644 --- a/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs +++ b/VeraxShield/VeraxShield/services/authentificationService/DonneurEtat.cs @@ -8,7 +8,7 @@ using VeraxShield.services.UtilisateursDataService; public class DonneurEtat : AuthenticationStateProvider { private IAuthentificationService _serviceAuthentification; - private UtilisateurCourant _utilisateurCourant; + public UtilisateurCourant _utilisateurCourant; private IUtilisateursDataService _utilisateursDataService; public DonneurEtat(IAuthentificationService service, IUtilisateursDataService utilisateursDataService) @@ -71,9 +71,10 @@ public class DonneurEtat : AuthenticationStateProvider await this._serviceAuthentification.Inscription(requete); // No error - Login the user - var user = await this._serviceAuthentification.GetUtilisateur(requete.Nom); - this._utilisateurCourant = user; + // var user = await this._serviceAuthentification.GetUtilisateur(requete.Nom); + // this._utilisateurCourant = user; NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } + } \ No newline at end of file diff --git a/VeraxShield/VeraxShield/wwwroot/css/pages/authentification/Inscription.css b/VeraxShield/VeraxShield/wwwroot/css/pages/authentification/Inscription.css new file mode 100644 index 0000000..bf0bef1 --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/pages/authentification/Inscription.css @@ -0,0 +1,20 @@ +.centrer-composant { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.formulaire-inscription { + width: 53%; + /* border: 2px solid black; + border-radius: 10px; */ + /* padding: 20px; */ +} + +body { + background-image: url('/ressources/images/fondPages/fondConnexion.webp'); + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} \ No newline at end of file From 2c29b4d6de6eb368e821280973d4df91a4235215 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Tue, 16 Jan 2024 18:19:04 +0100 Subject: [PATCH 09/12] mise au propre du formulaire --- .../authentification/FormulaireInscription.razor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor index ffe0663..31810f4 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor @@ -32,7 +32,7 @@ Prenom - + @@ -47,7 +47,7 @@ Nom - + @@ -62,7 +62,7 @@ Mail - + @@ -92,7 +92,7 @@ Confirmer le mot de passe - + From eefcb7e18ca87bf9b82439184b12b784ffc95237 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Tue, 16 Jan 2024 19:21:37 +0100 Subject: [PATCH 10/12] travail sur le design --- VeraxShield/VeraxShield/App.razor | 5 ++--- .../authentification/FormulaireConnexion.razor | 9 +++++++-- .../FormulaireInscription.razor | 8 ++++++-- VeraxShield/VeraxShield/pages/Index.razor | 4 +++- .../pages/erreurs/ErreurParDefaut.razor | 17 +++++++++++++++++ .../pages/utilisateurs/ListeUtilisateurs.razor | 4 ++-- .../utilisateurs/ModifierUtilisateur.razor | 12 ++++++++++++ .../authentification/FormulaireConnexion.css | 2 ++ .../css/pages/erreurs/ErreurParDefaut.css | 4 ++++ .../pages/utilisateurs/ModifierUtilisateur.css | 9 +++++++++ 10 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 VeraxShield/VeraxShield/pages/erreurs/ErreurParDefaut.razor create mode 100644 VeraxShield/VeraxShield/wwwroot/css/pages/erreurs/ErreurParDefaut.css create mode 100644 VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/ModifierUtilisateur.css diff --git a/VeraxShield/VeraxShield/App.razor b/VeraxShield/VeraxShield/App.razor index 48e4e6f..225e0c2 100644 --- a/VeraxShield/VeraxShield/App.razor +++ b/VeraxShield/VeraxShield/App.razor @@ -4,9 +4,8 @@ - -

Sorry, there's nothing at this address.

-
+ +
diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor index ef2a7cb..819e580 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireConnexion.razor @@ -43,8 +43,13 @@
- - + + +
diff --git a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor index 31810f4..744d900 100644 --- a/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor +++ b/VeraxShield/VeraxShield/composants/authentification/FormulaireInscription.razor @@ -103,8 +103,12 @@
- - + +
diff --git a/VeraxShield/VeraxShield/pages/Index.razor b/VeraxShield/VeraxShield/pages/Index.razor index 3964ac9..916a44a 100644 --- a/VeraxShield/VeraxShield/pages/Index.razor +++ b/VeraxShield/VeraxShield/pages/Index.razor @@ -34,7 +34,9 @@
- +
diff --git a/VeraxShield/VeraxShield/pages/erreurs/ErreurParDefaut.razor b/VeraxShield/VeraxShield/pages/erreurs/ErreurParDefaut.razor new file mode 100644 index 0000000..35207d7 --- /dev/null +++ b/VeraxShield/VeraxShield/pages/erreurs/ErreurParDefaut.razor @@ -0,0 +1,17 @@ + + + + +
+
+ + 500 + + + Error intern dau servidor. + + + Aquesta pagina existís pas + +
+
\ No newline at end of file diff --git a/VeraxShield/VeraxShield/pages/utilisateurs/ListeUtilisateurs.razor b/VeraxShield/VeraxShield/pages/utilisateurs/ListeUtilisateurs.razor index 9cc8e48..5806529 100644 --- a/VeraxShield/VeraxShield/pages/utilisateurs/ListeUtilisateurs.razor +++ b/VeraxShield/VeraxShield/pages/utilisateurs/ListeUtilisateurs.razor @@ -6,9 +6,9 @@ - -

Utilisateurs de Verax

Vous retrouverez ici les utilisateurs de Verax ainsi que les actions associées

diff --git a/VeraxShield/VeraxShield/pages/utilisateurs/ModifierUtilisateur.razor b/VeraxShield/VeraxShield/pages/utilisateurs/ModifierUtilisateur.razor index 3f03520..0ec628f 100644 --- a/VeraxShield/VeraxShield/pages/utilisateurs/ModifierUtilisateur.razor +++ b/VeraxShield/VeraxShield/pages/utilisateurs/ModifierUtilisateur.razor @@ -2,5 +2,17 @@

Modifier l'utilisateur

+ + + + +
+ + + + +
+ + diff --git a/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css b/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css index e206d57..1eeaf24 100644 --- a/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css +++ b/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css @@ -5,6 +5,8 @@ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Ajoute une ombre légère */ } + + .field-container { margin-bottom: 15px; } diff --git a/VeraxShield/VeraxShield/wwwroot/css/pages/erreurs/ErreurParDefaut.css b/VeraxShield/VeraxShield/wwwroot/css/pages/erreurs/ErreurParDefaut.css new file mode 100644 index 0000000..3cf288b --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/pages/erreurs/ErreurParDefaut.css @@ -0,0 +1,4 @@ +/* body { + background-color: #8BC6EC; + background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%); +} */ \ No newline at end of file diff --git a/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/ModifierUtilisateur.css b/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/ModifierUtilisateur.css new file mode 100644 index 0000000..09b6945 --- /dev/null +++ b/VeraxShield/VeraxShield/wwwroot/css/pages/utilisateurs/ModifierUtilisateur.css @@ -0,0 +1,9 @@ +.test { + /* background-color: white; */ + background-color: #8EC5FC; + background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%); + + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Ajoute une ombre légère */ +} \ No newline at end of file From eb5e96ff3935c117fda1769b6c6dc75a4270612c Mon Sep 17 00:00:00 2001 From: NoaSlld <102046195+NoaSlld@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:15:49 +0100 Subject: [PATCH 11/12] uniformisation des boutons --- .../authentification/FormulaireConnexion.css | 14 +++++++++----- VeraxShield/VeraxShield/wwwroot/css/index.css | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css b/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css index 1eeaf24..e8edfff 100644 --- a/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css +++ b/VeraxShield/VeraxShield/wwwroot/css/composants/authentification/FormulaireConnexion.css @@ -33,11 +33,15 @@ } .btn-se-connecter { - background-color: darkblue; + background-color: #053679; color: white; } + .btn-se-connecter:hover, .btn-s-inscrire:hover { + background-color: #afc1db; + color: #053679; + } -.btn-s-inscrire { - background-color: grey; - color: white; -} + .btn-s-inscrire { + background-color: grey; + color: white; + } diff --git a/VeraxShield/VeraxShield/wwwroot/css/index.css b/VeraxShield/VeraxShield/wwwroot/css/index.css index a5863c7..23d3ff4 100644 --- a/VeraxShield/VeraxShield/wwwroot/css/index.css +++ b/VeraxShield/VeraxShield/wwwroot/css/index.css @@ -48,11 +48,17 @@ main { cursor: pointer; } -/*Authorized + .btn-link:hover { + background-color: #afc1db; + color: #053679; + } + + + /*Authorized --------------------------------------------------- */ -.navbar { + .navbar { background-color: #053679; } @@ -61,6 +67,10 @@ main { background-color: none; } + .btn-navbar:hover { + color: #afc1db; + } + .home-center-box { background-color: white; padding: 40px; From e6d1d0d82d8f9e344ee33f597138e28423d06489 Mon Sep 17 00:00:00 2001 From: NoaSlld <102046195+NoaSlld@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:44:42 +0100 Subject: [PATCH 12/12] update page index --- VeraxShield/VeraxShield/pages/Index.razor | 8 +++++--- VeraxShield/VeraxShield/wwwroot/css/index.css | 17 ++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/VeraxShield/VeraxShield/pages/Index.razor b/VeraxShield/VeraxShield/pages/Index.razor index 916a44a..65ade79 100644 --- a/VeraxShield/VeraxShield/pages/Index.razor +++ b/VeraxShield/VeraxShield/pages/Index.razor @@ -19,7 +19,7 @@ - @@ -40,6 +40,9 @@
+ @@ -65,5 +68,4 @@ - - + \ No newline at end of file diff --git a/VeraxShield/VeraxShield/wwwroot/css/index.css b/VeraxShield/VeraxShield/wwwroot/css/index.css index 23d3ff4..f86e667 100644 --- a/VeraxShield/VeraxShield/wwwroot/css/index.css +++ b/VeraxShield/VeraxShield/wwwroot/css/index.css @@ -3,7 +3,7 @@ */ body { - background-color: #afc1db; + background-color: white; margin: 0; padding: 0; font-family: Arial, sans-serif; @@ -15,7 +15,7 @@ header { text-align: center; padding: 10px; margin: 0; - background-color:white; + background-color: #afc1db; } main { @@ -27,7 +27,7 @@ main { } .center-box { - background-color: white; + background-color: #afc1db; padding: 20px; text-align: center; border-radius: 10px; @@ -35,6 +35,9 @@ main { .button-container { margin-top: 10px; + display: flex; + justify-content: center; + align-items: center; } .btn-link { @@ -46,14 +49,14 @@ main { border-radius: 5px; display: block; cursor: pointer; + width:100%; } .btn-link:hover { - background-color: #afc1db; + background-color: white; color: #053679; } - /*Authorized --------------------------------------------------- */ @@ -72,10 +75,10 @@ main { } .home-center-box { - background-color: white; + background-color: #afc1db; padding: 40px; text-align: center; border-radius: 10px; width: 80%; - } +