Fix procedura registrazione con QRCode (richiesta https SOLO in 1 pag)
This commit is contained in:
@@ -5,6 +5,13 @@
|
||||
<h3 class="text-center">QR SCanner</h3>
|
||||
</div>
|
||||
<div class="col-12 text-center">
|
||||
<asp:UpdatePanel runat="server" ID="upnDecode">
|
||||
<ContentTemplate>
|
||||
<asp:TextBox runat="server" ID="txtQRCode" Width="20em" AutoPostBack="true" OnTextChanged="txtQRCode_TextChanged" />
|
||||
<asp:HyperLink runat="server" ID="hlReload" Target="_blank" NavigateUrl="~/" CssClass="btn btn-success"><i class="fa fa-arrow-circle-right"></i> GO</asp:HyperLink>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<hr />
|
||||
<video id="preview"></video>
|
||||
<script type="text/javascript">
|
||||
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
|
||||
@@ -23,12 +30,5 @@
|
||||
console.error(e);
|
||||
});
|
||||
</script>
|
||||
<br />
|
||||
<asp:UpdatePanel runat="server" ID="upnDecode">
|
||||
<ContentTemplate>
|
||||
<asp:TextBox runat="server" ID="txtQRCode" Width="20em" AutoPostBack="true" OnTextChanged="txtQRCode_TextChanged" />
|
||||
<asp:HyperLink runat="server" ID="hlReload" Target="_blank" NavigateUrl="~/" CssClass="btn btn-success"><i class="fa fa-arrow-circle-right"></i> GO</asp:HyperLink>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,9 +23,11 @@ namespace MoonProTablet.WebUserControls
|
||||
|
||||
protected void txtQRCode_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
hlReload.NavigateUrl=txtQRCode.Text.Trim();
|
||||
hlReload.Text = txtQRCode.Text.Trim();
|
||||
hlReload.Enabled = true;
|
||||
//// rimando a pagina di login...
|
||||
//Response.Redirect(txtQRCode.Text.Trim());
|
||||
//hlReload.NavigateUrl=txtQRCode.Text.Trim();
|
||||
//hlReload.Text = txtQRCode.Text.Trim();
|
||||
//hlReload.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_checkHttps.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_checkHttps" %>
|
||||
@@ -0,0 +1,36 @@
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_checkHttps : SteamWare.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
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)
|
||||
{
|
||||
newUrl = newUrl.Replace("http://", "https://");
|
||||
}
|
||||
else
|
||||
{
|
||||
newUrl = newUrl.Replace("https://", "http://");
|
||||
}
|
||||
Response.Redirect(newUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_checkHttps
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,9 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// prima apertura registro NO popup = refresh enabled
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// prima apertura registro NO popup = refresh enabled
|
||||
memLayer.ML.setSessionVal("refreshEnabled", true);
|
||||
}
|
||||
// se ho user/dominio e matricola in sessione NON controllo coockie
|
||||
|
||||
Reference in New Issue
Block a user