diff --git a/Jenkinsfile b/Jenkinsfile index cd3ef946..191af7f3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1017']) { + withEnv(['NEXT_BUILD_NUMBER=1018']) { // env.versionNumber = VersionNumber(versionNumberString : '6.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' diff --git a/MP-TAB/WebUserControls/mod_QRScanner.ascx b/MP-TAB/WebUserControls/mod_QRScanner.ascx index 5f664133..65f377f2 100644 --- a/MP-TAB/WebUserControls/mod_QRScanner.ascx +++ b/MP-TAB/WebUserControls/mod_QRScanner.ascx @@ -16,9 +16,16 @@ let scanner = new Instascan.Scanner({ video: document.getElementById('preview') }); scanner.addListener('scan', function (content) { //console.log(content); - document.getElementById('<%= txtQRCode.ClientID %>').value = content; - document.getElementById('<%= hlReload.ClientID %>').href = content; - document.getElementById('<%= hlReload.ClientID %>').click(); + var isUrl = content.includes("http"); + if (isUrl) { + // se content è un URL --> faccio reload... + document.getElementById('<%= hlReload.ClientID %>').href = content; + document.getElementById('<%= hlReload.ClientID %>').click(); + } + else { + // altrimenti salvo in textBox e processo + document.getElementById('<%= txtQRCode.ClientID %>').value = content; + } }); Instascan.Camera.getCameras().then(function (cameras) { if (cameras.length > 0) { diff --git a/MP-TAB/WebUserControls/mod_QRScanner.ascx.cs b/MP-TAB/WebUserControls/mod_QRScanner.ascx.cs index 624846a0..008abafd 100644 --- a/MP-TAB/WebUserControls/mod_QRScanner.ascx.cs +++ b/MP-TAB/WebUserControls/mod_QRScanner.ascx.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +using MapoDb; +using SteamWare; +using System; using System.Web.UI; -using System.Web.UI.WebControls; namespace MoonProTablet.WebUserControls { @@ -11,7 +9,7 @@ namespace MoonProTablet.WebUserControls { protected void Page_Load(object sender, EventArgs e) { - // Richeisto https + // Richiesto https // basato su instascan: // https://github.com/schmich/instascan if (!Page.IsPostBack) @@ -23,6 +21,21 @@ namespace MoonProTablet.WebUserControls protected void txtQRCode_TextChanged(object sender, EventArgs e) { + // se abilitato login "pwdOnly" rimando a login... + if (memLayer.ML.cdvb("loginPwdOnly")) + { + string UserAuthKey = txtQRCode.Text.Trim(); + // cerco se la pwd valida ci sia... + var results = DataLayer.obj.taOp.getByAuthKey(UserAuthKey); + if (results.Count > 0) + { + // in questo caso rimando a jumper... + int MatrOpr = results[0].MatrOpr; + // rimando a pagina login con pwdOnly... + Response.Redirect(string.Format("jumper?MatrOpr={0}&UserAuthKey={1}", MatrOpr, UserAuthKey)); + } + } + //// rimando a pagina di login... //Response.Redirect(txtQRCode.Text.Trim()); //hlReload.NavigateUrl=txtQRCode.Text.Trim(); diff --git a/MapoDb/DS_applicazione.Designer.cs b/MapoDb/DS_applicazione.Designer.cs index 255782c1..139ce1e8 100644 --- a/MapoDb/DS_applicazione.Designer.cs +++ b/MapoDb/DS_applicazione.Designer.cs @@ -22329,24 +22329,30 @@ SELECT MatrOpr, Cognome, Nome, isAdmin, authKey FROM AnagraficaOperatori WHERE ( [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM dbo.AnagraficaOperatori"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "dbo.stp_AO_getByMatrAuthKey"; + this._commandCollection[1].CommandText = "dbo.stp_AO_getByAuthKey"; this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@authKey", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_AO_getByMatr"; + this._commandCollection[2].CommandText = "dbo.stp_AO_getByMatrAuthKey"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@authKey", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[3].Connection = this.Connection; + this._commandCollection[3].CommandText = "dbo.stp_AO_getByMatr"; + this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -22377,8 +22383,25 @@ SELECT MatrOpr, Cognome, Nome, isAdmin, authKey FROM AnagraficaOperatori WHERE ( [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_applicazione.AnagraficaOperatoriDataTable getByMatrAuthKey(global::System.Nullable MatrOpr, string authKey) { + public virtual DS_applicazione.AnagraficaOperatoriDataTable getByAuthKey(string authKey) { this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((authKey == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(authKey)); + } + DS_applicazione.AnagraficaOperatoriDataTable dataTable = new DS_applicazione.AnagraficaOperatoriDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_applicazione.AnagraficaOperatoriDataTable getByMatrAuthKey(global::System.Nullable MatrOpr, string authKey) { + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((MatrOpr.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(MatrOpr.Value)); } @@ -22401,7 +22424,7 @@ SELECT MatrOpr, Cognome, Nome, isAdmin, authKey FROM AnagraficaOperatori WHERE ( [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_applicazione.AnagraficaOperatoriDataTable getByMatrOpr(global::System.Nullable MatrOpr) { - this.Adapter.SelectCommand = this.CommandCollection[2]; + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((MatrOpr.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(MatrOpr.Value)); } diff --git a/MapoDb/DS_applicazione.xsd b/MapoDb/DS_applicazione.xsd index 67f9b470..24be1602 100644 --- a/MapoDb/DS_applicazione.xsd +++ b/MapoDb/DS_applicazione.xsd @@ -1678,6 +1678,17 @@ SELECT MatrOpr, Cognome, Nome, isAdmin, authKey FROM AnagraficaOperatori WHERE ( + + + + dbo.stp_AO_getByAuthKey + + + + + + + @@ -3008,7 +3019,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3030,7 +3041,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3066,7 +3077,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3102,7 +3113,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3119,7 +3130,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3143,7 +3154,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3185,7 +3196,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3264,7 +3275,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3293,7 +3304,7 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - + @@ -3444,26 +3455,26 @@ SELECT CodGruppo, TipoGruppo, DescrGruppo FROM AnagraficaGruppi WHERE (CodGruppo - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MapoDb/DS_applicazione.xss b/MapoDb/DS_applicazione.xss index 55b80b73..36b25022 100644 --- a/MapoDb/DS_applicazione.xss +++ b/MapoDb/DS_applicazione.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -20,7 +20,7 @@ - + @@ -298,7 +298,7 @@ 982 - 891 + 914 982