diff --git a/CMS-SC-Data/CMS-SC-Data.csproj b/CMS-SC-Data/CMS-SC-Data.csproj index 5571831..4e50847 100644 --- a/CMS-SC-Data/CMS-SC-Data.csproj +++ b/CMS-SC-Data/CMS-SC-Data.csproj @@ -59,6 +59,7 @@ DS_Utility.xsd + True diff --git a/CMS-SC-Data/OpAuth.cs b/CMS-SC-Data/OpAuth.cs new file mode 100644 index 0000000..28da55c --- /dev/null +++ b/CMS-SC-Data/OpAuth.cs @@ -0,0 +1,130 @@ +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CMS_SC_Data +{ + /// + /// Classe gestione auth utente + /// + public class OpAuth + { + /// + /// email (univoco) + /// + public string email { get; set; } + /// + /// Cognome - Nome + /// + public string CognomeNome { get; set; } + /// + /// numero autorizzazioni ancora possibili + /// + public int remAuth { get; set; } + /// + /// scadenza massima auth + /// + public DateTime scadAuth { get; set; } + /// + /// inizializzazione componente, default da web.config MA CON AUTH + /// + protected OpAuth() + { + // imposto valori di default (scaduti...) + email = "NA"; + CognomeNome = "NA"; + remAuth = memLayer.ML.CRI("defRemAuth"); + scadAuth = DateTime.Now.AddMinutes(memLayer.ML.CRI("defMinScad")); + } + /// + /// Fornisce un oggetto OpAuth popolato da email calcolando il resto + lettura default da web.config + /// + /// + /// + public static OpAuth startOpAuth(string email) + { + OpAuth answ = new OpAuth(); + if (email != "") + { + answ.email = email; + answ.CognomeNome = "Test - completare"; // utils.obj.getOperatoreByCod(email); + } + currAuth = answ; + return answ; + } + /// + /// toglie auth utente + /// + public static void stopAuth() + { + memLayer.ML.emptySessionVal("OpAuth"); + } + /// + /// Auth Corrente x operazioni User + /// + public static OpAuth currAuth + { + get + { + OpAuth answ = new OpAuth(); + // cerco in sessione... + if (memLayer.ML.isInSessionObject("OpAuth")) + { + answ = (OpAuth)memLayer.ML.objSessionObj("OpAuth"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("OpAuth", value); + } + } + /// + /// definisce si sia valida auth operatività utente, ovvero + /// - valori in sessione + /// - num auth > 0 + /// - auth non scaduta + /// + public static bool isAuth + { + get + { + bool answ = false; + // se ho valori in sessione + if (memLayer.ML.isInSessionObject("OpAuth")) + { + // se ho num auth > 0 + if (currAuth.remAuth > 0) + { + // se non è scaduta auth.. + if (currAuth.scadAuth > DateTime.Now) + { + // se ho un email VALIDO + if (currAuth.email != "") + { + answ = true; + } + } + } + } + return answ; + } + } + /// + /// definisce se sia RICHEISTA OpAuth + /// + public static bool opAuthReq + { + get + { + // verifico SE devo fare controllo OpAuth... + return memLayer.ML.CRB("enableOpAuth"); + } + } + + + } +} diff --git a/CMS-SC-Data/bin/Debug/CMS-SC-Data.dll b/CMS-SC-Data/bin/Debug/CMS-SC-Data.dll index 1a0564b..81d8cf4 100644 Binary files a/CMS-SC-Data/bin/Debug/CMS-SC-Data.dll and b/CMS-SC-Data/bin/Debug/CMS-SC-Data.dll differ diff --git a/CMS-SC-Data/bin/Debug/SteamWare.dll b/CMS-SC-Data/bin/Debug/SteamWare.dll index 0da9c1d..c5c08d3 100644 Binary files a/CMS-SC-Data/bin/Debug/SteamWare.dll and b/CMS-SC-Data/bin/Debug/SteamWare.dll differ diff --git a/CMS-SC-Data/bin/Release/CMS-SC-Data.dll b/CMS-SC-Data/bin/Release/CMS-SC-Data.dll index 882524a..9226ab3 100644 Binary files a/CMS-SC-Data/bin/Release/CMS-SC-Data.dll and b/CMS-SC-Data/bin/Release/CMS-SC-Data.dll differ diff --git a/CMS-SC-Data/bin/Release/SteamWare.dll b/CMS-SC-Data/bin/Release/SteamWare.dll index fd6e819..bda564c 100644 Binary files a/CMS-SC-Data/bin/Release/SteamWare.dll and b/CMS-SC-Data/bin/Release/SteamWare.dll differ diff --git a/CMS-SC-Data/obj/Debug/CMS-SC-Data.dll b/CMS-SC-Data/obj/Debug/CMS-SC-Data.dll index 1a0564b..81d8cf4 100644 Binary files a/CMS-SC-Data/obj/Debug/CMS-SC-Data.dll and b/CMS-SC-Data/obj/Debug/CMS-SC-Data.dll differ diff --git a/CMS-SC-Data/obj/Release/CMS-SC-Data.dll b/CMS-SC-Data/obj/Release/CMS-SC-Data.dll index 882524a..9226ab3 100644 Binary files a/CMS-SC-Data/obj/Release/CMS-SC-Data.dll and b/CMS-SC-Data/obj/Release/CMS-SC-Data.dll differ diff --git a/CMS_SC/CMS_SC.csproj b/CMS_SC/CMS_SC.csproj index 8b49460..24b81b0 100644 --- a/CMS_SC/CMS_SC.csproj +++ b/CMS_SC/CMS_SC.csproj @@ -20,7 +20,7 @@ - False + False true @@ -377,6 +377,7 @@ + @@ -754,6 +755,13 @@ mod_enrollByJumperAuthKey.ascx + + mod_enrollUserBase.ascx + ASPXCodeBehind + + + mod_enrollUserBase.ascx + mod_fileUpload.ascx ASPXCodeBehind diff --git a/CMS_SC/Content/Style.css b/CMS_SC/Content/Style.css index f346f26..ee57afb 100644 --- a/CMS_SC/Content/Style.css +++ b/CMS_SC/Content/Style.css @@ -895,4 +895,10 @@ a:focus { height: 0; width: 0; visibility: hidden; +} +.checkOk { + color: #99FF99; +} +.checkKo { + color: #5f2121; } \ No newline at end of file diff --git a/CMS_SC/Content/Style.less b/CMS_SC/Content/Style.less index b04402d..2141250 100644 --- a/CMS_SC/Content/Style.less +++ b/CMS_SC/Content/Style.less @@ -1075,3 +1075,11 @@ a:focus { width: 0; visibility: hidden; } + +.checkOk { + color: #99FF99; +} + +.checkKo { + color: #5f2121; +} \ No newline at end of file diff --git a/CMS_SC/UserAdmin.aspx b/CMS_SC/UserAdmin.aspx index 905d805..8fd28dc 100644 --- a/CMS_SC/UserAdmin.aspx +++ b/CMS_SC/UserAdmin.aspx @@ -5,6 +5,8 @@ <%@ Register Src="WebUserControls/mod_elencoRichResetUtenti.ascx" TagName="mod_elencoRichResetUtenti" TagPrefix="uc3" %> <%@ Register Src="WebUserControls/mod_enrollByAuthKey.ascx" TagName="mod_enrollByAuthKey" TagPrefix="uc4" %> +<%@ Register Src="~/WebUserControls/mod_enrollUserBase.ascx" TagPrefix="uc2" TagName="mod_enrollUserBase" %> + @@ -13,11 +15,12 @@

<%: traduci("UserAdminTitle") %>

- <%: traduci("UserAdminInstr01") %>
+

+ <%: traduci("UserAdminInstr01") %>
diff --git a/CMS_SC/UserAdmin.aspx.cs b/CMS_SC/UserAdmin.aspx.cs index debc9bb..a7599eb 100644 --- a/CMS_SC/UserAdmin.aspx.cs +++ b/CMS_SC/UserAdmin.aspx.cs @@ -16,12 +16,14 @@ namespace CMS_SC checkVisibCtrl(); } /// - /// Controlla visibilità delle sezioni (in particolare abilitazioen da utente/AuthKey) + /// Controlla visibilità delle sezioni (in particolare abilitazione da utente/AuthKey) /// private void checkVisibCtrl() { // controllo se c'è chiamata x aggiungere device da authKey e mostro panel... mod_enrollByAuthKey1.Visible = (Request.QueryString["addDeviceByKey"] == "lvabe"); + // controllo se mostrare login "semplificato" + mod_enrollUserBase.Visible = memLayer.ML.CRB("enableOpAuth"); // se è admin vede anche i controlli x abilitare richieste utenti & co... divAdmin.Visible = userIsAdmin; divUnauth.Visible = !userIsAdmin; diff --git a/CMS_SC/UserAdmin.aspx.designer.cs b/CMS_SC/UserAdmin.aspx.designer.cs index 78d3fdf..8cc1a87 100644 --- a/CMS_SC/UserAdmin.aspx.designer.cs +++ b/CMS_SC/UserAdmin.aspx.designer.cs @@ -21,6 +21,15 @@ namespace CMS_SC { /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divUnauth; + /// + /// mod_enrollUserBase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::CMS_SC.WebUserControls.mod_enrollUserBase mod_enrollUserBase; + /// /// mod_enrollByAuthKey1 control. /// diff --git a/CMS_SC/Web.config b/CMS_SC/Web.config index fbc144c..6a21245 100644 --- a/CMS_SC/Web.config +++ b/CMS_SC/Web.config @@ -40,6 +40,12 @@ + + + + + + diff --git a/CMS_SC/WebUserControls/mod_enrollUserBase.ascx b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx new file mode 100644 index 0000000..1c88212 --- /dev/null +++ b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx @@ -0,0 +1,29 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollUserBase.ascx.cs" Inherits="CMS_SC.WebUserControls.mod_enrollUserBase" %> + + +
+
+
<%: traduci("AuthUserBaseCollaudi") %>
+
+
+
+
+ +
+
+ +
+
+ <%: traduci("btnAuthUserBase") %> +
+
+ +
+
+

<%: traduci("AuthUserBaseTitle") %>

+
+ <%: traduci("AuthUserBaseInstr01") %> +
+
+
+
diff --git a/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.cs b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.cs new file mode 100644 index 0000000..23c8fba --- /dev/null +++ b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.cs @@ -0,0 +1,56 @@ +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace CMS_SC.WebUserControls +{ + public partial class mod_enrollUserBase : SteamWare.UserControl + { + /// + /// richiesta enroll device da chiave personale + email + /// + /// + /// + protected void btnEnrollByAK_Click(object sender, EventArgs e) + { + // leggo cognome / nome x controllare email cms nome.cognome@cms.it ... + string cognome = txtCognome.Text.Trim().ToLower(); + string nome = txtNome.Text.Trim().ToLower(); + string email = string.Format("{0}.{1}@cms.it", nome, cognome); + if (email != "") + { + // ora controllo che l'email SIA nell'elenco delle email degli utenti... + if (devicesAuthProxy.stObj.checkUserEmail(email)) + { +#if false + // controllo se l'utente è "base" e quindi posso fare auth "semplificata"... + if (devicesAuthProxy.stObj.checkUserEmailAK(email, authKey)) + { + // rimando al jumper... + Response.Redirect(string.Format("jumper?UserAuthkey={0}&USER_NAME={1}", authKey, email)); + } + else + { + lblOutMsg.Text = traduci("ErrorEAK01");// "Attenzione! auth key NON valida, prego contattare amministratore!"; + lblOutMsg.Visible = true; + } +#endif + } + else + { + lblOutMsg.Text = traduci("ErrorEAK02");//"Attenzione! email non trovata, prego contattare amministratore!"; + lblOutMsg.Visible = true; + } + } + else + { + lblOutMsg.Text = traduci("ErrorEAK03");//"Attenzione! preogo inserire email valida!"; + lblOutMsg.Visible = true; + } + } + } +} \ No newline at end of file diff --git a/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.designer.cs b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.designer.cs new file mode 100644 index 0000000..574e27c --- /dev/null +++ b/CMS_SC/WebUserControls/mod_enrollUserBase.ascx.designer.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// 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 CMS_SC.WebUserControls { + + + public partial class mod_enrollUserBase { + + /// + /// txtCognome control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCognome; + + /// + /// txtNome control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNome; + + /// + /// btnEnrollByAK control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnEnrollByAK; + + /// + /// lblOutMsg control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblOutMsg; + } +} diff --git a/CMS_SC/WebUserControls/mod_testata.ascx b/CMS_SC/WebUserControls/mod_testata.ascx index dec8d0a..6dc487c 100644 --- a/CMS_SC/WebUserControls/mod_testata.ascx +++ b/CMS_SC/WebUserControls/mod_testata.ascx @@ -34,11 +34,7 @@
  • - Anagrafiche - - - -