From ced12af850784118eae532457ee8d977fe712954 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 31 May 2018 14:27:28 +0200 Subject: [PATCH] HTTPS/HTTP SOLO se encessario ovvero QR code abilitato --- Jenkinsfile | 2 +- MP-TAB/Web.config | 2 +- MP-TAB/WebUserControls/mod_checkHttps.ascx.cs | 28 +++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ab4007b5..93dcfdf0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=759']) { + withEnv(['NEXT_BUILD_NUMBER=761']) { // env.versionNumber = VersionNumber(versionNumberString : '5.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '5.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' diff --git a/MP-TAB/Web.config b/MP-TAB/Web.config index 9bfe11fe..38154b9c 100644 --- a/MP-TAB/Web.config +++ b/MP-TAB/Web.config @@ -77,7 +77,7 @@ - + diff --git a/MP-TAB/WebUserControls/mod_checkHttps.ascx.cs b/MP-TAB/WebUserControls/mod_checkHttps.ascx.cs index 0b5ab50c..e02365f6 100644 --- a/MP-TAB/WebUserControls/mod_checkHttps.ascx.cs +++ b/MP-TAB/WebUserControls/mod_checkHttps.ascx.cs @@ -14,21 +14,25 @@ namespace MoonProTablet.WebUserControls { if (!Page.IsPostBack) { - // se pagina richiesta in http ma con QR code rimando in https... - bool needHttps = memLayer.ML.CRS("forceSecurePages").IndexOf(titolo) >= 0; - if (needHttps != Request.IsSecureConnection) - { - string newUrl = Request.Url.AbsoluteUri; - // in questo caso scambio http <--> https - if (needHttps) + // SOLO SE รจ abilitato QR reader... + if (memLayer.ML.CRB("EmbedQRead")) { - newUrl = newUrl.Replace("http://", "https://"); - } - else + // se pagina richiesta in http ma con QR code rimando in https... + bool needHttps = memLayer.ML.CRS("forceSecurePages").IndexOf(titolo) >= 0; + if (needHttps != Request.IsSecureConnection) { - newUrl = newUrl.Replace("https://", "http://"); + string newUrl = Request.Url.AbsoluteUri; + // in questo caso scambio http <--> https + if (needHttps) + { + newUrl = newUrl.Replace("http://", "https://"); + } + else + { + newUrl = newUrl.Replace("https://", "http://"); + } + Response.Redirect(newUrl); } - Response.Redirect(newUrl); } } }