refresh pagina login x test forceUser

This commit is contained in:
Samuele E. Locatelli
2017-05-02 16:50:07 +02:00
parent d3dec7456a
commit 9731e56aba
+16 -23
View File
@@ -1,15 +1,7 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SteamWare;
using GMW_data;
using SteamWare;
using System;
using System.Web.UI;
/// <summary>
/// classe gestione login e forzatura login
@@ -71,7 +63,7 @@ public partial class mod_login : ApplicationUserControl
if (fatto)
{
string postazione_IP = Request.UserHostName;
httpLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente dall'IP {2}", _utente.CognomeNome, _utente.userNameAD, postazione_IP), SteamWare.tipoLog.INFO);
httpLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente dall'IP {2}", _utente.CognomeNome, _utente.userNameAD, postazione_IP), tipoLog.INFO);
Postazione.IP = postazione_IP;
Postazione.setupPrinter();
if (Login_ok != null)
@@ -82,7 +74,7 @@ public partial class mod_login : ApplicationUserControl
else
{
lblMessage.Text = String.Format("{0}<br>There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
httpLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR);
httpLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), tipoLog.ERROR);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
@@ -99,7 +91,7 @@ public partial class mod_login : ApplicationUserControl
else
{
lblMessage.Text = String.Format("{0}<br>user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]);
httpLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING);
httpLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
@@ -110,7 +102,7 @@ public partial class mod_login : ApplicationUserControl
else
{
lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth");
httpLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING);
httpLog(String.Format("Accesso fallito, utente non autenticato"), tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
@@ -128,7 +120,7 @@ public partial class mod_login : ApplicationUserControl
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.cdvb("_allowForceUser");
_allowForceUser = memLayer.ML.cdvb("_allowForceUser");
}
catch
{
@@ -144,7 +136,7 @@ public partial class mod_login : ApplicationUserControl
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);
httpLog(_rigaLog, SteamWare.tipoLog.INFO);
httpLog(_rigaLog, tipoLog.INFO);
if (Login_ok != null)
{
Login_ok(this, new EventArgs());
@@ -153,10 +145,10 @@ public partial class mod_login : ApplicationUserControl
}
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"))));
lblMessage.Text = String.Format("{0}<br>key not permitted!!! 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(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);
httpLog(_rigaLog, SteamWare.tipoLog.WARNING);
httpLog(_rigaLog, tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
@@ -165,9 +157,10 @@ public partial class mod_login : ApplicationUserControl
}
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"))));
lblMessage.Text = String.Format("{0}<br>FORCEUSER not permitted, 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 funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(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);
httpLog(_rigaLog, SteamWare.tipoLog.WARNING);
httpLog(_rigaLog, tipoLog.WARNING);
if (Login_Error != null)
{
Login_Error(this, new EventArgs());
@@ -182,7 +175,7 @@ public partial class mod_login : ApplicationUserControl
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);
httpLog(_rigaLog, SteamWare.tipoLog.WARNING);
httpLog(_rigaLog, tipoLog.WARNING);
}
}