diff --git a/Blazor/Blazor/Modals/DeleteConfirmation.razor b/Blazor/Blazor/Modals/DeleteConfirmation.razor
index 959fbda..3eab751 100644
--- a/Blazor/Blazor/Modals/DeleteConfirmation.razor
+++ b/Blazor/Blazor/Modals/DeleteConfirmation.razor
@@ -3,7 +3,7 @@
- Are you sure you want to delete @chapter.Name ?
+ Are you sure you want to delete ?
diff --git a/Blazor/Blazor/Modals/DeleteConfirmation.razor.cs b/Blazor/Blazor/Modals/DeleteConfirmation.razor.cs
index bf38444..0e79b81 100644
--- a/Blazor/Blazor/Modals/DeleteConfirmation.razor.cs
+++ b/Blazor/Blazor/Modals/DeleteConfirmation.razor.cs
@@ -17,13 +17,13 @@ namespace Blazor.Modals
[Parameter]
public int Id { get; set; }
- private Chapter chapter = new Chapter();
+ //private Chapter chapter = new Chapter();
- protected override async Task OnInitializedAsync()
- {
- // Get the chapter
- chapter = await DataService.GetById(Id);
- }
+ //protected override async Task OnInitializedAsync()
+ //{
+ // // Get the chapter
+ // chapter = await DataService.GetById(Id);
+ //}
void ConfirmDelete()
{
diff --git a/Blazor/Blazor/Models/PlayerModel.cs b/Blazor/Blazor/Models/PlayerModel.cs
index fef9ba3..43c37a0 100644
--- a/Blazor/Blazor/Models/PlayerModel.cs
+++ b/Blazor/Blazor/Models/PlayerModel.cs
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using System.Security.Cryptography;
+using System.Text;
namespace Blazor.Models;
@@ -8,4 +9,21 @@ public class PlayerModel
public int Id { get; set; }
public string Nickname { get; set; }
public string HashedPassword { get; set; }
+
+ public void HashPassword(string password)
+ {
+ using (MD5 md5 = MD5.Create())
+ {
+ byte[] inputBytes = Encoding.UTF8.GetBytes(password);
+ byte[] hashBytes = md5.ComputeHash(inputBytes);
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < hashBytes.Length; i++)
+ {
+ sb.Append(hashBytes[i].ToString("x2"));
+ }
+
+ HashedPassword = sb.ToString();
+ }
+ }
}
diff --git a/Blazor/Blazor/Models/QuestionModel.cs b/Blazor/Blazor/Models/QuestionModel.cs
index b4a0b22..ecdc5df 100644
--- a/Blazor/Blazor/Models/QuestionModel.cs
+++ b/Blazor/Blazor/Models/QuestionModel.cs
@@ -2,22 +2,13 @@
public class QuestionModel
{
- public int Id { get; private set; }
+ public int Id { get; set; }
public string Content { get; set; }
- public int IdChapter { get; private set; }
+ public int IdChapter { get; set; }
public int? IdAnswerGood { get; set; }
public int Difficulty { get; set; }
- public int NbFails { get; private set; }
+ public int NbFails { get; set; }
- public QuestionModel(int id, string content, int idChapter, int difficulty, int nbFails, int? idAnswerGood = null)
- {
- Id = id;
- Content = content;
- IdChapter = idChapter;
- Difficulty = difficulty;
- NbFails = nbFails;
- IdAnswerGood = idAnswerGood;
- }
public void addFails(int nb) { NbFails += nb; }
public void removeFails(int nb) { NbFails -= nb; }
diff --git a/Blazor/Blazor/Pages/Admins/AddAdministrator.razor b/Blazor/Blazor/Pages/Admins/AddAdministrator.razor
index 5a940e3..b198619 100644
--- a/Blazor/Blazor/Pages/Admins/AddAdministrator.razor
+++ b/Blazor/Blazor/Pages/Admins/AddAdministrator.razor
@@ -12,6 +12,8 @@
Username:
+
+