Riorganizzazione progetto EquaAuth
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<publishData>
|
||||
<publishProfile publishUrl="https://10.74.82.218:8172/MsDeploy.axd" deleteExistingFiles="False" ftpAnonymousLogin="False" ftpPassiveMode="True" msdeploySite="Default Web Site/Equa_Auth" msdeploySiteID="" msdeployRemoteSitePhysicalPath="" msdeployAllowUntrustedCertificate="True" msdeploySkipExtraFilesOnServer="True" msdeployMarkAsApp="True" profileName="218" publishMethod="MSDeploy" replaceMatchingFiles="True" userName="administrator" savePWD="True" userPWD="AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAANG3mmfjEp0KeNJkVrFBcLQAAAAACAAAAAAADZgAAwAAAABAAAAAwGKPeGP3bFkZjnaMxSDhdAAAAAASAAACgAAAAEAAAAIoknVmNcPXvjZBSotH+mFUQAAAAe64tAdL5SVfRPlNhcbCWbRQAAADU7ia/kO7fMVHJfVHysjmImbZD3w==" SelectedForPublish="True" />
|
||||
</publishData>
|
||||
@@ -20,6 +20,10 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>4.0</OldToolsVersion>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -122,6 +126,9 @@
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<NameOfLastUsedPublishProfile>IIS02</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
@@ -0,0 +1,15 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LandingPage.aspx.cs" Inherits="Equa_Auth.LandingPage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
Effettuata login utente...
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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 Equa_Auth
|
||||
{
|
||||
public partial class LandingPage : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+26
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Equa_Auth
|
||||
{
|
||||
|
||||
|
||||
public partial class LandingPage
|
||||
{
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Equa_Auth")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Equa_Auth")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("076fbb63-2898-40d0-8694-f9c261dab2e7")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>MSDeploy</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
|
||||
<DeployIisAppPath>Default Web Site/Equa_Auth</DeployIisAppPath>
|
||||
<RemoteSitePhysicalPath />
|
||||
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
|
||||
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
|
||||
<EnableMSDeployBackup>True</EnableMSDeployBackup>
|
||||
<UserName>steamwarewin\administrator</UserName>
|
||||
<_SavePWD>True</_SavePWD>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile>2012-12-20T08:29:08.8983364+01:00</TimeStampOfAssociatedLegacyPublishXmlFile>
|
||||
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAo36S5JDE50KEYaFF4uFLhwAAAAACAAAAAAADZgAAwAAAABAAAAD1KIWdXy6ig98G3KugeIxAAAAAAASAAACgAAAAEAAAAMOZEqvJi7T0Uz1HKo370RAYAAAA2LU+bG8Tsfy6PeBRVTa+eWI2s52HmdRDFAAAAPpfjqE5M/ly9SZMve8EOSTORlbR</EncryptedPassword>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an atrribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an atrribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<appSettings>
|
||||
<add key="PermessiConnectionString" value="Data Source=localhost;Initial Catalog=EQUA_XPS;Persist Security Info=True;User id=equa;Password=steamware" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=localhost;Initial Catalog=EQUA_Anagrafica;Persist Security Info=True;User id=equa;Password=steamware" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=localhost;Initial Catalog=EQUA_Vocabolario;Persist Security Info=True;User id=equa;Password=steamware" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an atrribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
</system.web>
|
||||
<appSettings>
|
||||
<add key="mainRev" value="1.3"/>
|
||||
<add key="minRev" value="170"/>
|
||||
<!--gestione cookie-->
|
||||
<add key="enableCookie" value="true" />
|
||||
<add key="cookieDayExp" value="365" />
|
||||
<!--logging-->
|
||||
<add key="_logDir" value="./logs/"/>
|
||||
<add key="_logLevel" value="5"/>
|
||||
<add key="_logMaxMb" value="30"/>
|
||||
<!--area auth DB-->
|
||||
<add key="PermessiConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=Equa_XPS_prod;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=Equa_Anagrafica;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<add key="VocabolarioConnectionString" value="Data Source=10.74.82.217\SQL2008R2;Initial Catalog=Equa_Vocabolario;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,54 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_login.ascx.cs" Inherits="Equa_Auth.WebUserControls.mod_login" %>
|
||||
<link href="~/Style.css" rel="stylesheet" type="text/css" />
|
||||
<asp:Panel ID="pnlForceUser" runat="server">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="chPwdTitle">
|
||||
<asp:Label runat="server" ID="lblTitolo" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblPwd" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="authKey" TextMode="Password" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblDominio" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="dominio" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:Label CssClass="chPwdTxt" runat="server" ID="lblUser" />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="user" Width="210px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Button Width="100%" runat="server" ID="btnOk" CommandName="ok" CommandArgument="ok" OnClick="btnOk_Click"></asp:Button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</asp:Panel>
|
||||
<table class="smallTable">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:Label CssClass="chPwdTxt" ID="lblMessage" runat="server" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<asp:HyperLink ID="HypLinkSSO" runat="server" NavigateUrl="~/login.aspx" Text="Single-Sign-On Login"></asp:HyperLink>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,241 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
namespace Equa_Auth.WebUserControls
|
||||
{
|
||||
/// <summary>
|
||||
/// classe gestione login e forzatura login
|
||||
/// </summary>
|
||||
public partial class mod_login : ApplicationUserControl
|
||||
{
|
||||
#region area protected/private
|
||||
|
||||
#region area proprietà
|
||||
|
||||
private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area metodi
|
||||
|
||||
/// <summary>
|
||||
/// imposta la modalità di login tra normale / forceUser
|
||||
/// </summary>
|
||||
private void setLoginMode()
|
||||
{
|
||||
if (_isForceUser == SteamWare.loginMode.forceUser)
|
||||
{
|
||||
pnlForceUser.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pnlForceUser.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void traduciObj()
|
||||
{
|
||||
lblPwd.Text = user_std.UtSn.Traduci("lblPwd");
|
||||
lblUser.Text = user_std.UtSn.Traduci("lblUser");
|
||||
lblDominio.Text = user_std.UtSn.Traduci("lblDominio");
|
||||
lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente");
|
||||
btnOk.Text = user_std.UtSn.Traduci("btnCommit");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// prova a verificare se l'utente sia ok x AD credentials
|
||||
/// </summary>
|
||||
private void AdLogin()
|
||||
{
|
||||
lblMessage.Text = "User not authenticated...";
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
//recupera user windows se c'è...
|
||||
string ad_name = Page.User.Identity.Name;
|
||||
string delimStr = "\\";
|
||||
char[] delimiter = delimStr.ToCharArray();
|
||||
string[] dom_user = ad_name.Split(delimiter, 2);
|
||||
// salvo cookie!
|
||||
string DeviceName = "";
|
||||
string IPv4 = "";
|
||||
string userAgent = "";
|
||||
try
|
||||
{
|
||||
userAgent = Request.UserAgent;
|
||||
DeviceName = Request.UserHostName;
|
||||
IPv4 = Request.UserHostName;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (memLayer.ML.confReadBool("enableCookie"))
|
||||
{
|
||||
// elimino eventuali altri cookie x dominio/user/devName
|
||||
//DataWrap.DW.taAnagDev.delByDominioUserDeviceName(dom_user[0], dom_user[1], DeviceName);
|
||||
// creo nuovo cookie
|
||||
authProxy.createNewCookie(dom_user[0], dom_user[1], 0, DeviceName, userAgent, IPv4, Page.Request.QueryString["AuthCookie"].ToString(), DateTime.Now.AddDays(memLayer.ML.confReadInt("cookieDayExp")));
|
||||
}
|
||||
// loggo
|
||||
SteamWare.logger.lg.scriviLog(string.Format("L'utente {0}/{1} ha effettuato il login correttamente", dom_user[0], dom_user[1]), SteamWare.tipoLog.INFO);
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
|
||||
SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua verifiche e se concesso permette di forzare l'accesso utente
|
||||
/// </summary>
|
||||
private void ForceUserIdentity()
|
||||
{
|
||||
if (Page.User.Identity.IsAuthenticated)
|
||||
{
|
||||
bool _allowForceUser = false;
|
||||
try
|
||||
{
|
||||
_allowForceUser = SteamWare.memLayer.ML.confReadBool("_allowForceUser");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_allowForceUser = false;
|
||||
}
|
||||
if (_allowForceUser)
|
||||
{
|
||||
if (authKey.Text == "forzaInter") // verifica passphrase...
|
||||
{
|
||||
user_std _utente = new user_std();
|
||||
user_std.UtSn.isForcedUser = true;
|
||||
bool fatto = _utente.startUpUtente(dominio.Text, user.Text);
|
||||
if (fatto)
|
||||
{
|
||||
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = String.Format("{0}<br>key not allowed for operation!!! operation logged!!!", user_std.UtSn.Traduci("AccessFail"));
|
||||
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.confReadString("defaultApp"))));
|
||||
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMessage.Text = string.Format("{0}<br>user not authenticated!<br>", user_std.UtSn.Traduci("AccessFail"));
|
||||
if (Login_Error != null)
|
||||
{
|
||||
Login_Error(this, new EventArgs());
|
||||
}
|
||||
string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text);
|
||||
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
ForceUserIdentity();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
#region eventi pubblici esposti
|
||||
|
||||
public event EventHandler Login_ok;
|
||||
public event EventHandler Login_Error;
|
||||
|
||||
#endregion
|
||||
|
||||
#region area proprietà
|
||||
|
||||
/// <summary>
|
||||
/// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser
|
||||
/// </summary>
|
||||
public SteamWare.loginMode modoLogin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isForceUser;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isForceUser = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// avvio pagina
|
||||
/// </summary>
|
||||
protected override void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
//carico da web.config i default values
|
||||
loadDefaultsWebConfig();
|
||||
// procedo...
|
||||
setLoginMode();
|
||||
Session.RemoveAll();
|
||||
if (_isForceUser == SteamWare.loginMode.normale)
|
||||
{
|
||||
bool cookieLogin = false;
|
||||
if (memLayer.ML.confReadBool("enableCookie"))
|
||||
{
|
||||
string cookieName = Page.Request.QueryString["AuthCookie"].ToString();
|
||||
cookieLogin = authProxy.tryAuthByCookie(cookieName);
|
||||
}
|
||||
if (!cookieLogin)
|
||||
{
|
||||
AdLogin();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Login_ok != null)
|
||||
{
|
||||
Login_ok(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Equa_Auth.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_login {
|
||||
|
||||
/// <summary>
|
||||
/// pnlForceUser 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.Panel pnlForceUser;
|
||||
|
||||
/// <summary>
|
||||
/// lblTitolo 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 lblTitolo;
|
||||
|
||||
/// <summary>
|
||||
/// lblPwd 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 lblPwd;
|
||||
|
||||
/// <summary>
|
||||
/// authKey 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 authKey;
|
||||
|
||||
/// <summary>
|
||||
/// lblDominio 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 lblDominio;
|
||||
|
||||
/// <summary>
|
||||
/// dominio 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 dominio;
|
||||
|
||||
/// <summary>
|
||||
/// lblUser 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 lblUser;
|
||||
|
||||
/// <summary>
|
||||
/// user 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 user;
|
||||
|
||||
/// <summary>
|
||||
/// btnOk 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 btnOk;
|
||||
|
||||
/// <summary>
|
||||
/// lblMessage 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 lblMessage;
|
||||
|
||||
/// <summary>
|
||||
/// HypLinkSSO 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.HyperLink HypLinkSSO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="Equa_Auth.login" %>
|
||||
|
||||
<%@ Register Src="WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<uc1:mod_login ID="mod_login1" runat="server" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
namespace Equa_Auth
|
||||
{
|
||||
public partial class login : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
string AuthCookie = "";
|
||||
try
|
||||
{
|
||||
AuthCookie = Page.Request.QueryString["AuthCookie"].ToString();
|
||||
logger.lg.scriviLog(string.Format("Richiesta verifica cookie: {0}", AuthCookie), tipoLog.INFO);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// salvo nome cookie richiesto
|
||||
memLayer.ML.setSessionVal("AuthCookie", AuthCookie);
|
||||
// setto modalità login
|
||||
mod_login1.modoLogin = SteamWare.loginMode.normale;
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok);
|
||||
mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error);
|
||||
}
|
||||
|
||||
void Mod_login1_Login_Error(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("./unauthorized.aspx");
|
||||
}
|
||||
|
||||
void Mod_login1_Login_ok(object sender, EventArgs e)
|
||||
{
|
||||
string nextPage = "";
|
||||
try
|
||||
{
|
||||
nextPage = Page.Request.QueryString["jumpPage"].ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
nextPage = "./LandingPage.aspx";
|
||||
}
|
||||
logger.lg.scriviLog(string.Format("Login ok, redirecting to {0}", nextPage), tipoLog.INFO);
|
||||
Response.Redirect(nextPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+33
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Equa_Auth {
|
||||
|
||||
|
||||
public partial class login {
|
||||
|
||||
/// <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>
|
||||
/// mod_login1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::Equa_Auth.WebUserControls.mod_login mod_login1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user