53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using SteamWare;
|
|
using GPW_data;
|
|
|
|
namespace GPW.WebUserControls
|
|
{
|
|
public partial class mod_enrollByJumperAuthKey : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
// procedo alla ricerca di dati via sessione x User AuthKey
|
|
tryAutoEnroll();
|
|
}
|
|
/// <summary>
|
|
/// prova a fare auto enroll
|
|
/// </summary>
|
|
public void tryAutoEnroll()
|
|
{
|
|
// recupero dati da session
|
|
string UserAuthKey = "";
|
|
int idxDipendente = 0;
|
|
string userAgent = "";
|
|
bool fatto = false;
|
|
string DeviceName = "";
|
|
string IPv4 = "";
|
|
try
|
|
{
|
|
UserAuthKey = memLayer.ML.StringSessionObj("UserAuthKey");
|
|
idxDipendente = memLayer.ML.IntSessionObj("idxDipendente");
|
|
userAgent = Request.UserAgent;
|
|
}
|
|
catch
|
|
{ }
|
|
// se ci sono i dati effettua tentativo di AutoEnroll del device
|
|
if (idxDipendente > 0 && UserAuthKey != "")
|
|
{
|
|
DeviceName = Request.UserHostName;
|
|
IPv4 = Request.UserHostName;
|
|
fatto = DataProxy.DP.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, idxDipendente);
|
|
if (fatto)
|
|
{
|
|
Response.Redirect("Timbrature.aspx");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
} |