HTTPS/HTTP SOLO se encessario ovvero QR code abilitato

This commit is contained in:
Samuele E. Locatelli
2018-05-31 14:27:28 +02:00
parent b931c3886e
commit ced12af850
3 changed files with 18 additions and 14 deletions
Vendored
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -77,7 +77,7 @@
<add key="user" value="Mobile" />
<add key="cookieDayExpire" value="3650" />
<add key="safePages" value="Test#regNewDevice" />
<add key="EmbedQRead" value="true" />
<add key="EmbedQRead" value="false" />
<add key="forceSecurePages" value="regNewDevice" />
<!--conf commenti e ricalcoli-->
<add key="idxTipoCommento" value="999" />
+16 -12
View File
@@ -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);
}
}
}