71 lines
2.0 KiB
C#
71 lines
2.0 KiB
C#
using MapoDb;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MP_MAG.WebUserControls
|
|
{
|
|
public partial class mod_enrollByJumperAuthKey : System.Web.UI.UserControl
|
|
{
|
|
#region Internal Fields
|
|
|
|
/// <summary>
|
|
/// Oggetto datalayer specifico
|
|
/// </summary>
|
|
internal DataLayer DataLayerObj = new DataLayer();
|
|
|
|
#endregion Internal Fields
|
|
|
|
#region Protected Methods
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
// procedo alla ricerca di dati via sessione x User AuthKey
|
|
tryAutoEnroll();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// prova a fare auto enroll
|
|
/// </summary>
|
|
public void tryAutoEnroll()
|
|
{
|
|
// recupero dati da session
|
|
string UserAuthKey = "";
|
|
int MatrOpr = 0;
|
|
string userAgent = "";
|
|
bool fatto = false;
|
|
string DeviceName = "";
|
|
string IPv4 = "";
|
|
try
|
|
{
|
|
UserAuthKey = memLayer.ML.StringSessionObj("UserAuthKey");
|
|
MatrOpr = DataLayerObj.MatrOpr;
|
|
userAgent = Request.UserAgent;
|
|
}
|
|
catch
|
|
{ }
|
|
// se ci sono i dati effettua tentativo di AutoEnroll del device
|
|
if (MatrOpr >= 0 && !string.IsNullOrEmpty(UserAuthKey))
|
|
{
|
|
DeviceName = Request.UserHostName;
|
|
IPv4 = Request.UserHostName;
|
|
memLayer.ML.emptyCookieVal(memLayer.ML.CRS("cookieName"));
|
|
fatto = DataLayerObj.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, MatrOpr);
|
|
if (fatto)
|
|
{
|
|
Response.Redirect(memLayer.ML.CRS("mainPageMag"));
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |