Altri passi avanti x pagine auth devices & utenti...

This commit is contained in:
Samuele E. Locatelli
2014-09-19 17:27:45 +02:00
parent 87b914c739
commit c71ecfb368
11 changed files with 347 additions and 22 deletions
+47 -1
View File
@@ -1,4 +1,5 @@
using System;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -11,7 +12,52 @@ namespace MedPred
{
protected void Page_Load(object sender, EventArgs e)
{
// check visibilità controlli opzionali
checkVisibCtrl();
}
private void checkVisibCtrl()
{
// controllo se c'è chiamata x aggiungere device da authKey e mostro panel...
divEnrollByKey.Visible = (Request.QueryString["addDeviceByKey"] == "lvabe");
// se è admin vede anche i controlli x abilitare richieste utenti & co...
divAdmin.Visible = userIsAdmin;
}
public bool userIsAdmin
{
get
{
bool answ = false;
try
{
answ = user_std.UtSn.userHasRight("SuperAdmin");
}
catch
{ }
return answ;
}
}
/// <summary>
/// richiesta reset dispositivi utente
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReqNewKey_Click(object sender, EventArgs e)
{
// controllo email & co...
string email = txtEmailReq.Text.Trim();
if (email != "" && email.IndexOf("@")>0)
{
// rimando al jumper...
//Response.Redirect(string.Format("jumper?UserAuthkey={0}&USER_NAME={1}"));
Response.Redirect("UserAdmin");
}
else
{
lblOut.Text = "Attenzione! preogo inserire email valida!";
lblOut.Visible= true;
}
}
}
}