diff --git a/Egw.Core/licenseManGLS.cs b/Egw.Core/licenseManGLS.cs index 616ba977..fccea72c 100644 --- a/Egw.Core/licenseManGLS.cs +++ b/Egw.Core/licenseManGLS.cs @@ -30,7 +30,14 @@ namespace Egw.Core { string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo); plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase! - answ = Convert.ToDateTime(plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), "")); + string datePart = plainAuthKey.Replace($"{cliente}#{applicativo.PadLeft(20, '-')}-", "").Replace($"%{licenze}%", ""); + //string datePart = plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), ""); + // se non avesse "bonificato" la parte num licenze (es non corrisponde al max) forzo il trim + if (datePart.Contains("%")) + { + datePart = datePart.Substring(0, datePart.IndexOf("%")); + } + answ = Convert.ToDateTime(datePart); } catch (Exception exc) { diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index 685e408b..9fedb20e 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net6.0 MP.Land - 6.15.2207.0510 + 6.15.2207.0610 diff --git a/MP.Land/Pages/About.razor.cs b/MP.Land/Pages/About.razor.cs index 523620b5..ef15468e 100644 --- a/MP.Land/Pages/About.razor.cs +++ b/MP.Land/Pages/About.razor.cs @@ -14,24 +14,26 @@ using Microsoft.JSInterop; using MP.Land; using MP.Land.Shared; using MP.Land.Data; +using NLog; namespace MP.Land.Pages { public partial class About { - protected string Titolo = ""; - protected string Messaggio = ""; + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + private string Titolo = ""; + private string Messaggio = ""; - protected string ServerStatus = "SrvState"; - protected string Installazione = "Inst"; - protected string Applicazione = "App"; - protected string Licenze = "#"; - protected DateTime Scadenza = DateTime.Today; - protected string MastKey = "########################"; + private string ServerStatus = "SrvState"; + private string Installazione = "Inst"; + private string Applicazione = "App"; + private string Licenze = "#"; + private DateTime Scadenza = DateTime.Today; + private string MastKey = "########################"; - protected string mainCss = "alert alert-info"; - protected string remSrvCss = "bg-danger text-warning"; - protected string expDateCss = "bg-danger text-warning"; + private string mainCss = "alert alert-info"; + private string remSrvCss = "bg-danger text-warning"; + private string expDateCss = "bg-danger text-warning"; protected override async Task OnInitializedAsync() { @@ -45,16 +47,23 @@ namespace MP.Land.Pages int cDelay = 5; // recupero dati await Task.Delay(cDelay); - LicServ.InitAkv(); - Installazione = LicServ.Installazione; - Applicazione = LicServ.Applicazione; - MastKey = LicServ.MasterKey; - await Task.Delay(cDelay); - var fatto = await LicServ.RefreshLicense(); - await Task.Delay(cDelay); - Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}"; - // verifico stati - ServerStatus = await LicServ.checkLimanServer(); + try + { + LicServ.InitAkv(); + // verifico stati + ServerStatus = await LicServ.checkLimanServer(); + Installazione = LicServ.Installazione; + Applicazione = LicServ.Applicazione; + MastKey = LicServ.MasterKey; + await Task.Delay(cDelay); + var fatto = await LicServ.RefreshLicense(); + await Task.Delay(cDelay); + Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}"; + } + catch(Exception exc) + { + Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}"); + } bool okRemoteSrv = ServerStatus == "OK"; bool okScadenza = LicServ.checkLicenseActive(LicServ.MasterKey); bool okNumLic = (LicServ.NumLicDb <= LicServ.NumLicRemote); diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index a1418a27..e3171d71 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

Versione: 6.15.2207.0510

+

Versione: 6.15.2207.0610


Note di rilascio: