Continuato setup pagina x accesso al sito... (manca jumper...)

This commit is contained in:
Samuele E. Locatelli
2019-10-14 19:25:34 +02:00
parent db5dbe5688
commit 74e141daed
9 changed files with 184 additions and 50 deletions
+34 -25
View File
@@ -16,39 +16,48 @@
<div class="col">
<label for="txtEmail">Email address:</label>
<asp:RequiredFieldValidator ID="rfvEmail" runat="server" ErrorMessage="!!!" ControlToValidate="txtEmail" CssClass="text-danger"></asp:RequiredFieldValidator>
<asp:TextBox runat="server" ID="txtEmail" TextMode="Email" CssClass="form-control"></asp:TextBox>
<asp:TextBox runat="server" ID="txtEmail" TextMode="Email" CssClass="form-control" AutoPostBack="True" OnTextChanged="txtEmail_TextChanged"></asp:TextBox>
<small id="emailHelp" class="form-text text-muted"><b>Obbligatorio.</b> L'indirizzo email sarà l'identificativo univoco con cui sarà gestita l'utenza. Il token di accesso univoco sarà inviato a tale indirizzo. Le informazioni riguardo inizio e fine del calcolo sottoscritto saranno inviate allo stesso indirizzo indicato.</small>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="txtNome">Nome</label>
<asp:RequiredFieldValidator ID="rfvNome" runat="server" ErrorMessage="!!!" ControlToValidate="txtNome" CssClass="text-danger"></asp:RequiredFieldValidator>
<asp:TextBox runat="server" ID="txtNome" CssClass="form-control" />
<small id="txtNomeHelp" class="form-text text-muted"><b>Obbligatorio.</b></small>
<div id="divAddNew" runat="server">
<div class="form-row">
<div class="col">
<label for="txtNome">Nome</label>
<asp:RequiredFieldValidator ID="rfvNome" runat="server" ErrorMessage="!!!" ControlToValidate="txtNome" CssClass="text-danger"></asp:RequiredFieldValidator>
<asp:TextBox runat="server" ID="txtNome" CssClass="form-control" />
<small id="txtNomeHelp" class="form-text text-muted"><b>Obbligatorio.</b></small>
</div>
<div class="col">
<label for="txtCognome">Cognome</label>
<asp:RequiredFieldValidator ID="rfvCognome" runat="server" ErrorMessage="!!!" ControlToValidate="txtCognome" CssClass="text-danger"></asp:RequiredFieldValidator>
<asp:TextBox runat="server" ID="txtCognome" CssClass="form-control" />
<small id="txtCognomeHelp" class="form-text text-muted"><b>Obbligatorio.</b></small>
</div>
</div>
<div class="col">
<label for="txtCognome">Cognome</label>
<asp:RequiredFieldValidator ID="rfvCognome" runat="server" ErrorMessage="!!!" ControlToValidate="txtCognome" CssClass="text-danger"></asp:RequiredFieldValidator>
<asp:TextBox runat="server" ID="txtCognome" CssClass="form-control" />
<small id="txtCognomeHelp" class="form-text text-muted"><b>Obbligatorio.</b></small>
<div class="form-row">
<div class="col">
<label for="txtIstituto">Istituto / Azienda (facoltativo)</label>
<asp:TextBox runat="server" ID="txtIstituto" CssClass="form-control" />
<small id="txtIstitutoHelp" class="form-text text-muted"><b>Facoltativo.</b> L'istituto/azienda di appartenenza sarà usato solo a fini statistici interni.</small>
</div>
</div>
<div class="form-row mt-3">
<div class="col">
<asp:LinkButton runat="server" ID="lbtRegistra" CssClass="btn btn-block btn-success" OnClick="lbtRegistra_Click"><i class="fa fa-floppy-o" aria-hidden="true"></i> Salva</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbtAnnulla" CssClass="btn btn-block btn-warning" OnClick="lbtAnnulla_Click"><i class="fa fa-ban" aria-hidden="true"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="txtIstituto">Istituto / Azienda (facoltativo)</label>
<asp:TextBox runat="server" ID="txtIstituto" CssClass="form-control" />
<small id="txtIstitutoHelp" class="form-text text-muted"><b>Facoltativo.</b> L'istituto/azienda di appartenenza sarà usato solo a fini statistici interni.</small>
<div id="divResendToken" runat="server">
<div class="form-row mt-3">
<div class="col">
<asp:LinkButton runat="server" ID="lbtResedToken" CssClass="btn btn-block btn-info" OnClick="lbtResedToken_Click"><i class="fa fa-envelope-o" aria-hidden="true"></i> Reinvia token</asp:LinkButton>
</div>
</div>
</div>
<div class="form-row mt-3">
<div class="col">
<asp:LinkButton runat="server" ID="lbtRegistra" CssClass="btn btn-block btn-success" OnClick="lbtRegistra_Click"><i class="fa fa-floppy-o" aria-hidden="true"></i> Salva</asp:LinkButton>
</div>
<div class="col">
<asp:LinkButton runat="server" ID="lbtAnnulla" CssClass="btn btn-block btn-warning" OnClick="lbtAnnulla_Click"><i class="fa fa-ban" aria-hidden="true"></i> Annulla</asp:LinkButton>
</div>
</div>
</div>
<div class="card-footer">
<b>Attenzione:</b> utilizzando questo servizio si accettano le <a href="../CondizioniServizio" target="_blank">Condizioni d'uso del servizio</a> che è possibile visionare <a href="../CondizioniServizio" target="_blank">all'apposita pagina</a>.
+33 -2
View File
@@ -19,7 +19,7 @@ namespace WebLCP.WUC
if (cognome != "" && nome != "")
{
// verifico in primis SE email esistesse..
if (DataWrap.DW.taUtente.getByUserName(email).Count > 0)
if (devicesAuthProxy.stObj.taUtenti.getByEmail(email).Count > 0)
{
lblOut.Text = "Attenzione: email già registrata, prego correggere o procedere con reinvio token accesso";
lblOut.Visible = true;
@@ -28,7 +28,8 @@ namespace WebLCP.WUC
else
{
// se non esiste --> registro!
user_std.UtSn.creaUtente("ND", email, cognome, nome, "", email, "000", "");
string authKey = devicesAuthProxy.RandomString(20, true);
devicesAuthProxy.stObj.taUtenti.InsertQuery(email, cognome, nome, authKey, 1500, "");
lblOut.Text = "Utente registrato! a breve riceverete un email per l'accesso all'indirizzo indicato.";
lblOut.Visible = true;
lblOut.CssClass = "text-success";
@@ -100,6 +101,36 @@ namespace WebLCP.WUC
email = "";
istituto = "";
nome = "";
// nascondo i div...
divAddNew.Visible = false;
divResendToken.Visible = false;
}
protected void txtEmail_TextChanged(object sender, EventArgs e)
{
// controllo se esistente e da qui decido cosa mostrare...
bool showAddNew = (devicesAuthProxy.stObj.taUtenti.getByEmail(email).Count == 0);
divAddNew.Visible = showAddNew;
divResendToken.Visible = !showAddNew;
}
protected void lbtResedToken_Click(object sender, EventArgs e)
{
// effettua reinvio token via email..
DS_Auth.UtentiDataTable tabUtente = devicesAuthProxy.stObj.taUtenti.getByEmail(email);
if (tabUtente.Count == 1)
{
var rigaUtente = tabUtente[0];
string subject = "Invio token di accesso al sito www.admodelling.org";
string body = "Buongiorno,<br/><br/>Questo è un messaggio automatico generato dalla piattaforma {3} per conto dell'amministratore.<br/><br/><a href=\"{0}/jumper?UserAuthkey={1}&USER_NAME={2}\">Si prega di cliccare sul seguente link (o di copiarlo ed incollarlo nel browser preferito)</a> per abilitare all'accesso al sito {3} il dispositivo corrente.<br/><br/>Saluti." +
"<br/><hr/><br/>" +
"Hi,<br/><br/>This is an automatic message generated by {3} platform on behalf of platform admin.<br/><br/><a href=\"{0}/jumper?UserAuthkey={1}&USER_NAME={2}\">Please click on following link (or cut/paste to your preferred browser)</a> to enable current device to {3} login.<br/><br/>Regards.";
devicesAuthProxy.stObj.sendEmailAuthKey(rigaUtente.email, rigaUtente.authKey, "www.admodelling.org", subject, body);
lblOut.Text = "Utente trovato! a breve riceverete un email con il token per l'accesso all'indirizzo indicato.";
lblOut.Visible = true;
lblOut.CssClass = "text-success";
}
}
}
}
+27
View File
@@ -39,6 +39,15 @@ namespace WebLCP.WUC {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtEmail;
/// <summary>
/// Controllo divAddNew.
/// </summary>
/// <remarks>
/// 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.HtmlControls.HtmlGenericControl divAddNew;
/// <summary>
/// Controllo rfvNome.
/// </summary>
@@ -101,5 +110,23 @@ namespace WebLCP.WUC {
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtAnnulla;
/// <summary>
/// Controllo divResendToken.
/// </summary>
/// <remarks>
/// 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.HtmlControls.HtmlGenericControl divResendToken;
/// <summary>
/// Controllo lbtResedToken.
/// </summary>
/// <remarks>
/// 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.LinkButton lbtResedToken;
}
}
+50 -18
View File
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
Per altre informazioni su come configurare l'applicazione ASP.NET, vedere
https://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="AdmodellingConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=Admodelling;User ID=sa;Password=keyhammer16"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
@@ -24,7 +20,6 @@
<!--Configurazioni generali-->
<add key="intUpdatePagina_ms" value="120000" />
<add key="appName" value="WLP" />
<add key="CodModulo" value="WLP" />
<add key="copyRight" value="Steamware " />
<!--area logger-->
<add key="_logDir" value="~/logs/" />
@@ -33,6 +28,35 @@
<add key="_logLevel" value="6" />
<add key="_logMaxMb" value="30" />
<add key="logMitigSec" value="30" />
<!--nome sw e versioni-->
<add key="CodModulo" value="WLP" />
<add key="AutoAuth" value="true" />
<add key="Ambient" value="DEV" />
<add key="urlType" value="http" />
<add key="baseUrl" value="http://iis02/test/admodelling" />
<add key="SiteName" value="iis02/test/admodelling" />
<!--gestione auth dispositivi-->
<add key="AuthCookieName" value="admodellingAuth" />
<add key="defaultDomain" value="admod" />
<add key="enablePlain" value="true" />
<add key="urlGestUtenti" value="UserAdmin" />
<add key="adminEmail" value="samuele@steamware.net" />
<!--<add key="PageNoIndex" value="UserAdmin#About#Contact#Login#MainMenu" />-->
<!--Gestione email-->
<add key="_fromEmail" value="webmaster@admodelling.org" />
<add key="_useAuthSmtp" value="true" />
<add key="_useAIMSmtp" value="false" />
<!--<add key="_srvSender" value="www.admodelling.org" />
<add key="_msgPriority" value="high" />
<add key="_smtpTimeout" value="5000" />-->
<add key="_smtpCli" value="smtp.gmail.com" />
<add key="_emailUser" value="steamwarebot@gmail.com" />
<add key="_emailPwd" value="drmfsls16" />
<add key="_enableSSL" value="true" />
<!--<add key="_smtpCli" value="ssl0.ovh.net" />
<add key="_emailUser" value="comunicazioni@b2bcondomini.it" />
<add key="_emailPwd" value="b2b.2018!***" />
<add key="_enableSSL" value="true" />-->
<!--Impostazione gestione serializzazione variabili in sessione (es per Redis)-->
<add key="serializeSession" value="true" />
<add key="errorPageRedirect" value="./Reset?Action=CDV" />
@@ -45,21 +69,29 @@
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false,allowAdmin=true" />
<add key="redisDb" value="5" />
<!--Conf DB-->
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Admodelling;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Admodelling;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Admodelling;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Admodelling;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
</appSettings>
<connectionStrings>
<add name="AdmodellingConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=Admodelling;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
+6 -3
View File
@@ -92,8 +92,8 @@
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath>
</Reference>
<Reference Include="SteamWare, Version=3.3.1910.671, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SteamWare.3.3.1910.671\lib\net462\SteamWare.dll</HintPath>
<Reference Include="SteamWare, Version=3.3.1910.673, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SteamWare.3.3.1910.673\lib\net462\SteamWare.dll</HintPath>
</Reference>
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
@@ -176,6 +176,7 @@
</Content>
<Content Include="Default.aspx" />
<Content Include="example-favicon.ico" />
<Content Include="ExtLibrary\ICSharpCode.SharpZipLib.dll" />
<Content Include="favicon.ico" />
<Content Include="fonts\fontawesome-webfont.svg" />
<Content Include="Global.asax" />
@@ -210,7 +211,6 @@
<Content Include="fonts\fontawesome-webfont.ttf" />
<Content Include="fonts\fontawesome-webfont.eot" />
<Content Include="NLog.config" />
<Content Include="example-app.config" />
<Content Include="DS_App.xsc">
<DependentUpon>DS_App.xsd</DependentUpon>
</Content>
@@ -222,6 +222,9 @@
<Content Include="DS_App.xss">
<DependentUpon>DS_App.xsd</DependentUpon>
</Content>
<Content Include="logs\PlaceHolder.file" />
<Content Include="example-NLog.config" />
<Content Include="example-app.config" />
<None Include="Properties\PublishProfiles\IIS01.pubxml" />
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
<!-- optional, add some variabeles
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets async="true">
<target xsi:type="File"
name="SteamWareLib"
fileName="${basedir}/logs/${shortdate}-SteamWare.log"
layout="${longdate} ${uppercase:${level}} ${message}"
/>
</targets>
<rules>
<logger name="SteamWare.*" minlevel="Debug" writeTo="SteamWareLib" />
</rules>
</nlog>
+1
View File
@@ -0,0 +1 @@

+1 -1
View File
@@ -25,7 +25,7 @@
<package id="popper.js" version="1.14.3" targetFramework="net462" />
<package id="SharpZipLib" version="1.2.0" targetFramework="net462" />
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net462" />
<package id="SteamWare" version="3.3.1910.671" targetFramework="net462" />
<package id="SteamWare" version="3.3.1910.673" targetFramework="net462" />
<package id="System.Buffers" version="4.5.0" targetFramework="net462" />
<package id="System.Diagnostics.PerformanceCounter" version="4.6.0" targetFramework="net462" />
<package id="System.IO.Pipelines" version="4.6.0" targetFramework="net462" />
Vendored
+1 -1
View File
@@ -17,7 +17,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=31']) {
withEnv(['NEXT_BUILD_NUMBER=32']) {
// env.versionNumber = VersionNumber(versionNumberString : '0.8.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '0.8.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'LCP'