fix gestione utenti e auth pagine (COMPLETATA!!!)
This commit is contained in:
@@ -114,6 +114,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>DS_WebScip.xsd</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="enomerazioni.cs" />
|
||||
<Compile Include="fileMover.cs" />
|
||||
<Compile Include="officeXmlMan.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<!-- add your logging rules here -->
|
||||
|
||||
<!--
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
-->
|
||||
<!-- logging rules -->
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
<!--<logger name="*" minlevel="Trace" writeTo="sentinel" />-->
|
||||
</rules>
|
||||
</nlog>
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ETS_Data
|
||||
{
|
||||
/// <summary>
|
||||
/// enumeratore modalità login
|
||||
/// </summary>
|
||||
public enum loginMode
|
||||
{
|
||||
/// <summary>
|
||||
/// login AD normale
|
||||
/// </summary>
|
||||
normale,
|
||||
/// <summary>
|
||||
/// forza utente fornendo password
|
||||
/// </summary>
|
||||
forceUser,
|
||||
/// <summary>
|
||||
/// forza ad un utente standard scelto dall'elenco
|
||||
/// </summary>
|
||||
standardUser
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -628,27 +628,6 @@ namespace ETS_Data
|
||||
rigaUtente = _rigaUtenteAnagGen;
|
||||
}
|
||||
/// <summary>
|
||||
/// Procedura da chiamare DOPO aver messo in session i dati utente/dominio x caricare gli altri dati CON I DIRITTI SOLO per il CDC indicato
|
||||
/// </summary>
|
||||
/// <param name="_dominio"></param>
|
||||
/// <param name="_username"></param>
|
||||
/// <param name="cdc"></param>
|
||||
/// <returns></returns>
|
||||
public bool startUpUtente(string _dominio, string _username, string cdc)
|
||||
{
|
||||
bool risultato = false;
|
||||
clearAllUserData();
|
||||
if (_username != "" && _dominio != "")
|
||||
{
|
||||
utente = _username;
|
||||
dominio = _dominio;
|
||||
setupRiga();
|
||||
setupDirittiPermessi(cdc);
|
||||
risultato = true;
|
||||
}
|
||||
return risultato;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica nella tab diritti se l'utente abbia il right richiesto e fornisce bool in risposta
|
||||
/// </summary>
|
||||
/// <param name="diritto"></param>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="PROJ_ETS.Login" %>
|
||||
|
||||
<%@ Register src="WebUserControls/mod_login.ascx" tagname="mod_login" tagprefix="uc1" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
|
||||
<uc1:mod_login ID="mod_login1" runat="server" />
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using ETS_Data;
|
||||
|
||||
namespace PROJ_ETS
|
||||
{
|
||||
public partial class Login : System.Web.UI.Page
|
||||
{
|
||||
protected string _nextPage
|
||||
{
|
||||
get
|
||||
{
|
||||
string pagina = utils.obj.StringSessionObj("nextPage");
|
||||
if (pagina == "")
|
||||
{
|
||||
pagina = "menu.aspx";
|
||||
}
|
||||
return pagina;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
mod_login1.modoLogin = loginMode.normale;
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok);
|
||||
mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error);
|
||||
}
|
||||
|
||||
void Mod_login1_Login_Error(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("unauthorized.aspx");
|
||||
}
|
||||
|
||||
void Mod_login1_Login_ok(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect(_nextPage);
|
||||
}
|
||||
protected override void OnUnload(EventArgs e)
|
||||
{
|
||||
base.OnUnload(e);
|
||||
mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok);
|
||||
mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+33
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PROJ_ETS {
|
||||
|
||||
|
||||
public partial class Login {
|
||||
|
||||
/// <summary>
|
||||
/// form1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// mod_login1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::mod_login mod_login1;
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,8 @@
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<!-- add your logging rules here -->
|
||||
|
||||
<!--
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
-->
|
||||
<!-- logging rules -->
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
<!--<logger name="*" minlevel="Trace" writeTo="sentinel" />-->
|
||||
</rules>
|
||||
</nlog>
|
||||
@@ -264,6 +264,7 @@
|
||||
<Content Include="Images\view_m.png" />
|
||||
<Content Include="Images\view_s.png" />
|
||||
<Content Include="Images\WorkInProgress.jpg" />
|
||||
<Content Include="Login.aspx" />
|
||||
<Content Include="Menu.aspx" />
|
||||
<Content Include="packages.config" />
|
||||
<Content Include="Progetti.aspx" />
|
||||
@@ -285,12 +286,14 @@
|
||||
<Content Include="SpostaCommesse.aspx" />
|
||||
<Content Include="Images\help_white.png" />
|
||||
<Content Include="Test.aspx" />
|
||||
<Content Include="unauthorized.aspx" />
|
||||
<Content Include="WebUserControls\mod_autocomplete.ascx" />
|
||||
<Content Include="WebUserControls\mod_commessa.ascx" />
|
||||
<Content Include="WebUserControls\mod_commesse.ascx" />
|
||||
<Content Include="WebUserControls\mod_datiComm.ascx" />
|
||||
<Content Include="WebUserControls\mod_fasi.ascx" />
|
||||
<Content Include="WebUserControls\mod_fornitori.ascx" />
|
||||
<Content Include="WebUserControls\mod_login.ascx" />
|
||||
<Content Include="WebUserControls\mod_menu.ascx" />
|
||||
<Content Include="WebUserControls\mod_menuBottomFullpage.ascx" />
|
||||
<Content Include="WebUserControls\mod_menuProj.ascx" />
|
||||
@@ -403,6 +406,13 @@
|
||||
<Compile Include="Help.aspx.designer.cs">
|
||||
<DependentUpon>Help.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Login.aspx.cs">
|
||||
<DependentUpon>Login.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Login.aspx.designer.cs">
|
||||
<DependentUpon>Login.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Menu.aspx.cs">
|
||||
<DependentUpon>Menu.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -443,6 +453,13 @@
|
||||
<Compile Include="Test.aspx.designer.cs">
|
||||
<DependentUpon>Test.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="unauthorized.aspx.cs">
|
||||
<DependentUpon>unauthorized.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="unauthorized.aspx.designer.cs">
|
||||
<DependentUpon>unauthorized.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebMasterPages\Progetti.master.cs">
|
||||
<DependentUpon>Progetti.master</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -513,6 +530,13 @@
|
||||
<Compile Include="WebUserControls\mod_fornitori.ascx.designer.cs">
|
||||
<DependentUpon>mod_fornitori.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_login.ascx.cs">
|
||||
<DependentUpon>mod_login.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_login.ascx.designer.cs">
|
||||
<DependentUpon>mod_login.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\mod_menu.ascx.cs">
|
||||
<DependentUpon>mod_menu.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<add key="ETS_WSConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=ETS_WS;Persist Security Info=True;User ID=sa;Password=keyhammer" />
|
||||
<add key="ETS_AnagraficaConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=ETS_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer" />
|
||||
<add key="ETS_PROJConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=ETS-PROJ;Persist Security Info=True;User ID=sa;Password=keyhammer" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=ETS_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer" />
|
||||
<add key="PermessiConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=ETS-PROJ;Persist Security Info=True;User ID=sa;Password=keyhammer" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5" />
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" CodeBehind="mod_login.ascx.cs" %>
|
||||
<% if (false)
|
||||
{ %>
|
||||
<link href="../css/Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel ID="pnlForceUser" runat="server">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="chPwdTitle">
|
||||
<asp:Label runat="server" ID="lblTitolo" Text="Login Forzato" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd" Text="Password" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="authKey" TextMode="Password" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblDominio" Text="Dominio" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="dominio" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser" Text="Username" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="user" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Button Width="100%" runat="server" ID="btnOk" CommandName="ok" CommandArgument="ok" OnClick="btnOk_Click" Text="Ok" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Label CssClass="chPwdTxt" ID="lblMessage" runat="server" Text="Utente non autorizzato" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<asp:HyperLink ID="HypLinkSSO" runat="server" NavigateUrl="~/login.aspx" Text="Single-Sign-On Login"></asp:HyperLink>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,232 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using ETS_Data;
|
||||
using NLog;
|
||||
|
||||
/// <summary>
|
||||
/// classe gestione login e forzatura login
|
||||
/// </summary>
|
||||
public partial class mod_login : System.Web.UI.UserControl
|
||||
{
|
||||
#region area protected/private
|
||||
|
||||
protected Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#region area proprietà
|
||||
|
||||
private loginMode _isForceUser = loginMode.normale;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area metodi
|
||||
|
||||
/// <summary>
|
||||
/// imposta la modalità di login tra normale / forceUser
|
||||
/// </summary>
|
||||
private void setLoginMode()
|
||||
{
|
||||
if (_isForceUser == loginMode.forceUser)
|
||||
{
|
||||
pnlForceUser.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlForceUser.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// prova a verificare se l'utente sia ok x AD credentials
|
||||
/// </summary>
|
||||
private void AdLogin()
|
||||
{
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
//recupera user windows se c'è...
|
||||
string ad_name = Page.User.Identity.Name;
|
||||
string delimStr = "\\";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] dom_user = ad_name.Split(delimiter, 2);
|
||||
// passo al controllo di verifica ADuserOk...
|
||||
user_std _utente = new user_std();
|
||||
if (_utente.ADuserOk(dom_user[0], dom_user[1]))
|
||||
{
|
||||
bool fatto = _utente.startUpUtente(ad_name);
|
||||
if (fatto)
|
||||
{
|
||||
lg.Info(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD));
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("Accesso fallito! problemi ad inizializzare l'utente: {0}", ad_name);
|
||||
lg.Error(lblMessage.Text);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (utils.obj.confReadBool("autoEnrollEnabled"))
|
||||
{
|
||||
// rimando al modulo di auto enroll...
|
||||
Response.Redirect("autoEnroll.aspx");
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("Accesso fallito: user non autorizzato e autoenroll non attivo: {0}", ad_name);
|
||||
lg.Warn(lblMessage.Text);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("Accesso fallito: user non autorizzato: IP:{0}, user: {1}", Request.UserHostName, utils.obj.currUserAD);
|
||||
lg.Warn(lblMessage.Text);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua verifiche e se concesso permette di forzare l'accesso utente
|
||||
/// </summary>
|
||||
private void ForceUserIdentity()
|
||||
{
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
bool _allowForceUser = false;
|
||||
try
|
||||
{
|
||||
_allowForceUser = utils.obj.confReadBool("_allowForceUser");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_allowForceUser = false;
|
||||
}
|
||||
if (_allowForceUser)
|
||||
{
|
||||
if (authKey.Text == "triplete") // verifica passphrase...
|
||||
{
|
||||
user_std _utente = new user_std();
|
||||
user_std.UtSn.isForcedUser = true;
|
||||
bool fatto = _utente.startUpUtente(string.Format(@"{0}\{1}", dominio.Text, user.Text));
|
||||
if (fatto)
|
||||
{
|
||||
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
lg.Info(_rigaLog);
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = "Accesso fallito<br>key foce login non valida!!! tentativo registrata!!!";
|
||||
//mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
lg.Warn(_rigaLog);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
lg.Warn(_rigaLog);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = "Accesso fallito!<br>user not authenticated!";
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
|
||||
lg.Warn(_rigaLog);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
ForceUserIdentity();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
#region eventi pubblici esposti
|
||||
|
||||
public event EventHandler Login_ok;
|
||||
public event EventHandler Login_Error;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area proprietà
|
||||
|
||||
/// <summary>
|
||||
/// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
|
||||
/// </summary>
|
||||
public loginMode modoLogin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isForceUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isForceUser = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// procedo...
|
||||
setLoginMode();
|
||||
Session.RemoveAll();
|
||||
if (_isForceUser == loginMode.normale)
|
||||
{
|
||||
AdLogin();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
public partial class mod_login {
|
||||
|
||||
/// <summary>
|
||||
/// pnlForceUser control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pnlForceUser;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitolo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblTitolo;
|
||||
|
||||
/// <summary>
|
||||
/// lblPwd control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPwd;
|
||||
|
||||
/// <summary>
|
||||
/// authKey control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox authKey;
|
||||
|
||||
/// <summary>
|
||||
/// lblDominio control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblDominio;
|
||||
|
||||
/// <summary>
|
||||
/// dominio control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox dominio;
|
||||
|
||||
/// <summary>
|
||||
/// lblUser control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblUser;
|
||||
|
||||
/// <summary>
|
||||
/// user control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox user;
|
||||
|
||||
/// <summary>
|
||||
/// btnOk control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnOk;
|
||||
|
||||
/// <summary>
|
||||
/// lblMessage control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblMessage;
|
||||
|
||||
/// <summary>
|
||||
/// HypLinkSSO control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace PROJ_ETS.WebUserControls
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
//SetUpByUserRight();
|
||||
SetUpByUserRight();
|
||||
}
|
||||
lblUser.Text = string.Format("{0} ({1})", utils.obj.currUserCognomeNome, utils.obj.currUserId);
|
||||
lblPostazione.Text = Request.UserHostName;
|
||||
@@ -74,7 +74,7 @@ namespace PROJ_ETS.WebUserControls
|
||||
Response.Redirect("login.aspx");
|
||||
}
|
||||
// verifica i permessi dell'utente per almeno vedere la pagina corrente SSE non è una common page...
|
||||
if (!user_std.UtSn.isPageEnabled(_paginaCorrente) && utils.obj.confReadString("_commonPages").IndexOf(_paginaCorrente) == -1)
|
||||
if (!user_std.UtSn.isPageEnabled(_paginaCorrente.Replace(".aspx","")) && utils.obj.confReadString("_commonPages").IndexOf(_paginaCorrente) == -1)
|
||||
{
|
||||
lg.Info(string.Format("Errore in SetUpByUserRight: utente {0} non autorizzato per la pagina {1}", user_std.UtSn.utente, _paginaCorrente));
|
||||
Response.Redirect("unauthorized.aspx");
|
||||
|
||||
Binary file not shown.
@@ -20,10 +20,8 @@
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<!-- add your logging rules here -->
|
||||
|
||||
<!--
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
-->
|
||||
<!-- logging rules -->
|
||||
<logger name="*" minlevel="Trace" writeTo="f" />
|
||||
<!--<logger name="*" minlevel="Trace" writeTo="sentinel" />-->
|
||||
</rules>
|
||||
</nlog>
|
||||
Binary file not shown.
@@ -0,0 +1,64 @@
|
||||
2013-05-23 14:46:14.6537 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 14:46:14.8397 [WARN] Accesso fallito: user non autorizzato e autoenroll non attivo: STEAMWAREWIN\samuele
|
||||
2013-05-23 14:52:09.5068 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 14:52:09.5248 [WARN] Accesso fallito: user non autorizzato e autoenroll non attivo: STEAMWAREWIN\samuele
|
||||
2013-05-23 14:52:17.1219 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 14:52:17.3379 [WARN] Accesso fallito: user non autorizzato e autoenroll non attivo: STEAMWAREWIN\samuele
|
||||
2013-05-23 14:53:20.4073 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 14:56:56.8955 [WARN] Accesso fallito: user non autorizzato e autoenroll non attivo: STEAMWAREWIN\samuele
|
||||
2013-05-23 14:57:16.0214 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:00:34.6279 [WARN] Accesso fallito: user non autorizzato e autoenroll non attivo: STEAMWAREWIN\samuele
|
||||
2013-05-23 15:00:43.5693 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:00:43.7443 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:00:43.7513 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina menu.aspx
|
||||
2013-05-23 15:00:53.2687 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:01:15.7090 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:01:18.3904 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina menu.aspx
|
||||
2013-05-23 15:03:00.5136 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:03:00.5246 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Menu.aspx
|
||||
2013-05-23 15:03:06.5755 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:03:06.5755 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Menu.aspx
|
||||
2013-05-23 15:05:14.0315 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:05:14.0315 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Menu.aspx
|
||||
2013-05-23 15:05:30.1129 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:05:41.5706 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:05:56.6628 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Menu
|
||||
2013-05-23 15:06:14.0824 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Progetti
|
||||
2013-05-23 15:06:58.9041 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:06:59.3782 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:09:04.6388 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina Menu
|
||||
2013-05-23 15:12:32.0907 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:12:32.2987 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:12:46.2938 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:12:46.3338 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:13:26.5128 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:13:26.5188 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:13:47.7019 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:13:47.7019 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:13:50.2673 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:13:54.8060 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:13:54.8060 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:14:45.8646 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:14:45.8646 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:14:53.2347 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina DatiCommessa
|
||||
2013-05-23 15:14:53.2417 [ERROR] Errore di accesso alla pagina DatiCommessa
|
||||
2013-05-23 15:15:00.5238 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:15:01.2859 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:15:09.8732 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina FasiCommessa
|
||||
2013-05-23 15:15:09.8732 [ERROR] Errore di accesso alla pagina FasiCommessa
|
||||
2013-05-23 15:15:30.9543 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina FornitoriCommessa
|
||||
2013-05-23 15:15:30.9613 [ERROR] Errore di accesso alla pagina FornitoriCommessa
|
||||
2013-05-23 15:16:02.9971 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina RiepilogoCommessa
|
||||
2013-05-23 15:16:02.9971 [ERROR] Errore di accesso alla pagina RiepilogoCommessa
|
||||
2013-05-23 15:16:19.3855 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:16:22.9830 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina FasiCommessa
|
||||
2013-05-23 15:16:22.9900 [ERROR] Errore di accesso alla pagina FasiCommessa
|
||||
2013-05-23 15:16:30.3651 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:16:31.0042 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:16:36.0470 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina FasiCommessa
|
||||
2013-05-23 15:16:36.0470 [ERROR] Errore di accesso alla pagina FasiCommessa
|
||||
2013-05-23 15:19:08.4757 [INFO] User login: Locatelli Samuele (STEAMWAREWIN\samuele)
|
||||
2013-05-23 15:19:08.7057 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
2013-05-23 15:19:21.4486 [INFO] Errore in SetUpByUserRight: utente samuele non autorizzato per la pagina FasiCommessa
|
||||
2013-05-23 15:19:21.4876 [ERROR] Errore di accesso alla pagina FasiCommessa
|
||||
2013-05-23 15:27:35.9792 [INFO] L'utente Locatelli Samuele (STEAMWAREWIN\samuele) ha effettuato il login correttamente
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="unauthorized.aspx.cs" Inherits="PROJ_ETS.unauthorized" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<h2>Attenzione!</h2>
|
||||
Utente non abilitato all'accesso.
|
||||
<br />
|
||||
<asp:Label runat="server" ID="pgReq" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using ETS_Data;
|
||||
using NLog;
|
||||
|
||||
namespace PROJ_ETS
|
||||
{
|
||||
public partial class unauthorized : System.Web.UI.Page
|
||||
{
|
||||
|
||||
protected Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
pgReq.Text = string.Format("Errore di accesso alla pagina {0}", utils.obj.StringSessionObj("_paginaPrecedente"));
|
||||
lg.Error(pgReq.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PROJ_ETS {
|
||||
|
||||
|
||||
public partial class unauthorized {
|
||||
|
||||
/// <summary>
|
||||
/// form1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// pgReq control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label pgReq;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user