59 lines
2.0 KiB
C#
59 lines
2.0 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 ScheMe_Data;
|
|
|
|
namespace ScheMe.WebUserControls
|
|
{
|
|
public partial class mod_enrollByAuthKey : System.Web.UI.UserControl
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// richiesta enroll device da chiave personale + email
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnEnrollByAK_Click(object sender, EventArgs e)
|
|
{
|
|
// controllo email & co...
|
|
string email = txtEmailAK.Text.Trim();
|
|
string authKey = txtAuthKey.Text.Trim();
|
|
if (email != "" && email.IndexOf("@") > 0)
|
|
{
|
|
// ora controllo che l'email SIA nell'elenco delle email degli utenti...
|
|
if (devicesAuthProxy.stObj.checkUserEmail(email))
|
|
{
|
|
// controllo se la authKey è corretta x utente...
|
|
if (devicesAuthProxy.stObj.checkUserEmailAK(email, authKey))
|
|
{
|
|
// rimando al jumper...
|
|
Response.Redirect(string.Format("jumper?UserAuthkey={0}&USER_NAME={1}", authKey, email));
|
|
}
|
|
else
|
|
{
|
|
lblOutRegAuthKey.Text = "Attenzione! auth key NON valida, prego contattare amministratore!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
lblOutRegAuthKey.Text = "Attenzione! email non trovata, prego contattare amministratore!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
lblOutRegAuthKey.Text = "Attenzione! preogo inserire email valida!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
}
|
|
} |