Files
XPS/XPST/WebUserControls/mod_menuTopCompact.ascx.cs
2018-03-20 10:22:21 +01:00

52 lines
1.4 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;
namespace XPST.WebUserControls
{
public partial class mod_menuTopCompact : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
{
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0)
{
Response.Redirect("login");
}
}
else
{
PagCorrente();
}
}
lblTitolo.Text = memLayer.ML.confReadString("appName");
}
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
}
}