ver 1018: fix login tablet con SOLA pwd/authKey
This commit is contained in:
@@ -16,9 +16,16 @@
|
||||
let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
|
||||
scanner.addListener('scan', function (content) {
|
||||
//console.log(content);
|
||||
document.getElementById('<%= txtQRCode.ClientID %>').value = content;
|
||||
document.getElementById('<%= hlReload.ClientID %>').href = content;
|
||||
document.getElementById('<%= hlReload.ClientID %>').click();
|
||||
var isUrl = content.includes("http");
|
||||
if (isUrl) {
|
||||
// se content è un URL --> faccio reload...
|
||||
document.getElementById('<%= hlReload.ClientID %>').href = content;
|
||||
document.getElementById('<%= hlReload.ClientID %>').click();
|
||||
}
|
||||
else {
|
||||
// altrimenti salvo in textBox e processo
|
||||
document.getElementById('<%= txtQRCode.ClientID %>').value = content;
|
||||
}
|
||||
});
|
||||
Instascan.Camera.getCameras().then(function (cameras) {
|
||||
if (cameras.length > 0) {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
@@ -11,7 +9,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Richeisto https
|
||||
// Richiesto https
|
||||
// basato su instascan:
|
||||
// https://github.com/schmich/instascan
|
||||
if (!Page.IsPostBack)
|
||||
@@ -23,6 +21,21 @@ namespace MoonProTablet.WebUserControls
|
||||
|
||||
protected void txtQRCode_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
// se abilitato login "pwdOnly" rimando a login...
|
||||
if (memLayer.ML.cdvb("loginPwdOnly"))
|
||||
{
|
||||
string UserAuthKey = txtQRCode.Text.Trim();
|
||||
// cerco se la pwd valida ci sia...
|
||||
var results = DataLayer.obj.taOp.getByAuthKey(UserAuthKey);
|
||||
if (results.Count > 0)
|
||||
{
|
||||
// in questo caso rimando a jumper...
|
||||
int MatrOpr = results[0].MatrOpr;
|
||||
// rimando a pagina login con pwdOnly...
|
||||
Response.Redirect(string.Format("jumper?MatrOpr={0}&UserAuthKey={1}", MatrOpr, UserAuthKey));
|
||||
}
|
||||
}
|
||||
|
||||
//// rimando a pagina di login...
|
||||
//Response.Redirect(txtQRCode.Text.Trim());
|
||||
//hlReload.NavigateUrl=txtQRCode.Text.Trim();
|
||||
|
||||
Reference in New Issue
Block a user