fix reset su login cookie

This commit is contained in:
Samuele E. Locatelli
2018-09-05 18:45:39 +02:00
parent 6107ece4c9
commit 6c8aa9b1ba
3 changed files with 25 additions and 11 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
<ItemTemplate>
<asp:LinkButton ID="lbtFreePost" runat="server" CausesValidation="False" CommandName="Select" OnClick="lbtFreePost_Click" CommandArgument="RemOpr" CssClass="btn btm-block btn-danger" Visible='<%# Eval("CodOpr").ToString()!="" %>' ToolTip="Sblocca postazione" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaSbloccoPost") %>' ><i class="fas fa-2x fa-user-times"></i></asp:LinkButton>
<asp:LinkButton ID="lbtFreePost" runat="server" CausesValidation="False" CommandName="Select" OnClick="lbtFreePost_Click" CommandArgument="RemOpr" CssClass="btn btm-block btn-danger" Visible='<%# canUnlock(Eval("CodOpr").ToString()) %>' ToolTip="Sblocca postazione" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaSbloccoPost") %>' ><i class="fas fa-2x fa-user-times"></i></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="2em"></ItemStyle>
</asp:TemplateField>
@@ -103,6 +103,18 @@ namespace C_TRACK.WebUserControls
{
memLayer.ML.setSessionVal("nextObjCommand", "selPost");
}
/// <summary>
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
/// - è un user "power"
/// - è LUI STESSO l'utente da levare
/// </summary>
public bool canUnlock(string thisCodOpr)
{
bool hasLock = thisCodOpr != "";
bool isPower = devicesAuthProxy.stObj.userHasRight("CT_userStart");
bool isHimself = (CodOpr == thisCodOpr);
return hasLock && (isPower || isHimself);
}
}
}
+12 -10
View File
@@ -1,17 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using System;
namespace C_TRACK
{
public partial class jumper : System.Web.UI.Page
public partial class jumper : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
protected void Page_Load(object sender, EventArgs e)
{
}
// aggiorno vocabolario
DataWrap.DW.resetVocabolario();
// reset dati in cache x DbConfig...
memLayer.ML.resetAppConf();
// svuoto session e cache per rileggere i dati da Db
Session.RemoveAll();
}
}
}