diff --git a/MP-ADM/BasePage.cs b/MP-ADM/BasePage.cs index dd4aad1a..59b6b9f9 100644 --- a/MP-ADM/BasePage.cs +++ b/MP-ADM/BasePage.cs @@ -1,4 +1,5 @@ -using SteamWare; +using MapoDb; +using SteamWare; using System; using System.Collections.Generic; using System.Linq; @@ -7,7 +8,26 @@ using System.Web; namespace MP_ADM { public class BasePage : System.Web.UI.Page - { + { + /// + /// Prox pagina da aprire + /// + protected string _nextPage + { + get + { + string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); + if (pagina == "") + { + pagina = "menu.aspx"; + } + return pagina; + } + } + /// + /// Oggetto datalayer specifico + /// + internal DataLayer DataLayerObj = new DataLayer(); /// /// effettua traduzione del lemma /// diff --git a/MP-ADM/BaseUserControl.cs b/MP-ADM/BaseUserControl.cs index 5ffb8037..2cafedd1 100644 --- a/MP-ADM/BaseUserControl.cs +++ b/MP-ADM/BaseUserControl.cs @@ -13,8 +13,6 @@ namespace MP_ADM /// Oggetto datalayer specifico NON singleton x scalare /// internal DataLayer DataLayerObj = new DataLayer(); - - /// /// effettua traduzione del lemma /// diff --git a/MP-ADM/DataImport.aspx.cs b/MP-ADM/DataImport.aspx.cs index 7b9f246f..b02f6fce 100644 --- a/MP-ADM/DataImport.aspx.cs +++ b/MP-ADM/DataImport.aspx.cs @@ -4,43 +4,39 @@ using System; namespace MP_ADM { - public partial class DataImport : System.Web.UI.Page - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class DataImport : BasePage { - checkEnabled(); - } + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); - lbtProImportIS.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: import disabilitato"; - } - lblDataImportOut.Text = messaggio; - } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); + lbtProImportIS.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: import disabilitato"; + } + lblDataImportOut.Text = messaggio; + } - /// - /// Esegue import dati - /// - /// - /// - protected void lbtProImportIS_Click(object sender, EventArgs e) - { - bool OptAdmDB_IS_EnabFileImp = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); - // se abilitato... - if (OptAdmDB_IS_EnabFileImp) - { - // chiamo import... - DataLayerObj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0); - } + /// + /// Esegue import dati + /// + /// + /// + protected void lbtProImportIS_Click(object sender, EventArgs e) + { + bool OptAdmDB_IS_EnabFileImp = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); + // se abilitato... + if (OptAdmDB_IS_EnabFileImp) + { + // chiamo import... + DataLayerObj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0); + } + } } - } } \ No newline at end of file diff --git a/MP-ADM/Default.aspx.cs b/MP-ADM/Default.aspx.cs index a37844fb..0db11a0e 100644 --- a/MP-ADM/Default.aspx.cs +++ b/MP-ADM/Default.aspx.cs @@ -2,11 +2,11 @@ namespace MP_ADM { - public partial class _Default : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class _Default : System.Web.UI.Page { - Response.Redirect("./login.aspx"); + protected void Page_Load(object sender, EventArgs e) + { + Response.Redirect("./login.aspx"); + } } - } } diff --git a/MP-ADM/GestKIT.aspx.cs b/MP-ADM/GestKIT.aspx.cs index f680aad8..89455c07 100644 --- a/MP-ADM/GestKIT.aspx.cs +++ b/MP-ADM/GestKIT.aspx.cs @@ -3,65 +3,65 @@ using System; namespace MP_ADM { - public partial class GestKIT : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class GestKIT : BasePage { - checkEnabled(); - string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); - mod_barcode.codOrdPre = codPre != "" ? codPre : "KIT"; - mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; - mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); - mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); - mod_barcode.eh_comandoRegistrato += Mod_barcode_eh_comandoRegistrato; - mod_barcode.eh_dataRead += Mod_barcode_eh_dataRead; - mod_gestKIT.eh_selKit += Mod_gestKIT_eh_selKit; - } + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); + mod_barcode.codOrdPre = codPre != "" ? codPre : "KIT"; + mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; + mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); + mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); + mod_barcode.eh_comandoRegistrato += Mod_barcode_eh_comandoRegistrato; + mod_barcode.eh_dataRead += Mod_barcode_eh_dataRead; + mod_gestKIT.eh_selKit += Mod_gestKIT_eh_selKit; + } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); - divContent.Visible = optPar; - lblDataImportOut.Visible = !optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: Gestione KIT disabilitata"; - lblDataImportOut.Text = messaggio; - } - } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); + divContent.Visible = optPar; + lblDataImportOut.Visible = !optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: Gestione KIT disabilitata"; + lblDataImportOut.Text = messaggio; + } + } - private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) - { - // invio ultimo kit creato a barcode... - mod_barcode.BCodeVal = mod_gestKIT.lastKitMade; - mod_barcode.processInput(); - } + private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) + { + // invio ultimo kit creato a barcode... + mod_barcode.BCodeVal = mod_gestKIT.lastKitMade; + mod_barcode.processInput(); + } - private void Mod_barcode_eh_dataRead(object sender, EventArgs e) - { - // verifico input su KIT x lettura "grezza" - string rawInput = mod_barcode.rawInput; - mod_gestKIT.lastInput = rawInput; - mod_gestKIT.doUpdate(); - } + private void Mod_barcode_eh_dataRead(object sender, EventArgs e) + { + // verifico input su KIT x lettura "grezza" + string rawInput = mod_barcode.rawInput; + mod_gestKIT.lastInput = rawInput; + mod_gestKIT.doUpdate(); + } - private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) - { - // verifico input su KIT x comando completo - string BCodeVal = mod_barcode.BCodeVal; - // se è un ORDINE... procedo! - if (BCodeVal.IndexOf("OPR") == 0) - { - // aggiungo ordine... - mod_gestKIT.addOrdArt(mod_barcode.codOrd, mod_barcode.codArt, mod_barcode.descArt, mod_barcode.qta); - mod_gestKIT.lastInput = ""; - } - else - { - mod_gestKIT.lastInput = mod_barcode.BCodeVal; - } - mod_gestKIT.doUpdate(); + private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) + { + // verifico input su KIT x comando completo + string BCodeVal = mod_barcode.BCodeVal; + // se è un ORDINE... procedo! + if (BCodeVal.IndexOf("OPR") == 0) + { + // aggiungo ordine... + mod_gestKIT.addOrdArt(mod_barcode.codOrd, mod_barcode.codArt, mod_barcode.descArt, mod_barcode.qta); + mod_gestKIT.lastInput = ""; + } + else + { + mod_gestKIT.lastInput = mod_barcode.BCodeVal; + } + mod_gestKIT.doUpdate(); + } } - } } \ No newline at end of file diff --git a/MP-ADM/HwSwInfo.aspx.cs b/MP-ADM/HwSwInfo.aspx.cs index 56090d7a..5f8a7fb4 100644 --- a/MP-ADM/HwSwInfo.aspx.cs +++ b/MP-ADM/HwSwInfo.aspx.cs @@ -7,11 +7,11 @@ using System.Web.UI.WebControls; namespace MP_ADM { - public partial class HwSwInfo : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class HwSwInfo : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx index c931a8c8..fe9b1a85 100644 --- a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx +++ b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestioneDatiMacchine.ascx.cs" - Inherits="MoonPro_site.WebUserControls.mod_gestioneDatiMacchine" %> + Inherits="MP_ADM.WebUserControls.mod_gestioneDatiMacchine" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_gestioneDatiMacchine { - + public partial class mod_gestioneDatiMacchine + { + /// - /// grView control. + /// Controllo grView. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.GridView grView; - + /// - /// lblNumRec control. + /// Controllo lblNumRec. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblNumRec; - + /// - /// lblWarning control. + /// Controllo lblWarning. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblWarning; - + /// - /// ods control. + /// Controllo ods. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; } diff --git a/MP-ADM/WebUserControls/mod_login.ascx b/MP-ADM/WebUserControls/mod_login.ascx index 52e6a68f..7205f707 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx +++ b/MP-ADM/WebUserControls/mod_login.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %> +<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_login" Codebehind="mod_login.ascx.cs" %> diff --git a/MP-ADM/WebUserControls/mod_login.ascx.cs b/MP-ADM/WebUserControls/mod_login.ascx.cs index 7c5831e6..15a60cca 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx.cs +++ b/MP-ADM/WebUserControls/mod_login.ascx.cs @@ -2,85 +2,97 @@ using SteamWare; using System; using System.Web.UI; -/// -/// classe gestione login e forzatura login -/// -public partial class mod_login : SteamWare.ApplicationUserControl +namespace MP_ADM.WebUserControls { - #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 + /// classe gestione login e forzatura login /// - private void setLoginMode() + public partial class mod_login : SteamWare.ApplicationUserControl { - switch (_isForceUser) - { - case SteamWare.loginMode.normale: - pnlForceUser.Visible = false; - pnlSelectUser.Visible = false; - break; - case SteamWare.loginMode.forceUser: - pnlForceUser.Visible = true; - pnlSelectUser.Visible = false; - break; - case SteamWare.loginMode.standardUser: - pnlForceUser.Visible = false; - pnlSelectUser.Visible = true; - break; - default: - break; - } - } + #region area protected/private - 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"); - btnOkUserStd.Text = user_std.UtSn.Traduci("btnCommit"); - } + #region area proprietà - /// - /// prova a verificare se l'utente sia ok x AD credentials - /// - private void AdLogin() - { - lblMessage.Text = "User not authenticated..."; - if (Page.User.Identity.IsAuthenticated) + private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale; + + #endregion + + #region area metodi + + /// + /// imposta la modalità di login tra normale / forceUser + /// + private void setLoginMode() { - //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])) + switch (_isForceUser) { - bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); - if (fatto) + case SteamWare.loginMode.normale: + pnlForceUser.Visible = false; + pnlSelectUser.Visible = false; + break; + case SteamWare.loginMode.forceUser: + pnlForceUser.Visible = true; + pnlSelectUser.Visible = false; + break; + case SteamWare.loginMode.standardUser: + pnlForceUser.Visible = false; + pnlSelectUser.Visible = true; + break; + default: + break; + } + } + + 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"); + btnOkUserStd.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); + // passo al controllo di verifica ADuserOk... + user_std _utente = new user_std(); + if (_utente.ADuserOk(dom_user[0], dom_user[1])) { - SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO); - if (Login_ok != null) + bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); + if (fatto) { - Login_ok(this, new EventArgs()); + SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), 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]); + SteamWare.logger.lg.scriviLog(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 { - lblMessage.Text = String.Format("{0}
There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR); + lblMessage.Text = String.Format("{0}
user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); + SteamWare.logger.lg.scriviLog(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()); @@ -89,63 +101,64 @@ public partial class mod_login : SteamWare.ApplicationUserControl } else { - lblMessage.Text = String.Format("{0}
user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING); + 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()); } } } - 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) + /// + /// effettua verifiche e se concesso permette di forzare l'accesso utente + /// + private void ForceUserIdentity() { - bool _allowForceUser = false; - try + if (Page.User.Identity.IsAuthenticated) { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); - } - catch - { - _allowForceUser = false; - } - if (_allowForceUser) - { - if (authKey.Text == "forzaInter") // verifica passphrase... + bool _allowForceUser = false; + try { - user_std _utente = new user_std(); - user_std.UtSn.isForcedUser = true; - bool fatto = _utente.startUpUtente(dominio.Text, user.Text); - if (fatto) + _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + } + catch + { + _allowForceUser = false; + } + if (_allowForceUser) + { + if (authKey.Text == "forzaInter") // verifica passphrase... { - 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) + user_std _utente = new user_std(); + user_std.UtSn.isForcedUser = true; + bool fatto = _utente.startUpUtente(dominio.Text, user.Text); + if (fatto) { - Login_ok(this, new EventArgs()); + 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.CRS("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 { - 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.CRS("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); + 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.CRS("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) { @@ -155,155 +168,145 @@ public partial class mod_login : SteamWare.ApplicationUserControl } 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.CRS("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); + 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); } } - else + /// + /// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard + /// + private void StdUserIdentity() { - lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); - if (Login_Error != null) + if (Page.User.Identity.IsAuthenticated) { - 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); - } - } - /// - /// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard - /// - private void StdUserIdentity() - { - if (Page.User.Identity.IsAuthenticated) - { - bool _allowForceUser = false; - try - { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); - } - catch - { - _allowForceUser = false; - } - if (_allowForceUser) - { - //leggo e codifico utente indicato - string delimStr = "\\"; - char[] delimiter = delimStr.ToCharArray(); - string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2); - //forzo login! - user_std _utente = new user_std(); - user_std.UtSn.isForcedUser = true; - bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); - if (fatto) + bool _allowForceUser = false; + try { - string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); - if (Login_ok != null) + _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + } + catch + { + _allowForceUser = false; + } + if (_allowForceUser) + { + //leggo e codifico utente indicato + string delimStr = "\\"; + char[] delimiter = delimStr.ToCharArray(); + string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2); + //forzo login! + user_std _utente = new user_std(); + user_std.UtSn.isForcedUser = true; + bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); + if (fatto) { - Login_ok(this, new EventArgs()); + string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); + if (Login_ok != null) + { + Login_ok(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.CRS("defaultApp")))); + string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue); + 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.CRS("defaultApp")))); - string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); + 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); } } - else + + /// + /// fa login con force user e controllo pwd + /// + /// + /// + protected void btnOk_Click(object sender, EventArgs e) { - lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); - if (Login_Error != null) + ForceUserIdentity(); + } + /// + /// fa login utente tipo standard + /// + /// + /// + protected void btnOkUserStd_Click(object sender, EventArgs e) + { + StdUserIdentity(); + } + + #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 { - Login_Error(this, new EventArgs()); + return _isForceUser; + } + set + { + _isForceUser = value; } - 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); } - } - /// - /// fa login con force user e controllo pwd - /// - /// - /// - protected void btnOk_Click(object sender, EventArgs e) - { - ForceUserIdentity(); - } - /// - /// fa login utente tipo standard - /// - /// - /// - protected void btnOkUserStd_Click(object sender, EventArgs e) - { - StdUserIdentity(); - } + #endregion - #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 + /// + /// avvio pagina + /// + protected override void Page_Load(object sender, EventArgs e) { - return _isForceUser; - } - set - { - _isForceUser = value; + base.Page_Load(sender, e); + //carico da web.config i default values + loadDefaultsWebConfig(); + // procedo... + setLoginMode(); + Session.RemoveAll(); + if (_isForceUser == SteamWare.loginMode.normale) + { + AdLogin(); + } } + + #endregion + } - - #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/MP-ADM/WebUserControls/mod_login.ascx.designer.cs b/MP-ADM/WebUserControls/mod_login.ascx.designer.cs index 1285a2c5..2647edf4 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_login.ascx.designer.cs @@ -1,140 +1,143 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ +namespace MP_ADM.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; - - /// - /// pnlSelectUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pnlSelectUser; - - /// - /// ddlStdUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlStdUser; - - /// - /// btnOkUserStd control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnOkUserStd; - - /// - /// 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; + public partial class mod_login + { + + /// + /// Controllo pnlForceUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Panel pnlForceUser; + + /// + /// Controllo lblTitolo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblTitolo; + + /// + /// Controllo lblPwd. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblPwd; + + /// + /// Controllo authKey. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox authKey; + + /// + /// Controllo lblDominio. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblDominio; + + /// + /// Controllo dominio. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox dominio; + + /// + /// Controllo lblUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblUser; + + /// + /// Controllo user. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox user; + + /// + /// Controllo btnOk. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnOk; + + /// + /// Controllo pnlSelectUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Panel pnlSelectUser; + + /// + /// Controllo ddlStdUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlStdUser; + + /// + /// Controllo btnOkUserStd. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnOkUserStd; + + /// + /// Controllo lblMessage. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// Controllo HypLinkSSO. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO; + } } diff --git a/MP-ADM/forceUser.aspx b/MP-ADM/forceUser.aspx index 425767f2..ec4c177a 100644 --- a/MP-ADM/forceUser.aspx +++ b/MP-ADM/forceUser.aspx @@ -1,9 +1,10 @@ <%@ Page Language="C#" MasterPageFile="~/WebMasterPages/AjaxSimple.master" AutoEventWireup="true" - Inherits="forceUser" Title="MPADM | ForceUser" Codebehind="forceUser.aspx.cs" %> + Inherits="MP_ADM.forceUser" Title="MPADM | ForceUser" Codebehind="forceUser.aspx.cs" %> + +<%@ Register Src="~/WebUserControls/mod_login.ascx" TagPrefix="uc1" TagName="mod_login" %> -<%@ Register Src="WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
- +
diff --git a/MP-ADM/forceUser.aspx.cs b/MP-ADM/forceUser.aspx.cs index aa1271b6..62184ad9 100644 --- a/MP-ADM/forceUser.aspx.cs +++ b/MP-ADM/forceUser.aspx.cs @@ -1,45 +1,36 @@ using System; -public partial class forceUser : System.Web.UI.Page +namespace MP_ADM { - protected string _nextPage + public partial class forceUser : BasePage { - get + + protected void Page_Load(object sender, EventArgs e) { - string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") - { - pagina = "menu.aspx"; - } - return pagina; + mod_login.modoLogin = SteamWare.loginMode.forceUser; + } + + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + mod_login.Login_ok += new EventHandler(Mod_login1_Login_ok); + mod_login.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_login.Login_ok -= new EventHandler(Mod_login1_Login_ok); + mod_login.Login_Error -= new EventHandler(Mod_login1_Login_Error); } } - - protected void Page_Load(object sender, EventArgs e) - { - Mod_login1.modoLogin = SteamWare.loginMode.forceUser; - } - - 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); - } -} +} \ No newline at end of file diff --git a/MP-ADM/forceUser.aspx.designer.cs b/MP-ADM/forceUser.aspx.designer.cs index 75d56583..fe23e924 100644 --- a/MP-ADM/forceUser.aspx.designer.cs +++ b/MP-ADM/forceUser.aspx.designer.cs @@ -7,17 +7,20 @@ // //------------------------------------------------------------------------------ - - -public partial class forceUser +namespace MP_ADM { - /// - /// Controllo Mod_login1. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::mod_login Mod_login1; + + public partial class forceUser + { + + /// + /// Controllo mod_login. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::MP_ADM.WebUserControls.mod_login mod_login; + } } diff --git a/MP-ADM/gestPromesseODL.aspx.cs b/MP-ADM/gestPromesseODL.aspx.cs index 6dd65ff1..aba9602b 100644 --- a/MP-ADM/gestPromesseODL.aspx.cs +++ b/MP-ADM/gestPromesseODL.aspx.cs @@ -7,11 +7,11 @@ using System.Web.UI.WebControls; namespace MP_ADM { - public partial class gestPromesseODL : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class gestPromesseODL : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } - } } \ No newline at end of file diff --git a/MP-ADM/gestioneDatiMacchine.aspx b/MP-ADM/gestioneDatiMacchine.aspx index 23c13396..7f3faef3 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx +++ b/MP-ADM/gestioneDatiMacchine.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="MPADM | Gest Dati Macc" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneDatiMacchine.aspx.cs" Inherits="MoonPro_site.gestioneDatiMacchine" %> +<%@ Page Title="MPADM | Gest Dati Macc" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneDatiMacchine.aspx.cs" Inherits="MP_ADM.gestioneDatiMacchine" %> <%@ Register src="WebUserControls/mod_gestioneDatiMacchine.ascx" tagname="mod_gestioneDatiMacchine" tagprefix="uc1" %> diff --git a/MP-ADM/gestioneDatiMacchine.aspx.cs b/MP-ADM/gestioneDatiMacchine.aspx.cs index 27affcc3..d97016a4 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx.cs +++ b/MP-ADM/gestioneDatiMacchine.aspx.cs @@ -1,8 +1,8 @@ using System; -namespace MoonPro_site +namespace MP_ADM { - public partial class gestioneDatiMacchine : System.Web.UI.Page + public partial class gestioneDatiMacchine : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/gestioneDatiMacchine.aspx.designer.cs b/MP-ADM/gestioneDatiMacchine.aspx.designer.cs index 02df0ad6..d0e334ec 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx.designer.cs +++ b/MP-ADM/gestioneDatiMacchine.aspx.designer.cs @@ -7,7 +7,8 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { +namespace MP_ADM +{ public partial class gestioneDatiMacchine { @@ -19,6 +20,6 @@ namespace MoonPro_site { /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonPro_site.WebUserControls.mod_gestioneDatiMacchine mod_gestioneDatiMacchine1; + protected global::MP_ADM.WebUserControls.mod_gestioneDatiMacchine mod_gestioneDatiMacchine1; } } diff --git a/MP-ADM/login.aspx b/MP-ADM/login.aspx index e7bf1113..ef03141b 100644 --- a/MP-ADM/login.aspx +++ b/MP-ADM/login.aspx @@ -1,8 +1,10 @@ -<%@ Page Title="MPADM | Login" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro_noAjax.master" AutoEventWireup="true" Inherits="MoonPro_site.login" Codebehind="login.aspx.cs" %> +<%@ Page Title="MPADM | Login" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro_noAjax.master" AutoEventWireup="true" Inherits="MP_ADM.login" Codebehind="login.aspx.cs" %> + +<%@ Register Src="~/WebUserControls/mod_login.ascx" TagPrefix="uc1" TagName="mod_login" %> + -<%@ Register Src="~/WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
- +
diff --git a/MP-ADM/login.aspx.cs b/MP-ADM/login.aspx.cs index 7b09792f..508db0e5 100644 --- a/MP-ADM/login.aspx.cs +++ b/MP-ADM/login.aspx.cs @@ -1,48 +1,35 @@ using System; -namespace MoonPro_site +namespace MP_ADM { - public partial class login : System.Web.UI.Page + public partial class login : BasePage { - protected string _nextPage - { - get - { - string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") - { - pagina = "menu.aspx"; - } - return pagina; - } - } - protected void Page_Load(object sender, EventArgs e) { - Mod_login1.modoLogin = SteamWare.loginMode.normale; + mod_login.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); + mod_login.Login_ok += new EventHandler(mod_login_Login_ok); + mod_login.Login_Error += new EventHandler(mod_login_Login_Error); } - void Mod_login1_Login_Error(object sender, EventArgs e) + void mod_login_Login_Error(object sender, EventArgs e) { Response.Redirect("./unauthorized.aspx"); } - void Mod_login1_Login_ok(object sender, EventArgs e) + void mod_login_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); + mod_login.Login_ok -= new EventHandler(mod_login_Login_ok); + mod_login.Login_Error -= new EventHandler(mod_login_Login_Error); } } } \ No newline at end of file diff --git a/MP-ADM/login.aspx.designer.cs b/MP-ADM/login.aspx.designer.cs index 3568f4a5..499453f8 100644 --- a/MP-ADM/login.aspx.designer.cs +++ b/MP-ADM/login.aspx.designer.cs @@ -7,18 +7,20 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { - - - public partial class login { - +namespace MP_ADM +{ + + + public partial class login + { + /// - /// Controllo Mod_login1. + /// Controllo mod_login. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::mod_login Mod_login1; + protected global::MP_ADM.WebUserControls.mod_login mod_login; } } diff --git a/MP-ADM/menu.aspx b/MP-ADM/menu.aspx index 99078a93..9879fd6a 100644 --- a/MP-ADM/menu.aspx +++ b/MP-ADM/menu.aspx @@ -1,4 +1,4 @@ -<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="MoonPro_site.menu" Title="MPADM" Codebehind="menu.aspx.cs" %> +<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="MP_ADM.menu" Title="MPADM" Codebehind="menu.aspx.cs" %> <%@ Register Src="~/WebUserControls/mod_main_help.ascx" TagName="mod_main_help" TagPrefix="uc2" %> diff --git a/MP-ADM/menu.aspx.cs b/MP-ADM/menu.aspx.cs index 4ab870ca..f50fba71 100644 --- a/MP-ADM/menu.aspx.cs +++ b/MP-ADM/menu.aspx.cs @@ -1,6 +1,6 @@ -namespace MoonPro_site +namespace MP_ADM { - public partial class menu : System.Web.UI.Page + public partial class menu : BasePage { } } \ No newline at end of file diff --git a/MP-ADM/menu.aspx.designer.cs b/MP-ADM/menu.aspx.designer.cs index d61736b5..32f00939 100644 --- a/MP-ADM/menu.aspx.designer.cs +++ b/MP-ADM/menu.aspx.designer.cs @@ -7,7 +7,8 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { +namespace MP_ADM +{ public partial class menu { diff --git a/MP-ADM/test.aspx b/MP-ADM/test.aspx index 0949ad31..3c4c8698 100644 --- a/MP-ADM/test.aspx +++ b/MP-ADM/test.aspx @@ -1,5 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" - Inherits="test" Title="Untitled Page" CodeBehind="test.aspx.cs" %> + Inherits="MP_ADM.test" Title="TEST Page" CodeBehind="test.aspx.cs" %> <%@ Register Assembly="SteamWare" Namespace="SteamWare" TagPrefix="cc1" %> diff --git a/MP-ADM/test.aspx.cs b/MP-ADM/test.aspx.cs index 3ee0225f..f11db90d 100644 --- a/MP-ADM/test.aspx.cs +++ b/MP-ADM/test.aspx.cs @@ -1,9 +1,12 @@ using System; -public partial class test : System.Web.UI.Page +namespace MP_ADM { - protected void Page_Load(object sender, EventArgs e) + public partial class test : BasePage { - lblOut.Text = string.Format("H: {0} - W: {1}", Session["WindowHeight"], Session["WindowWidth"]); + protected void Page_Load(object sender, EventArgs e) + { + lblOut.Text = string.Format("H: {0} - W: {1}", Session["WindowHeight"], Session["WindowWidth"]); + } } } diff --git a/MP-ADM/test.aspx.designer.cs b/MP-ADM/test.aspx.designer.cs index 7daffb1c..dffaf421 100644 --- a/MP-ADM/test.aspx.designer.cs +++ b/MP-ADM/test.aspx.designer.cs @@ -1,59 +1,62 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ +namespace MP_ADM +{ -public partial class test { - - /// - /// Image1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image1; - - /// - /// Image4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image4; - - /// - /// Image2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image2; - - /// - /// Image3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image3; - - /// - /// lblOut control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblOut; + public partial class test + { + + /// + /// Controllo Image1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// Controllo Image4. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image4; + + /// + /// Controllo Image2. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image2; + + /// + /// Controllo Image3. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image3; + + /// + /// Controllo lblOut. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblOut; + } } diff --git a/MP-ADM/testUtente.aspx.cs b/MP-ADM/testUtente.aspx.cs index cb47df2b..80d0038a 100644 --- a/MP-ADM/testUtente.aspx.cs +++ b/MP-ADM/testUtente.aspx.cs @@ -3,7 +3,7 @@ using System.Web.UI; namespace MP_ADM { - public partial class testUtente : System.Web.UI.Page + public partial class testUtente : BasePage { protected void Page_Load(object sender, EventArgs e) {