Altri passi avanti x pagine auth devices & utenti...

This commit is contained in:
Samuele E. Locatelli
2014-09-19 17:27:45 +02:00
parent 87b914c739
commit c71ecfb368
11 changed files with 347 additions and 22 deletions
+71
View File
@@ -0,0 +1,71 @@
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="JQMobNoCookie.master.cs" Inherits="MedPred.JQMobNoCookie" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="C2P site" />
<meta name="author" content="Steamware" />
<link rel="shortcut icon" href="~/favicon.ico" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<title><%: Page.Title %> - MedPred</title>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
<%: Scripts.Render("~/bundles/jquery") %>
<%: Scripts.Render("~/bundles/jSteamware") %>
<%: Scripts.Render("~/bundles/jquerymobile") %>
</asp:PlaceHolder>
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/themes/base/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<%--aggiunto 2014.10.15 x inserire report inline...--%>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%--<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
</Scripts>
</asp:ScriptManager>--%>
<div data-role="page" class="ui-responsive-panel" data-url="<%= Request.Url.PathAndQuery %>">
<%--<div data-role="panel" id="mypanel">
Pannello 1<br />
Pannello 1<br />
Pannello 1<br />
Pannello 1<br />
Pannello 1<br />
</div>--%>
<!-- /panel -->
<div data-role="header" data-position="fixed" data-theme="a">
</div>
<div role="main" class="ui-content">
<%--<asp:UpdatePanel ID="uppNavbar" runat="server">
<ContentTemplate>--%>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<%--</ContentTemplate>
</asp:UpdatePanel>--%>
</div>
<div data-role="footer" data-position="fixed" data-theme="a">
</div>
</div>
</form>
</body>
</html>
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MedPred
{
public partial class JQMobNoCookie : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+87
View File
@@ -0,0 +1,87 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MedPred {
public partial class JQMobNoCookie {
/// <summary>
/// Head1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
/// <summary>
/// PlaceHolder1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder PlaceHolder1;
/// <summary>
/// BundleReference1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1;
/// <summary>
/// BundleReference2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2;
/// <summary>
/// head control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder head;
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// ScriptManager1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManager1;
/// <summary>
/// ContentPlaceHolder1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1;
}
}
+8
View File
@@ -354,6 +354,7 @@
<Content Include="fonts\fontawesome-webfont.eot" />
<Content Include="fonts\FontAwesome.otf" />
<Content Include="WebUserControls\mod_reportVisita.ascx" />
<Content Include="JQMobNoCookie.Master" />
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
@@ -422,6 +423,13 @@
<Compile Include="JQMob.Master.designer.cs">
<DependentUpon>JQMob.Master</DependentUpon>
</Compile>
<Compile Include="JQMobNoCookie.Master.cs">
<DependentUpon>JQMobNoCookie.Master</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="JQMobNoCookie.Master.designer.cs">
<DependentUpon>JQMobNoCookie.Master</DependentUpon>
</Compile>
<Compile Include="jumper.aspx.cs">
<DependentUpon>jumper.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
+17 -9
View File
@@ -6,18 +6,26 @@
<div id="divUnauth">
<h1>Accesso non autorizzato</h1>
Attenzione, accesso non autorizzato all'applicazione, prego richiedere autorizzazione al responsabile.
Attenzione, accesso non autorizzato all'applicazione, prego richiedere autorizzazione al responsabile del progetto.
<br />
<br />
<br />
PUBBLICA...
<div data-role="collapsible" data-iconpos="right" data-mini="true">
<h4>Richiesta Auth Key</h4>
un utente deve digitare la sua email, il sistema controlla, se la trova inoltra richieste ad admin...
</div>
<div data-role="collapsible" data-iconpos="right" data-mini="true" data-collapsed="false">
<h4>Richiesta Reset Chiave Personale</h4>
Con questa procedura l'utente richiede il reset della propria chiave di autenticazione eprsonale. L'amministratore della piattaforma valuterà e validata la richiesta annullerà le chiavi emesse per i devices eventualmente già autorizzati ed inoltrerà, all'indirizzo email dell'utente, la nuova chiave da utilizzare per abilitare i devices desiderati.
<br />
<br />
<asp:TextBox runat="server" ID="txtEmailReq" placeholder="Prego digitare indirizzo email" />
<br />
<asp:Button runat="server" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-plus" ID="btnReqNewKey" Text="Richiedi Nuova Chiave Personale" data-theme="a" OnClick="btnReqNewKey_Click" />
<br />
<asp:Label runat="server" ID="lblOut" Text="..." Visible="false" ForeColor="Red" />
</div>
<div id="divEnrollByKey" runat="server" data-role="collapsible" data-iconpos="right" data-mini="true">
<h4>Registrazione da Auth Key</h4>
un utente deve digitare la sua email, la auth key UTENTE, in MD5 e COMPLETA... il sistema controlla (email e auth key) e rimbalza da jumper...
</div>
</div>
<br />
<div data-role="collapsible" data-iconpos="right" data-mini="true" data-theme="b" data-content-theme="b" >
<div id="divAdmin" runat="server" data-role="collapsible" data-iconpos="right" data-mini="true" data-theme="b" data-content-theme="b">
<h4>pagina admin (da fare...)</h4>
visibile SOLO ADMIN:
<br />
+47 -1
View File
@@ -1,4 +1,5 @@
using System;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -11,7 +12,52 @@ namespace MedPred
{
protected void Page_Load(object sender, EventArgs e)
{
// check visibilità controlli opzionali
checkVisibCtrl();
}
private void checkVisibCtrl()
{
// controllo se c'è chiamata x aggiungere device da authKey e mostro panel...
divEnrollByKey.Visible = (Request.QueryString["addDeviceByKey"] == "lvabe");
// se è admin vede anche i controlli x abilitare richieste utenti & co...
divAdmin.Visible = userIsAdmin;
}
public bool userIsAdmin
{
get
{
bool answ = false;
try
{
answ = user_std.UtSn.userHasRight("SuperAdmin");
}
catch
{ }
return answ;
}
}
/// <summary>
/// richiesta reset dispositivi utente
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReqNewKey_Click(object sender, EventArgs e)
{
// controllo email & co...
string email = txtEmailReq.Text.Trim();
if (email != "" && email.IndexOf("@")>0)
{
// rimando al jumper...
//Response.Redirect(string.Format("jumper?UserAuthkey={0}&USER_NAME={1}"));
Response.Redirect("UserAdmin");
}
else
{
lblOut.Text = "Attenzione! preogo inserire email valida!";
lblOut.Visible= true;
}
}
}
}
+50 -7
View File
@@ -3,15 +3,58 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MedPred
{
public partial class UserAdmin
{
namespace MedPred {
public partial class UserAdmin {
/// <summary>
/// txtEmailReq control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtEmailReq;
/// <summary>
/// btnReqNewKey control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnReqNewKey;
/// <summary>
/// lblOut control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblOut;
/// <summary>
/// divEnrollByKey control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divEnrollByKey;
/// <summary>
/// divAdmin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAdmin;
}
}
-1
View File
@@ -7,4 +7,3 @@
<li><asp:HyperLink runat="server" ID="hlAdmin" NavigateUrl="~/UserAdmin" data-icon="lock" class='<%: liClass("UserAdmin") %>'>Config</asp:HyperLink></li>
</ul>
</div>
<!-- /navbar -->
@@ -35,8 +35,6 @@ namespace MedPred.WebUserControls
answ += " ui-state-disabled";
}
}
// se admin mostro SOLO SE user in sessione è UN ADMIN...
return answ;
}
+2 -2
View File
@@ -1,5 +1,5 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/jQueryMobileNoCookie.Master" AutoEventWireup="true" CodeBehind="jumper.aspx.cs" Inherits="MedPred.jumper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
<%@ Page Title="" Language="C#" MasterPageFile="JQMobNoCookie.Master" AutoEventWireup="true" CodeBehind="jumper.aspx.cs" Inherits="MedPred.jumper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
+48
View File
@@ -854,3 +854,51 @@ System.Threading.ThreadAbortException: Thread interrotto.
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
16:47:29 9292 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
17:18:37 9759 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
17:21:37 9201 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
17:22:29 9281 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
17:26:13 6819 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74
17:26:44 1216 [EXCEPTION] - Errore in checkAuthCookie:
System.Threading.ThreadAbortException: Thread interrotto.
in System.Threading.Thread.AbortInternal()
in System.Threading.Thread.Abort(Object stateInfo)
in System.Web.HttpResponse.AbortCurrentThread()
in System.Web.HttpResponse.End()
in System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent)
in MedPred.WebUserControls.mod_header.checkAuthCookieMedPred() in c:\Users\samuele\Documents\Visual Studio 2012\Projects\MedPred\MedPred\WebUserControls\mod_header.ascx.cs:riga 74