Prima relase ADMIN
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
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_resetUserAuthKey : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo nuovo device...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnConferma_Click(object sender, EventArgs e)
|
||||
{
|
||||
// controllo se ho i dati...
|
||||
string UserAuthKey = txtUserAuthKey.Text.Trim();
|
||||
string AuthKey = txtAuthKey.Text.Trim();
|
||||
int idxDip = 0;
|
||||
try
|
||||
{
|
||||
idxDip = Convert.ToInt32(ddlIdxDipendente.SelectedValue);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllo password...
|
||||
if (AuthKey == memLayer.ML.confReadString("authKey"))
|
||||
{
|
||||
// calcolo il secret...
|
||||
string md5UserAuthKey = SteamCrypto.EncryptString(UserAuthKey, "AuthGPW");
|
||||
DataProxy.DP.taDipendenti.stp_Dip_setAuthKey(idxDip, md5UserAuthKey);
|
||||
// mostro esito!
|
||||
lblWarning.Text = string.Format("AuthKey utente {0} aggiornata", idxDip);
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "Key errata";
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// resetto tutto
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAnnulla_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtAuthKey.Text = "";
|
||||
ddlIdxDipendente.SelectedIndex = 0;
|
||||
txtUserAuthKey.Text = "";
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user