diff --git a/GWMS.UI/Areas/Identity/Pages/Account/Login.cshtml.cs b/GWMS.UI/Areas/Identity/Pages/Account/Login.cshtml.cs index a321cc8..116a710 100644 --- a/GWMS.UI/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/GWMS.UI/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -81,16 +81,18 @@ namespace GWMS.UI.Areas.Identity.Pages.Account // verifico ruoli... if (user != null) { + bool needCreate = true; // Gestione salvataggio ruoli... SE VARIATO... var UserRoles = await _userManager.GetRolesAsync(user); if (UserRoles != null && UserRoles.Count > 0) { var oldRole = UserRoles.Where(x => x == ADMIN_ROLE).FirstOrDefault(); - if (oldRole == null) - { - // aggiungo a ruolo admin - await _userManager.AddToRoleAsync(user, ADMIN_ROLE); - } + needCreate = (oldRole == null); + } + if (needCreate) + { + // aggiungo a ruolo admin + await _userManager.AddToRoleAsync(user, ADMIN_ROLE); } } } @@ -101,7 +103,7 @@ namespace GWMS.UI.Areas.Identity.Pages.Account public async Task OnGetAsync(string returnUrl = null) { - CheckSuperAdmin(); + await CheckSuperAdmin(); if (!string.IsNullOrEmpty(ErrorMessage)) { ModelState.AddModelError(string.Empty, ErrorMessage); diff --git a/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml b/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml index d9b50ab..878acc0 100644 --- a/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml +++ b/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml @@ -9,7 +9,7 @@
-

Create a new account.

+

Creazione nuovo account.


@@ -27,41 +27,41 @@
- +
-
-
-

Use another service to register.

-
- @{ - if ((Model.ExternalLogins?.Count ?? 0) == 0) - { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { -
+ @*
+
+

Use another service to register.

+
+ @{ + if ((Model.ExternalLogins?.Count ?? 0) == 0) + {

- @foreach (var provider in Model.ExternalLogins) - { - - } + There are no external authentication services configured. See this article + for details on setting up this ASP.NET application to support logging in via external services.

- + } + else + { +
+
+

+ @foreach (var provider in Model.ExternalLogins) + { + + } +

+
+
+ } } - } -
-
+
+
*@
@section Scripts { -} +} \ No newline at end of file diff --git a/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml.cs b/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml.cs index 19d0077..99cb559 100644 --- a/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/GWMS.UI/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -83,8 +83,8 @@ namespace GWMS.UI.Areas.Identity.Pages.Account values: new { area = "Identity", userId = user.Id, code = code, returnUrl = returnUrl }, protocol: Request.Scheme); - await _emailSender.SendEmailAsync(Input.Email, "Confirm your email", - $"Please confirm your account by clicking here."); + await _emailSender.SendEmailAsync(Input.Email, "GWMS: Richiesta conferma email", + $"Prego cliccare sul seguente link per confermare l'account registrato con questa email."); if (_userManager.Options.SignIn.RequireConfirmedAccount) { diff --git a/GWMS.UI/Components/CmpTop.razor b/GWMS.UI/Components/CmpTop.razor index 30c172d..96bbcbb 100644 --- a/GWMS.UI/Components/CmpTop.razor +++ b/GWMS.UI/Components/CmpTop.razor @@ -7,13 +7,13 @@ @inject AuthenticationStateProvider AuthenticationStateProvider
-
+
-
+
@PageName
-
+
@if (ShowSearch) { diff --git a/GWMS.UI/Components/LoginDisplay.razor b/GWMS.UI/Components/LoginDisplay.razor index 0c00246..05992b2 100644 --- a/GWMS.UI/Components/LoginDisplay.razor +++ b/GWMS.UI/Components/LoginDisplay.razor @@ -4,26 +4,23 @@ -
+
- +
 @userName
-
- -
diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj index 8eb8580..8c4a1d9 100644 --- a/GWMS.UI/GWMS.UI.csproj +++ b/GWMS.UI/GWMS.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.0.2108.2516 + 1.0.2108.2517 95c9f021-52d1-4390-a670-5810b7b777b0 diff --git a/GWMS.UI/Pages/GasStation.razor.cs b/GWMS.UI/Pages/GasStation.razor.cs index 467926e..bd1ccce 100644 --- a/GWMS.UI/Pages/GasStation.razor.cs +++ b/GWMS.UI/Pages/GasStation.razor.cs @@ -1,16 +1,16 @@ using BlazorBarcodeScanner.ZXing.JS; -using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin, User")] public partial class GasStation : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/Orders.razor.cs b/GWMS.UI/Pages/Orders.razor.cs index af92b10..0027f74 100644 --- a/GWMS.UI/Pages/Orders.razor.cs +++ b/GWMS.UI/Pages/Orders.razor.cs @@ -1,6 +1,7 @@ using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; @@ -10,6 +11,7 @@ using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin, User")] public partial class Orders : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/PlantStatus.razor.cs b/GWMS.UI/Pages/PlantStatus.razor.cs index 86da83a..11b9be6 100644 --- a/GWMS.UI/Pages/PlantStatus.razor.cs +++ b/GWMS.UI/Pages/PlantStatus.razor.cs @@ -1,14 +1,15 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; +using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; -using GWMS.Data.DTO; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin")] public partial class PlantStatus : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/Suppliers.razor.cs b/GWMS.UI/Pages/Suppliers.razor.cs index e38b97c..262bf46 100644 --- a/GWMS.UI/Pages/Suppliers.razor.cs +++ b/GWMS.UI/Pages/Suppliers.razor.cs @@ -1,6 +1,7 @@ using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; @@ -10,6 +11,7 @@ using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin, User")] public partial class Suppliers : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/Transporters.razor.cs b/GWMS.UI/Pages/Transporters.razor.cs index 2e34be2..98c530b 100644 --- a/GWMS.UI/Pages/Transporters.razor.cs +++ b/GWMS.UI/Pages/Transporters.razor.cs @@ -1,6 +1,7 @@ using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; @@ -10,6 +11,7 @@ using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin, UserExt")] public partial class Transporters : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/UserManager.razor.cs b/GWMS.UI/Pages/UserManager.razor.cs index 68c67cb..8145322 100644 --- a/GWMS.UI/Pages/UserManager.razor.cs +++ b/GWMS.UI/Pages/UserManager.razor.cs @@ -2,6 +2,7 @@ using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; @@ -11,6 +12,7 @@ using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin, User")] public partial class UserManager : ComponentBase, IDisposable { #region Private Fields diff --git a/GWMS.UI/Pages/WeekPlan.razor.cs b/GWMS.UI/Pages/WeekPlan.razor.cs index a0cda85..f725ba1 100644 --- a/GWMS.UI/Pages/WeekPlan.razor.cs +++ b/GWMS.UI/Pages/WeekPlan.razor.cs @@ -2,6 +2,7 @@ using GWMS.Data.DatabaseModels; using GWMS.Data.DTO; using GWMS.UI.Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using System; @@ -11,6 +12,7 @@ using System.Threading.Tasks; namespace GWMS.UI.Pages { + [Authorize(Roles = "SuperAdmin, Admin")] public partial class WeekPlan : ComponentBase { #region Private Fields diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 32b3fe2..e6bb9a4 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GWMS - Gas Warehouse Management System -

Versione: 1.0.2108.2516

+

Versione: 1.0.2108.2517


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index f271afe..cee3401 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.0.2108.2516 +1.0.2108.2517 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index a88c935..0ce367e 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.0.2108.2516 + 1.0.2108.2517 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false