fix invio email auth x GPW da smartphone

This commit is contained in:
Samuele E. Locatelli
2017-04-13 10:00:06 +02:00
parent ed7461a74f
commit 476b19a935
12 changed files with 79 additions and 81 deletions
BIN
View File
Binary file not shown.
+6 -6
View File
@@ -43,8 +43,8 @@ Global
{6427F4E4-105A-4918-BAB4-5F94234320E4}.Release|Any CPU.Build.0 = Release|Any CPU
{6427F4E4-105A-4918-BAB4-5F94234320E4}.SPS|Any CPU.ActiveCfg = Release|Any CPU
{6427F4E4-105A-4918-BAB4-5F94234320E4}.SPS|Any CPU.Build.0 = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.Debug|Any CPU.Build.0 = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.ETS|Any CPU.ActiveCfg = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.ETS|Any CPU.Build.0 = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
@@ -55,8 +55,8 @@ Global
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.Release|Any CPU.Build.0 = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.SPS|Any CPU.ActiveCfg = Release|Any CPU
{7BEA5D99-8486-4592-B01D-FE2C76EB66CF}.SPS|Any CPU.Build.0 = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.Debug|Any CPU.Build.0 = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.ETS|Any CPU.ActiveCfg = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.ETS|Any CPU.Build.0 = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
@@ -67,8 +67,8 @@ Global
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.Release|Any CPU.Build.0 = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.SPS|Any CPU.ActiveCfg = Release|Any CPU
{A8543046-1C1B-4810-BC08-9AA7F9814BB0}.SPS|Any CPU.Build.0 = Release|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.Debug|Any CPU.Build.0 = Release|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.ETS|Any CPU.ActiveCfg = Release|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.ETS|Any CPU.Build.0 = Release|Any CPU
{2872DCFE-8B46-43B2-BAA0-842A816A2DD5}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
+5 -11
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SteamWare;
using SteamWare;
using System;
namespace GPW_data
{
@@ -120,7 +117,6 @@ namespace GPW_data
public bool sendUserAuthEmail(string destinatario, string UserAuthKey, int idxDipendente)
{
bool fatto = false;
string smtpCli = "";
string mittente = "";
string oggetto = "";
string userUrl = "";
@@ -131,16 +127,14 @@ namespace GPW_data
try
{
// compongo la stringa
smtpCli = memLayer.ML.confReadString("_smtpCli");
mittente = memLayer.ML.confReadString("_fromEmail");
oggetto = "Link autorizzazione device per GPW";
baseUrl = memLayer.ML.confReadString("baseUrl");
baseWebUrl = memLayer.ML.confReadString("baseWebUrl");
userUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseUrl);
userWebUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseWebUrl);
userUrl = string.Format("{2}jumper?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseUrl);
userWebUrl = string.Format("{2}jumper?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseWebUrl);
corpo = string.Format("Hai ricevuto questa email su richiesta tua o dell'Admin per poter procedere a registrare un (nuovo) devices con GPW:{0}<br/>Per proseguire clicca sul link seguente(rete interna):<br />{0}{0}{1}{0}{0}<br /><br />oppure sul link seguente (internet):<br />{0}{0}{2}{0}{0}<br /><br />Team GPW Steamware", Environment.NewLine, userUrl, userWebUrl);
gestEmail.ge.mandaEmail(mittente, destinatario, oggetto, corpo);
fatto = true;
fatto = gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo);
}
catch
{ }
+3 -11
View File
@@ -3,17 +3,6 @@
@import url('ExtraComp.css');
@import url('BtnReport.css');
@import url('JQClock.css');
* {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
*:before,
*:after {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.logo {
background-image: url(../images/logo_sw.png);
-khtml-opacity: .50;
@@ -115,4 +104,7 @@ A:hover {
width: 100%;
background-attachment: scroll;
background-repeat: no-repeat;
}
.textError {
color: red;
}
+4
View File
@@ -122,3 +122,7 @@ A:hover
background-attachment: scroll;
background-repeat: no-repeat;
}
.textError{
color: red;
}
+1 -1
View File
@@ -1 +1 @@
@import url('MasterPage.css');@import url('BuildBlocks.css');@import url('ExtraComp.css');@import url('BtnReport.css');@import url('JQClock.css');.logo{background-image:url(../images/logo_sw.png);-khtml-opacity:.5;-moz-opacity:.5;-ms-filter:"alpha(opacity=50)";filter:alpha(opacity=50);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=.5);opacity:.5;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.logo:hover{background-image:url(../images/logo_sw.png);-khtml-opacity:1;-moz-opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);opacity:1;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.bodyMainCenter{vertical-align:middle;border-left:#0d0083 1px solid;text-align:center;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyCenter{vertical-align:middle;text-align:center;height:100%;width:100%;}.centerMenu{background-color:#fff;text-align:center;border-width:thin;border-style:groove;border-color:#00f;}A:hover{color:#f00;}.bodyMain{vertical-align:top;border-left:#0d0083 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainEmpty{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainWhite{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainWhite a:hover{color:#fff;}.bodyMainNoLogo{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainLogoPiccolo{background-image:url(../images/sfondoMedio.png);background-position:97% 210px;vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-attachment:scroll;background-repeat:no-repeat;}
@import url('MasterPage.css');@import url('BuildBlocks.css');@import url('ExtraComp.css');@import url('BtnReport.css');@import url('JQClock.css');.logo{background-image:url(../images/logo_sw.png);-khtml-opacity:.5;-moz-opacity:.5;-ms-filter:"alpha(opacity=50)";filter:alpha(opacity=50);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=.5);opacity:.5;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.logo:hover{background-image:url(../images/logo_sw.png);-khtml-opacity:1;-moz-opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100);filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);opacity:1;width:800px;height:300px;margin:50px auto 50px auto;vertical-align:middle;background-repeat:no-repeat;}.bodyMainCenter{vertical-align:middle;border-left:#0d0083 1px solid;text-align:center;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyCenter{vertical-align:middle;text-align:center;height:100%;width:100%;}.centerMenu{background-color:#fff;text-align:center;border-width:thin;border-style:groove;border-color:#00f;}A:hover{color:#f00;}.bodyMain{vertical-align:top;border-left:#0d0083 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainEmpty{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainWhite{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-position:center;background-attachment:scroll;background-repeat:no-repeat;}.bodyMainWhite a:hover{color:#fff;}.bodyMainNoLogo{vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;}.bodyMainLogoPiccolo{background-image:url(../images/sfondoMedio.png);background-position:97% 210px;vertical-align:top;border-left:#800000 1px solid;height:100%;width:100%;background-attachment:scroll;background-repeat:no-repeat;}.textError{color:#f00;}
@@ -9,7 +9,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="description" content="GPW site" />
<meta name="description" content="GPW SMART site" />
<meta name="author" content="Steamware" />
<link rel="shortcut icon" href="~/favicon.ico" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
@@ -23,31 +23,39 @@
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
<%: Scripts.Render("~/bundles/jquery") %>
<%: Scripts.Render("~/bundles/jSteamware") %>
<%: Scripts.Render("~/bundles/jqueryui") %>
<%: Scripts.Render("~/bundles/jquerymobile") %>
</asp:PlaceHolder>
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/bootstrap" />
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/jqm" />
<webopt:BundleReference ID="BundleReference3" runat="server" Path="~/Content/nativeDroid/droid" />
<webopt:BundleReference ID="BundleReference4" runat="server" Path="~/Content/bootstrap" />
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
<webopt:BundleReference ID="BundleReference5" runat="server" Path="~/Content/roboto" />
<%--DA VERIFICARE QUESTI in inclusione...--%>
<link href="~/Content/Style.css" rel="stylesheet" type="text/css" />
<link href="~/Content/StyleCustom.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div data-role="page">
<div data-role="header" data-position="fixed">
<h1>Registrazione Device
</h1>
<div data-role="header" data-position="fixed" class="wow">
<h3>Registrazione Device
</h3>
</div>
<div data-role="content">
<div role="main" class="ui-content" data-inset="false">
<asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>
</div>
<div data-role="footer" data-position="fixed" data-theme="a">
<uc1:mod_footer ID="mod_footer1" runat="server" />
</div>
</div>
<asp:PlaceHolder ID="PlaceHolder2" runat="server">
<%: Scripts.Render("~/bundles/droid") %>
</asp:PlaceHolder>
</form>
</body>
</html>
@@ -1,26 +1,21 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_enrollByEmail.ascx.cs"
Inherits="GPW.WebUserControls.mod_enrollByEmail" %>
<h3>
Reset AuthKey via email</h3>
<label for="txtUserEmail">
Email utente:</label>
<h3>Reset AuthKey via email</h3>
<label for="txtUserEmail">Email utente:</label>
<asp:TextBox runat="server" ID="txtUserEmail" />
<br />
<asp:Label runat="server" ID="lblWarning" Visible="false" />
<asp:Label runat="server" ID="lblWarning" Visible="false" CssClass="textError" />
<div class="ui-grid-a">
<div class="ui-block-a">
<asp:Button runat="server" ID="btnConferma" Text="Salva" OnClick="btnConferma_Click" CssClass="ui-btn ui-btn-icon-left ui-mini ui-icon-check clr-btn-green" />
<asp:Button runat="server" ID="btnConferma" Text="Invia" OnClick="btnConferma_Click" CssClass="ui-btn ui-btn-icon-left ui-corner-all clr-btn-green" />
</div>
<div class="ui-block-b">
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" CausesValidation="false" OnClick="btnAnnulla_Click" CssClass="ui-btn ui-btn-icon-left ui-mini ui-icon-check clr-btn-orange" />
<asp:Button runat="server" ID="btnAnnulla" Text="Annulla" CausesValidation="false" OnClick="btnAnnulla_Click" CssClass="ui-btn ui-btn-icon-left clr-btn-orange" />
</div>
</div>
<div data-role="content">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
<h3>
Spiegazione</h3>
Questa funzione permette di inserire un email e se questa è tra quelle registrate
per i dipendenti sarà generata una nuova AuthKey personale e verrà inviato all'email
stessa il link con tale key di autoenroll.
<h3>Spiegazione</h3>
Questa funzione permette di inserire un email e se questa è tra quelle registrate per i dipendenti sarà generata una nuova AuthKey personale e verrà inviato all'email stessa il link con tale key di autoenroll.
</div>
</div>
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GPW_data;
using SteamWare;
using GPW_data;
using System;
namespace GPW.WebUserControls
{
@@ -13,7 +8,6 @@ namespace GPW.WebUserControls
{
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// salvo nuovo device...
@@ -26,6 +20,7 @@ namespace GPW.WebUserControls
int idxDipendente = 0;
string UserAuthKey = "";
string destinatario = "";
bool fatto = false;
DS_Applicazione.DipendentiRow dipendente = null;
try
{
@@ -39,13 +34,23 @@ namespace GPW.WebUserControls
if (destinatario != "" && idxDipendente > 0)
{
// invio email...
DataProxy.DP.sendUserAuthEmail(destinatario, UserAuthKey, idxDipendente);
logger.lg.scriviLog(string.Format("Inviata mail x auth smart device: destinatario: {0}, authKey: {1}, idxDip: {2}", destinatario, UserAuthKey, idxDipendente), tipoLog.INFO);
fatto = DataProxy.DP.sendUserAuthEmail(destinatario, UserAuthKey, idxDipendente);
if (fatto)
{
logger.lg.scriviLog(string.Format("Inviata mail x auth smart device: destinatario: {0}, authKey: {1}, idxDip: {2}", destinatario, UserAuthKey, idxDipendente), tipoLog.INFO);
lblWarning.Text = "Email inviata!";
lblWarning.Visible = true;
}
else
{
lblWarning.Text = "ERRORE in invio email auth!";
lblWarning.Visible = true;
}
}
else
{
lblWarning.Text = "Email non valida/dipendente non trovato!";
lblWarning.Visible = false;
lblWarning.Visible = true;
}
}
+17 -17
View File
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace GPW.WebUserControls {
@@ -13,38 +13,38 @@ namespace GPW.WebUserControls {
public partial class mod_enrollByEmail {
/// <summary>
/// txtUserEmail control.
/// Controllo txtUserEmail.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtUserEmail;
/// <summary>
/// lblWarning control.
/// Controllo lblWarning.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblWarning;
/// <summary>
/// btnConferma control.
/// Controllo btnConferma.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnConferma;
/// <summary>
/// btnAnnulla control.
/// Controllo btnAnnulla.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAnnulla;
}
@@ -6,12 +6,12 @@
<%@ Register src="mod_enrollByEmail.ascx" tagname="mod_enrollByEmail" tagprefix="uc3" %>
<div data-role="content">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
<div data-role="collapsible" data-iconpos="right" data-theme="a">
<uc1:mod_enrollByAuthKey ID="mod_enrollByAuthKey1" runat="server" />
</div>
</div>
<div data-role="content">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-content-theme="a">
<div data-role="collapsible" data-iconpos="right" data-theme="a" data-collapsed="false">
<uc3:mod_enrollByEmail ID="mod_enrollByEmail1" runat="server" />
</div>
</div>