-
+
diff --git a/C2P/WebUserControls/mod_Q_Quot.ascx.cs b/C2P/WebUserControls/mod_Q_Quot.ascx.cs
index 5bfe9cf..9b2ec2a 100644
--- a/C2P/WebUserControls/mod_Q_Quot.ascx.cs
+++ b/C2P/WebUserControls/mod_Q_Quot.ascx.cs
@@ -81,5 +81,16 @@ namespace C2P.WebUserControls
{
frmView.DataBind();
}
+ ///
+ /// verifica se utente sia admin altrimenti non vede dati...
+ ///
+ public bool userIsAdmin
+ {
+ get
+ {
+ bool answ = SteamWare.user_std.UtSn.userHasRight("SuperUser");
+ return answ;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/C2P/WebUserControls/mod_login.ascx b/C2P/WebUserControls/mod_login.ascx
new file mode 100644
index 0000000..3f039a5
--- /dev/null
+++ b/C2P/WebUserControls/mod_login.ascx
@@ -0,0 +1,54 @@
+<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %>
+
+
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+ |
+
+
+ |
+
+ |
+
+
+
+
diff --git a/C2P/WebUserControls/mod_login.ascx.cs b/C2P/WebUserControls/mod_login.ascx.cs
new file mode 100644
index 0000000..c442579
--- /dev/null
+++ b/C2P/WebUserControls/mod_login.ascx.cs
@@ -0,0 +1,243 @@
+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 SteamWare;
+using C2P_Data;
+
+///
+/// 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 = traduci("UserNotAuth");
+ 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(dom_user[0], dom_user[1]);
+ if (fatto)
+ {
+ string postazione_IP = Request.UserHostName;
+ httpLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente dall'IP {2}", _utente.CognomeNome, _utente.userNameAD, postazione_IP), SteamWare.tipoLog.INFO);
+ if (Login_ok != null)
+ {
+ Login_ok(this, new EventArgs());
+ }
+ }
+ else
+ {
+ lblMessage.Text = String.Format("{0}
There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
+ httpLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR);
+ if (Login_Error != null)
+ {
+ Login_Error(this, new EventArgs());
+ }
+ }
+ }
+ else
+ {
+ if (memLayer.ML.confReadBool("autoEnrollEnabled"))
+ {
+ // rimando al modulo di auto enroll...
+ Response.Redirect("autoEnroll.aspx");
+ }
+ else
+ {
+ lblMessage.Text = String.Format("{0}
user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
+ httpLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING);
+ if (Login_Error != null)
+ {
+ Login_Error(this, new EventArgs());
+ }
+ }
+ }
+ }
+ else
+ {
+ lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
+ httpLog(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 == "triplete") // 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);
+ httpLog(_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);
+ httpLog(_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);
+ httpLog(_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);
+ httpLog(_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)
+ {
+ //base.Page_Load(sender, e);
+ //carico da web.config i default values
+ loadDefaultsWebConfig();
+ // procedo...
+ setLoginMode();
+ Session.RemoveAll();
+ if (_isForceUser == SteamWare.loginMode.normale)
+ {
+ AdLogin();
+ }
+ }
+
+ #endregion
+}
diff --git a/C2P/WebUserControls/mod_login.ascx.designer.cs b/C2P/WebUserControls/mod_login.ascx.designer.cs
new file mode 100644
index 0000000..1bf31fd
--- /dev/null
+++ b/C2P/WebUserControls/mod_login.ascx.designer.cs
@@ -0,0 +1,113 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4927
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+
+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/C2P/bin/C2P.dll b/C2P/bin/C2P.dll
index 364c8a8..4abc0fa 100644
Binary files a/C2P/bin/C2P.dll and b/C2P/bin/C2P.dll differ
diff --git a/C2P/bin/C2P_Data.dll b/C2P/bin/C2P_Data.dll
index e9d22d0..c545410 100644
Binary files a/C2P/bin/C2P_Data.dll and b/C2P/bin/C2P_Data.dll differ
diff --git a/C2P/bin/SteamWare.dll b/C2P/bin/SteamWare.dll
index 5c29db3..d4bac5f 100644
Binary files a/C2P/bin/SteamWare.dll and b/C2P/bin/SteamWare.dll differ
diff --git a/C2P/login.aspx b/C2P/login.aspx
new file mode 100644
index 0000000..5b94896
--- /dev/null
+++ b/C2P/login.aspx
@@ -0,0 +1,26 @@
+<%@ Page Language="C#" MasterPageFile="~/JumboPage.master" AutoEventWireup="true"
+ Inherits="login" Title="Login" CodeBehind="login.aspx.cs" %>
+
+<%@ Register Src="~/WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
+
+
+
+
+
+
CostiMateline
+
+
Cost to Price for Extrusion
+
+
+

+
+
+
+
+
diff --git a/C2P/login.aspx.cs b/C2P/login.aspx.cs
new file mode 100644
index 0000000..70de007
--- /dev/null
+++ b/C2P/login.aspx.cs
@@ -0,0 +1,56 @@
+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;
+
+public partial class login : System.Web.UI.Page
+{
+ protected string _nextPage
+ {
+ get
+ {
+ string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage");
+ if (pagina == "")
+ {
+ pagina = "Default.aspx";
+ }
+ return pagina;
+ }
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Mod_login1.modoLogin = SteamWare.loginMode.normale;
+ // pulisco dir temp dai file dei cartellini stampati
+ reportPrinter.obj.pulisciDir();
+ }
+
+ 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);
+ }
+}
diff --git a/C2P/login.aspx.designer.cs b/C2P/login.aspx.designer.cs
new file mode 100644
index 0000000..cd20b3b
--- /dev/null
+++ b/C2P/login.aspx.designer.cs
@@ -0,0 +1,22 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+
+public partial class login {
+
+ ///
+ /// Mod_login1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::mod_login Mod_login1;
+}
diff --git a/C2P_Report/bin/C2P_Data.dll b/C2P_Report/bin/C2P_Data.dll
index e9d22d0..c545410 100644
Binary files a/C2P_Report/bin/C2P_Data.dll and b/C2P_Report/bin/C2P_Data.dll differ
diff --git a/C2P_Report/bin/C2P_Report.dll b/C2P_Report/bin/C2P_Report.dll
index 148db65..45b526d 100644
Binary files a/C2P_Report/bin/C2P_Report.dll and b/C2P_Report/bin/C2P_Report.dll differ
diff --git a/C2P_Report/bin/SteamWare.dll b/C2P_Report/bin/SteamWare.dll
index 5c29db3..d4bac5f 100644
Binary files a/C2P_Report/bin/SteamWare.dll and b/C2P_Report/bin/SteamWare.dll differ
diff --git a/VersGen/C2P.cs b/VersGen/C2P.cs
index 35c2db7..7cad3dc 100644
--- a/VersGen/C2P.cs
+++ b/VersGen/C2P.cs
@@ -5,7 +5,7 @@
using System.Reflection;
-[assembly: AssemblyVersion("0.8.102.229")]
-[assembly: AssemblyFileVersion("0.8.102.229")]
+[assembly: AssemblyVersion("0.8.103.229")]
+[assembly: AssemblyFileVersion("0.8.103.229")]
[assembly: AssemblyCopyright("Proxima & Steamware © 2013-2014")]
[assembly: AssemblyCompany("Steamware")]
diff --git a/VersGen/C2P.tt b/VersGen/C2P.tt
index 5858880..98ac367 100644
--- a/VersGen/C2P.tt
+++ b/VersGen/C2P.tt
@@ -6,8 +6,8 @@
using System.Reflection;
-[assembly: AssemblyVersion("0.8.102.<#= this.RevisionNumber #>")]
-[assembly: AssemblyFileVersion("0.8.102.<#= this.RevisionNumber #>")]
+[assembly: AssemblyVersion("0.8.103.<#= this.RevisionNumber #>")]
+[assembly: AssemblyFileVersion("0.8.103.<#= this.RevisionNumber #>")]
[assembly: AssemblyCopyright("Proxima & Steamware © 2013-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware")]
<#+
Use another service to log in.
-