Abbozzato UserAdmin Page x login...
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
body {
|
||||
padding-top: 50px;
|
||||
padding-bottom: 20px;
|
||||
background: url('../images/Condomini_01.jpeg') no-repeat center center fixed;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
/* Wrapping element */
|
||||
/* Set some basic padding to keep content from hitting the edges */
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MainMenu.aspx.cs" Inherits="PUB.MainMenu" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="JumboTronContent" runat="server">
|
||||
<div class="jumbotron py-3">
|
||||
<div class="container">
|
||||
<h1>SOSCONDOMINI.NET</h1>
|
||||
<p class="lead">Questo potrebbe diventare un carosello di presentazione, decidendo cosa scrivere.</p>
|
||||
<p><a href="~/About" class="btn btn-primary btn-lg">Per maggiori informazioni »</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div style="min-height: 12em;">
|
||||
<h2>CONDOMINI</h2>
|
||||
<p>
|
||||
Se il tuo amministratore ha aderito all'iniziativa da qui puoi verificare lo stato degli interventi in corso, di quelli programmati e di tutto il registro interventi passati che riguardano i fabbricati di tua competenza.
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<a class="btn btn-outline-success" href="PCO/MyDashboard">Accesso CONDOMINO »</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div style="min-height: 12em;">
|
||||
<h2>AMMINISTRATORI</h2>
|
||||
<p>
|
||||
Se sei un amministratore puoi avere maggiori informazioni per aderire al servizio o procedere direttametne alla tua area gestionale del link seguente
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<a class="btn btn-outline-warning" href="PAM/MyDashboard">Portale AMMINISTRATORI »</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div style="min-height: 12em;">
|
||||
<h2>AZIENDE</h2>
|
||||
<p>
|
||||
Se sei un piccolo artigiano o rappresenti un azienda di servizi e sei interessato a partecipare al nostro portale e alle nostre iniziative clicca qui per avere maggiori informazioni o accedere alla tua area riservata.
|
||||
</p>
|
||||
</div>
|
||||
<p>
|
||||
<a class="btn btn-outline-secondary" href="PAZ/MyDashboard">Portale AZIENDE »</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@@ -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 PUB
|
||||
{
|
||||
public partial class MainMenu : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+15
@@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PUB {
|
||||
|
||||
|
||||
public partial class MainMenu {
|
||||
}
|
||||
}
|
||||
@@ -175,6 +175,7 @@
|
||||
<Content Include="images\RadarDemo.png" />
|
||||
<Content Include="jumper.aspx" />
|
||||
<Content Include="Login.aspx" />
|
||||
<Content Include="MainMenu.aspx" />
|
||||
<Content Include="PAM\MyDashboard.aspx" />
|
||||
<Content Include="PAZ\MyDashboard.aspx" />
|
||||
<Content Include="PBO\AnagAmmin.aspx" />
|
||||
@@ -212,6 +213,7 @@
|
||||
<Content Include="Scripts\esm\popper-utils.js.map" />
|
||||
<Content Include="Services\WS_data.asmx" />
|
||||
<Content Include="User.aspx" />
|
||||
<Content Include="UserAdmin.aspx" />
|
||||
<Content Include="webfonts\fa-brands-400.svg" />
|
||||
<Content Include="webfonts\fa-regular-400.svg" />
|
||||
<Content Include="webfonts\fa-solid-900.svg" />
|
||||
@@ -354,6 +356,13 @@
|
||||
<Compile Include="Login.aspx.designer.cs">
|
||||
<DependentUpon>Login.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainMenu.aspx.cs">
|
||||
<DependentUpon>MainMenu.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainMenu.aspx.designer.cs">
|
||||
<DependentUpon>MainMenu.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PAM\MyDashboard.aspx.cs">
|
||||
<DependentUpon>MyDashboard.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -471,6 +480,13 @@
|
||||
<Compile Include="User.aspx.designer.cs">
|
||||
<DependentUpon>User.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserAdmin.aspx.cs">
|
||||
<DependentUpon>UserAdmin.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserAdmin.aspx.designer.cs">
|
||||
<DependentUpon>UserAdmin.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserContols\cmp_numRow.ascx.cs">
|
||||
<DependentUpon>cmp_numRow.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="UserAdmin.aspx.cs" Inherits="PUB.UserAdmin" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="JumboTronContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
||||
</asp:Content>
|
||||
@@ -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 PUB
|
||||
{
|
||||
public partial class UserAdmin : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+17
@@ -0,0 +1,17 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace PUB
|
||||
{
|
||||
|
||||
|
||||
public partial class UserAdmin
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,23 @@
|
||||
-->
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<!--parametri base-->
|
||||
<add key="intUpdatePagina_ms" value="240000" />
|
||||
<add key="baseLang" value="IT" />
|
||||
<!--gestione log-->
|
||||
<add key="_logDir" value="~/logs/" />
|
||||
<add key="_logLevel" value="7" />
|
||||
<add key="_logMaxMb" value="30" />
|
||||
<!--gestione auth dispositivi-->
|
||||
<add key="AuthCookieName" value="AuthDeviceScheMe" />
|
||||
<add key="defaultDomain" value="ScheMe-SP" />
|
||||
<add key="enablePlain" value="true" />
|
||||
<add key="urlGestUtenti" value="UserAdmin" />
|
||||
<add key="adminEmail" value="samuele@steamware.net" />
|
||||
<add key="PageNoIndex" value="UserAdmin#Test#Prova" />
|
||||
<!--DB 2016-->
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=B2BCond;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=B2BCond;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="B2BCondConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=B2BCond;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=B2BCond;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=B2BCond;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace PUB.WebUserContols
|
||||
{
|
||||
public partial class tpl_header : System.Web.UI.UserControl
|
||||
public partial class tpl_header : SteamWare.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -16,6 +16,50 @@ namespace PUB.WebUserContols
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
|
||||
// altri controlli
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
Timer1.Interval = memLayer.ML.confReadInt("intUpdatePagina_ms");
|
||||
Page.Title = Request.Url.ToString();
|
||||
// se ho cambiato pagina registro...)
|
||||
if (devicesAuthProxy.pagPrecedente != titolo)
|
||||
{
|
||||
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
|
||||
}
|
||||
// salvo pagina corrente
|
||||
devicesAuthProxy.pagCorrente = titolo;
|
||||
}
|
||||
// SOLO se la pagina NON E' "safe"...
|
||||
if (memLayer.ML.confReadString("PageNoIndex").IndexOf(titolo) < 0)
|
||||
{
|
||||
bool userOk = checkUser();
|
||||
bool pageOk = checkPageIsAuth();
|
||||
// controllo se c'è utente in sessione..
|
||||
if ((userOk))
|
||||
{
|
||||
// ora controllo pagina...
|
||||
if (!pageOk)
|
||||
{
|
||||
if (devicesAuthProxy.stObj.isPageEnabled(devicesAuthProxy.pagPrecedente))
|
||||
{
|
||||
Response.Redirect(devicesAuthProxy.pagPrecedente);
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Redirect("MainMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// rimando pagina x registrazione devices
|
||||
Response.Redirect(memLayer.ML.CRS("urlGestUtenti"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
@@ -126,5 +170,148 @@ namespace PUB.WebUserContols
|
||||
// salvo ricerca
|
||||
memLayer.ML.setSessionVal("siteSearchVal", txtSearch.Text.Trim());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica che la pagina sia tra quelle autorizzate x l'utente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool checkPageIsAuth()
|
||||
{
|
||||
bool allOk = false;
|
||||
bool pageSafe = (memLayer.ML.confReadString("PageNoIndex").IndexOf(titolo) >= 0);
|
||||
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(titolo);
|
||||
allOk = (pageSafe || pageAuth);
|
||||
return allOk;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica presenza utente autorizzato in sessione
|
||||
/// </summary>
|
||||
private bool checkUser()
|
||||
{
|
||||
bool allOk = devicesAuthProxy.stObj.isAuth;
|
||||
if (!devicesAuthProxy.stObj.isAuth)
|
||||
{
|
||||
// controllo cookie device...
|
||||
allOk = checkAuthCookieScheMe();
|
||||
if (!allOk)
|
||||
{
|
||||
ResetUser();
|
||||
}
|
||||
}
|
||||
return allOk;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce cognome/nome da sessione...
|
||||
/// </summary>
|
||||
public string CognomeNome
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "-";
|
||||
try
|
||||
{
|
||||
answ = SteamWare.devicesAuthProxy.stObj.CognomeNome;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce IP corrente
|
||||
/// </summary>
|
||||
public string currentIP
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "0.0.0.0";
|
||||
try
|
||||
{
|
||||
answ = Request.UserHostAddress;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public bool userIsAdmin
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = devicesAuthProxy.stObj.userHasRight("SuperAdmin");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica la presenza di un cookie VALIDO per autorizzare il device ed avvia utente...
|
||||
/// </summary>
|
||||
private bool checkAuthCookieScheMe()
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
HttpCookie cookie = Request.Cookies[devicesAuthProxy.AuthCookieName];
|
||||
if (!(cookie == null || cookie.Value == ""))
|
||||
{
|
||||
// ricavo utente da cookie...
|
||||
string userAgent = "";
|
||||
string postazione_IP = "";
|
||||
string devSecret = cookie.Value;
|
||||
DS_Auth.AnagDevicesRow device = null;
|
||||
// cerco il device...ogni dipendente può averne + di 1 registrato a suo nome...
|
||||
string email = "";
|
||||
try
|
||||
{
|
||||
device = devicesAuthProxy.stObj.taAnagDev.getByDeviceSecret(devSecret)[0];
|
||||
email = device.USER_NAME;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (email != "")
|
||||
{
|
||||
// aggiorno descrizione (user agent) ed IP...
|
||||
userAgent = Request.UserAgent;
|
||||
postazione_IP = Request.UserHostAddress;
|
||||
// controllo IP e DeviceDescription x eventuale update
|
||||
if ((device.lastIPv4 != postazione_IP) || (device.Description != userAgent))
|
||||
{
|
||||
// salvo ultimo "contatto" del device aggiornando descrizione ed IP
|
||||
devicesAuthProxy.stObj.taAnagDev.updateIP(device.IdxDevice, DateTime.Now, postazione_IP, userAgent);
|
||||
}
|
||||
// salvo in sessione utente
|
||||
memLayer.ML.setSessionVal("email", email);
|
||||
// avvio utente...
|
||||
devicesAuthProxy.stObj.startUpUtente(email);
|
||||
// salvo gruppo...
|
||||
if (devicesAuthProxy.stObj.isAuth)
|
||||
{
|
||||
// se tutto ok
|
||||
memLayer.ML.setSessionVal("Gruppo", devicesAuthProxy.stObj.rigaUtente.CodGruppo);
|
||||
answ = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in checkAuthCookie:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private void ResetUser()
|
||||
{
|
||||
devicesAuthProxy.stObj.clearAllUserData();
|
||||
// svuoto cookie...
|
||||
memLayer.ML.setCookieVal(devicesAuthProxy.AuthCookieName, "");
|
||||
memLayer.ML.emptyCookieVal(devicesAuthProxy.AuthCookieName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user