diff --git a/Equa_Auth/LandingPage.aspx b/Equa_Auth/LandingPage.aspx
new file mode 100644
index 0000000..8260cf4
--- /dev/null
+++ b/Equa_Auth/LandingPage.aspx
@@ -0,0 +1,15 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LandingPage.aspx.cs" Inherits="Equa_Auth.LandingPage" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/Equa_Auth/LandingPage.aspx.cs b/Equa_Auth/LandingPage.aspx.cs
new file mode 100644
index 0000000..927e320
--- /dev/null
+++ b/Equa_Auth/LandingPage.aspx.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Equa_Auth
+{
+ public partial class LandingPage : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Equa_Auth/LandingPage.aspx.designer.cs b/Equa_Auth/LandingPage.aspx.designer.cs
new file mode 100644
index 0000000..005a166
--- /dev/null
+++ b/Equa_Auth/LandingPage.aspx.designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Equa_Auth
+{
+
+
+ public partial class LandingPage
+ {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+ }
+}
diff --git a/Equa_Auth/Properties/AssemblyInfo.cs b/Equa_Auth/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..27cbaf8
--- /dev/null
+++ b/Equa_Auth/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Equa_Auth")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Equa_Auth")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("076fbb63-2898-40d0-8694-f9c261dab2e7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml b/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml
new file mode 100644
index 0000000..7be2c89
--- /dev/null
+++ b/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml
@@ -0,0 +1,23 @@
+
+
+
+
+ MSDeploy
+ Release
+ Any CPU
+
+ True
+ False
+ https://IIS02:8172/MsDeploy.axd
+ Default Web Site/Equa_Auth
+
+ True
+ WMSVC
+ True
+ steamwarewin\administrator
+ <_SavePWD>True
+
+
\ No newline at end of file
diff --git a/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml.user b/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml.user
new file mode 100644
index 0000000..6601068
--- /dev/null
+++ b/Equa_Auth/Properties/PublishProfiles/IIS02.pubxml.user
@@ -0,0 +1,11 @@
+
+
+
+
+ 2012-12-20T08:29:08.8983364+01:00
+ AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAo36S5JDE50KEYaFF4uFLhwAAAAACAAAAAAADZgAAwAAAABAAAAD1KIWdXy6ig98G3KugeIxAAAAAAASAAACgAAAAEAAAAMOZEqvJi7T0Uz1HKo370RAYAAAA2LU+bG8Tsfy6PeBRVTa+eWI2s52HmdRDFAAAAPpfjqE5M/ly9SZMve8EOSTORlbR
+
+
\ No newline at end of file
diff --git a/Equa_Auth/Web.Debug.config b/Equa_Auth/Web.Debug.config
new file mode 100644
index 0000000..2c6dd51
--- /dev/null
+++ b/Equa_Auth/Web.Debug.config
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Equa_Auth/Web.EQUA.config b/Equa_Auth/Web.EQUA.config
new file mode 100644
index 0000000..e850a64
--- /dev/null
+++ b/Equa_Auth/Web.EQUA.config
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Equa_Auth/Web.Release.config b/Equa_Auth/Web.Release.config
new file mode 100644
index 0000000..4122d79
--- /dev/null
+++ b/Equa_Auth/Web.Release.config
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Equa_Auth/Web.config b/Equa_Auth/Web.config
new file mode 100644
index 0000000..8e40113
--- /dev/null
+++ b/Equa_Auth/Web.config
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Equa_Auth/WebUserControls/mod_login.ascx b/Equa_Auth/WebUserControls/mod_login.ascx
new file mode 100644
index 0000000..0490870
--- /dev/null
+++ b/Equa_Auth/WebUserControls/mod_login.ascx
@@ -0,0 +1,54 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_login.ascx.cs" Inherits="Equa_Auth.WebUserControls.mod_login" %>
+
+
+
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+
diff --git a/Equa_Auth/WebUserControls/mod_login.ascx.cs b/Equa_Auth/WebUserControls/mod_login.ascx.cs
new file mode 100644
index 0000000..2078593
--- /dev/null
+++ b/Equa_Auth/WebUserControls/mod_login.ascx.cs
@@ -0,0 +1,241 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using SteamWare;
+
+namespace Equa_Auth.WebUserControls
+{
+ ///
+ /// classe gestione login e forzatura login
+ ///
+ public partial class mod_login : ApplicationUserControl
+ {
+ #region area protected/private
+
+ #region area proprietà
+
+ private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale;
+
+ #endregion
+
+ #region area metodi
+
+ ///
+ /// imposta la modalità di login tra normale / forceUser
+ ///
+ private void setLoginMode()
+ {
+ if (_isForceUser == SteamWare.loginMode.forceUser)
+ {
+ pnlForceUser.Visible = true;
+ }
+ else
+ {
+ pnlForceUser.Visible = false;
+ }
+ }
+
+ protected override void traduciObj()
+ {
+ lblPwd.Text = user_std.UtSn.Traduci("lblPwd");
+ lblUser.Text = user_std.UtSn.Traduci("lblUser");
+ lblDominio.Text = user_std.UtSn.Traduci("lblDominio");
+ lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente");
+ btnOk.Text = user_std.UtSn.Traduci("btnCommit");
+ }
+
+ ///
+ /// prova a verificare se l'utente sia ok x AD credentials
+ ///
+ private void AdLogin()
+ {
+ lblMessage.Text = "User not authenticated...";
+ 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);
+ // salvo cookie!
+ string DeviceName = "";
+ string IPv4 = "";
+ string userAgent = "";
+ try
+ {
+ userAgent = Request.UserAgent;
+ DeviceName = Request.UserHostName;
+ IPv4 = Request.UserHostName;
+ }
+ catch
+ { }
+ if (memLayer.ML.confReadBool("enableCookie"))
+ {
+ // elimino eventuali altri cookie x dominio/user/devName
+ //DataWrap.DW.taAnagDev.delByDominioUserDeviceName(dom_user[0], dom_user[1], DeviceName);
+ // creo nuovo cookie
+ authProxy.createNewCookie(dom_user[0], dom_user[1], 0, DeviceName, userAgent, IPv4, Page.Request.QueryString["AuthCookie"].ToString(), DateTime.Now.AddDays(memLayer.ML.confReadInt("cookieDayExp")));
+ }
+ // loggo
+ SteamWare.logger.lg.scriviLog(string.Format("L'utente {0}/{1} ha effettuato il login correttamente", dom_user[0], dom_user[1]), SteamWare.tipoLog.INFO);
+ if (Login_ok != null)
+ {
+ Login_ok(this, new EventArgs());
+ }
+ }
+ else
+ {
+ lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
+ SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
+ if (Login_Error != null)
+ {
+ Login_Error(this, new EventArgs());
+ }
+ }
+ }
+
+ ///
+ /// effettua verifiche e se concesso permette di forzare l'accesso utente
+ ///
+ private void ForceUserIdentity()
+ {
+ if (Page.User.Identity.IsAuthenticated)
+ {
+ bool _allowForceUser = false;
+ try
+ {
+ _allowForceUser = SteamWare.memLayer.ML.confReadBool("_allowForceUser");
+ }
+ catch
+ {
+ _allowForceUser = false;
+ }
+ if (_allowForceUser)
+ {
+ if (authKey.Text == "forzaInter") // verifica passphrase...
+ {
+ user_std _utente = new user_std();
+ user_std.UtSn.isForcedUser = true;
+ bool fatto = _utente.startUpUtente(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);
+ SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
+ if (Login_ok != null)
+ {
+ Login_ok(this, new EventArgs());
+ }
+ }
+ }
+ else
+ {
+ lblMessage.Text = String.Format("{0}
key not allowed for operation!!! operation logged!!!", user_std.UtSn.Traduci("AccessFail"));
+ mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
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);
+ SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
+ 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!
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);
+ SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
+ if (Login_Error != null)
+ {
+ Login_Error(this, new EventArgs());
+ }
+ }
+ }
+ else
+ {
+ lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail"));
+ 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);
+ SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
+ }
+ }
+
+ 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à
+
+ ///
+ /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
+ ///
+ public SteamWare.loginMode modoLogin
+ {
+ get
+ {
+ return _isForceUser;
+ }
+ set
+ {
+ _isForceUser = value;
+ }
+ }
+
+ #endregion
+
+
+ ///
+ /// avvio pagina
+ ///
+ protected override void Page_Load(object sender, EventArgs e)
+ {
+ //carico da web.config i default values
+ loadDefaultsWebConfig();
+ // procedo...
+ setLoginMode();
+ Session.RemoveAll();
+ if (_isForceUser == SteamWare.loginMode.normale)
+ {
+ bool cookieLogin = false;
+ if (memLayer.ML.confReadBool("enableCookie"))
+ {
+ string cookieName = Page.Request.QueryString["AuthCookie"].ToString();
+ cookieLogin = authProxy.tryAuthByCookie(cookieName);
+ }
+ if (!cookieLogin)
+ {
+ AdLogin();
+ }
+ else
+ {
+ if (Login_ok != null)
+ {
+ Login_ok(this, new EventArgs());
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Equa_Auth/WebUserControls/mod_login.ascx.designer.cs b/Equa_Auth/WebUserControls/mod_login.ascx.designer.cs
new file mode 100644
index 0000000..19f7d9a
--- /dev/null
+++ b/Equa_Auth/WebUserControls/mod_login.ascx.designer.cs
@@ -0,0 +1,114 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Equa_Auth.WebUserControls {
+
+
+ public partial class mod_login {
+
+ ///
+ /// pnlForceUser control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel pnlForceUser;
+
+ ///
+ /// lblTitolo control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblTitolo;
+
+ ///
+ /// lblPwd control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblPwd;
+
+ ///
+ /// authKey control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox authKey;
+
+ ///
+ /// lblDominio control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblDominio;
+
+ ///
+ /// dominio control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox dominio;
+
+ ///
+ /// lblUser control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblUser;
+
+ ///
+ /// user control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox user;
+
+ ///
+ /// btnOk control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnOk;
+
+ ///
+ /// lblMessage control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblMessage;
+
+ ///
+ /// HypLinkSSO control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO;
+ }
+}
diff --git a/Equa_Auth/login.aspx b/Equa_Auth/login.aspx
new file mode 100644
index 0000000..67fdfa9
--- /dev/null
+++ b/Equa_Auth/login.aspx
@@ -0,0 +1,16 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="Equa_Auth.login" %>
+
+<%@ Register Src="WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
+
+
+
+
+
+
+
+
+
diff --git a/Equa_Auth/login.aspx.cs b/Equa_Auth/login.aspx.cs
new file mode 100644
index 0000000..f36aa09
--- /dev/null
+++ b/Equa_Auth/login.aspx.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using SteamWare;
+
+namespace Equa_Auth
+{
+ public partial class login : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string AuthCookie = "";
+ try
+ {
+ AuthCookie = Page.Request.QueryString["AuthCookie"].ToString();
+ logger.lg.scriviLog(string.Format("Richiesta verifica cookie: {0}", AuthCookie), tipoLog.INFO);
+ }
+ catch
+ { }
+ // salvo nome cookie richiesto
+ memLayer.ML.setSessionVal("AuthCookie", AuthCookie);
+ // setto modalità login
+ mod_login1.modoLogin = SteamWare.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)
+ {
+ string nextPage = "";
+ try
+ {
+ nextPage = Page.Request.QueryString["jumpPage"].ToString();
+ }
+ catch
+ {
+ nextPage = "./LandingPage.aspx";
+ }
+ logger.lg.scriviLog(string.Format("Login ok, redirecting to {0}", nextPage), tipoLog.INFO);
+ Response.Redirect(nextPage);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Equa_Auth/login.aspx.designer.cs b/Equa_Auth/login.aspx.designer.cs
new file mode 100644
index 0000000..6a8862c
--- /dev/null
+++ b/Equa_Auth/login.aspx.designer.cs
@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Equa_Auth {
+
+
+ public partial class login {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// mod_login1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Equa_Auth.WebUserControls.mod_login mod_login1;
+ }
+}
diff --git a/Equa_Auth/logs/PlaceHolder.file b/Equa_Auth/logs/PlaceHolder.file
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/Equa_Auth/logs/PlaceHolder.file
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/db/SteamWare_XPS.zip b/db/SteamWare_XPS.zip
deleted file mode 100644
index 32352e0..0000000
Binary files a/db/SteamWare_XPS.zip and /dev/null differ