53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using MapoDb;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace MoonProTablet.WebUserControls
|
|
{
|
|
public partial class mod_QRScanner : BaseUserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
// Richiesto https
|
|
// basato su instascan:
|
|
// https://github.com/schmich/instascan
|
|
if (!Page.IsPostBack)
|
|
{
|
|
txtQRCode.Text = "";
|
|
hlReload.Enabled = false;
|
|
}
|
|
}
|
|
|
|
protected void txtQRCode_TextChanged(object sender, EventArgs e)
|
|
{
|
|
checkloginPwdOnly();
|
|
}
|
|
/// <summary>
|
|
/// controllo login solo con pwd
|
|
/// </summary>
|
|
private void checkloginPwdOnly()
|
|
{
|
|
// 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 = DataLayerObj.taOp.getByAuthKey(UserAuthKey);
|
|
if (results.Count > 0)
|
|
{
|
|
// in questo caso rimando a jumper...
|
|
int MatrOpr = results[0].MatrOpr;
|
|
string baseAuthUrl = memLayer.ML.CRS("baseAuthUrl");
|
|
// rimando a pagina login con pwdOnly...
|
|
Response.Redirect(string.Format("{0}MatrOpr={1}&UserAuthKey={2}", baseAuthUrl, MatrOpr, UserAuthKey));
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void lbtGo_Click(object sender, EventArgs e)
|
|
{
|
|
checkloginPwdOnly();
|
|
}
|
|
}
|
|
} |