62 lines
2.2 KiB
C#
62 lines
2.2 KiB
C#
using SteamWare;
|
|
using System;
|
|
|
|
namespace CMS_SC.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 = traduci("ErrorEAK01");// "Attenzione! auth key NON valida, prego contattare amministratore!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
lblOutRegAuthKey.Text = traduci("ErrorEAK02");//"Attenzione! email non trovata, prego contattare amministratore!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
lblOutRegAuthKey.Text = traduci("ErrorEAK03");//"Attenzione! preogo inserire email valida!";
|
|
lblOutRegAuthKey.Visible = true;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// wrapper traduzione
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
}
|
|
} |