From ad34910fa6a825b22151c67022a086f2918268ac Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 9 Nov 2021 14:40:07 +0100 Subject: [PATCH 1/3] Fix reset dati check payload --- GPW_Data/licenzeGPW.cs | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/GPW_Data/licenzeGPW.cs b/GPW_Data/licenzeGPW.cs index c0c9d8d..7312740 100644 --- a/GPW_Data/licenzeGPW.cs +++ b/GPW_Data/licenzeGPW.cs @@ -10,6 +10,7 @@ using System.Web; using static GPW_data.LiManObj; using System.Text; using System.Security.Cryptography; +using System.Diagnostics; namespace GPW_data { @@ -31,8 +32,10 @@ namespace GPW_data protected static string rkeyActInfo = memLayer.ML.redHash($"LiMan:ActInfo"); protected static string rkeyAppInfo = memLayer.ML.redHash($"LiMan:AppInfo"); + protected static string rkeyErrPayL = memLayer.ML.redHash($"LiMan:ErrPayL"); protected static string rkeyLicInfo = memLayer.ML.redHash($"LiMan:LicInfo"); protected static string rkeyPayload = memLayer.ML.redHash($"LiMan:Payload"); + protected static string rkeyVetoRefPayL = memLayer.ML.redHash($"LiMan:VetoRefPayL"); #endregion Protected Fields @@ -123,12 +126,41 @@ namespace GPW_data currPayload = calcPayload(); memLayer.ML.setRSV(rkeyPayload, currPayload, 3600); } - // confronto + // confronto payload calc con quello della licenza answ = InfoApplicativo.Payload == currPayload; } catch { } - // confronto payload calc con quello della licenza + + // se OK resetto counter, altrimenti incremento + if (answ) + { + memLayer.ML.resetRCnt(rkeyErrPayL); + } + else + { + memLayer.ML.setRCntI(rkeyErrPayL); + int currErrCnt = memLayer.ML.getRCnt(rkeyErrPayL); + bool okRefreshPayload = string.IsNullOrEmpty(memLayer.ML.getRSV(rkeyVetoRefPayL)); + if (currErrCnt > 10 && okRefreshPayload) + { + Stopwatch sw = new Stopwatch(); + sw.Start(); + // richiedo update payload impostando TTL a 1 sec... + var okApp = RefreshAppInfo().Result; + var okLic = RefreshActInfo().Result; + var okAct = RefreshLicInfo().Result; + if (okAct && okLic && okApp) + { + memLayer.ML.setRSV(rkeyPayload, "", 1); + memLayer.ML.resetRCnt(rkeyErrPayL); + memLayer.ML.setRSV(rkeyVetoRefPayL, "Veto", 3); + } + sw.Stop(); + logger.lg.scriviLog($"Superata soglia errori checkPayload({currErrCnt}), effettuato reset variabili in {sw.ElapsedMilliseconds} ms"); + } + } + return answ; } } From a49e32f2af435b0a412f84eec15ef85dbced6edb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 9 Nov 2021 16:50:23 +0100 Subject: [PATCH 2/3] Fix conf DB x deploy --- .../Properties/PublishProfiles/ETS.pubxml | 66 +++++++++---------- .../Properties/PublishProfiles/IIS01.pubxml | 6 +- .../Properties/PublishProfiles/IIS02.pubxml | 6 +- .../Properties/PublishProfiles/IISDEV.pubxml | 6 +- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/GPW_Admin/Properties/PublishProfiles/ETS.pubxml b/GPW_Admin/Properties/PublishProfiles/ETS.pubxml index 90176e4..c896d62 100644 --- a/GPW_Admin/Properties/PublishProfiles/ETS.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/ETS.pubxml @@ -1,39 +1,39 @@  - - Package - - C:\Users\samuele\Documents\Visual Studio 2012\Projects\GestionePresenze\GPW\ReleasesClienti\ETS\GPW.zip - true - Default Web Site/GPW/Smart - - - - - - - - - - - - - - - ETS - Any CPU - True - True - True - True - False - DonotMerge - - - - + + Package + + C:\Users\samuele\Documents\Visual Studio 2012\Projects\GestionePresenze\GPW\ReleasesClienti\ETS\GPW.zip + true + Default Web Site/GPW/Smart + + + + + + + + + + + + + + + ETS + Any CPU + True + True + True + True + False + DonotMerge + + + + \ No newline at end of file diff --git a/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml b/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml index ec8edf6..e6fea6d 100644 --- a/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IIS01.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + diff --git a/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml b/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml index 1da7320..9bbb2eb 100644 --- a/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IIS02.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + diff --git a/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml b/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml index dfe6e05..6b84290 100644 --- a/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml +++ b/GPW_Admin/Properties/PublishProfiles/IISDEV.pubxml @@ -1,7 +1,7 @@  @@ -20,11 +20,11 @@ by editing this MSBuild file. In order to learn more about this please visit htt - + - + From 40ec3cd556ab1fe483353b0728bf7e5803309aca Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 9 Nov 2021 16:51:04 +0100 Subject: [PATCH 3/3] Fix gestione ricalcolo stato payload --- GPW_Admin/Web.SPS.config | 62 +-- GPW_Admin/Web.config | 12 +- GPW_Admin/WebUserControls/cmp_menuTop.ascx | 2 +- .../cmp_menuTop.ascx.designer.cs | 46 +- .../WebUserControls/cmp_vocabolario.ascx.cs | 2 +- .../WebUserControls/mod_approvaTimbr.ascx | 2 +- GPW_Admin/WebUserControls/mod_filtro.ascx | 2 +- GPW_Admin/WebUserControls/mod_filtro.ascx.cs | 20 +- .../mod_filtro.ascx.designer.cs | 40 +- GPW_Admin/WebUserControls/mod_login.ascx.cs | 128 +++-- GPW_Admin/WebUserControls/mod_menuTop.ascx.cs | 145 +++--- .../mod_periodoAnalisi.ascx.cs | 442 ++++++++++-------- .../WebUserControls/mod_unauthorized.ascx.cs | 24 +- GPW_Admin/approvTimbrature.aspx.designer.cs | 22 +- GPW_Data/licenzeGPW.cs | 67 +-- 15 files changed, 556 insertions(+), 460 deletions(-) diff --git a/GPW_Admin/Web.SPS.config b/GPW_Admin/Web.SPS.config index 92fccfa..193f4b6 100644 --- a/GPW_Admin/Web.SPS.config +++ b/GPW_Admin/Web.SPS.config @@ -4,55 +4,55 @@ - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - + + + + - + diff --git a/GPW_Admin/Web.config b/GPW_Admin/Web.config index 66e222a..0bf10c7 100644 --- a/GPW_Admin/Web.config +++ b/GPW_Admin/Web.config @@ -133,15 +133,15 @@ - - - - - + + + + + - + diff --git a/GPW_Admin/WebUserControls/cmp_menuTop.ascx b/GPW_Admin/WebUserControls/cmp_menuTop.ascx index e3ed486..3f366da 100644 --- a/GPW_Admin/WebUserControls/cmp_menuTop.ascx +++ b/GPW_Admin/WebUserControls/cmp_menuTop.ascx @@ -3,7 +3,7 @@