diff --git a/C2P/Account/Login.aspx b/C2P/Account/Login.aspx deleted file mode 100644 index e310b43..0000000 --- a/C2P/Account/Login.aspx +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Page Title="Log in" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="C2P.Account.Login" %> -<%@ Register Src="~/Account/OpenAuthProviders.ascx" TagPrefix="uc" TagName="OpenAuthProviders" %> - - -
-

<%: Title %>.

-
-
-

Use a local account to log in.

- - -

- -

-
- Log in Form -
    -
  1. - User name - - -
  2. -
  3. - Password - - -
  4. -
  5. - - Remember me? -
  6. -
- -
-
-
-

- Register - if you don't have an account. -

-
- -
-

Use another service to log in.

- -
-
diff --git a/C2P/Account/Login.aspx.cs b/C2P/Account/Login.aspx.cs deleted file mode 100644 index f4c39f6..0000000 --- a/C2P/Account/Login.aspx.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace C2P.Account -{ - public partial class Login : Page - { - protected void Page_Load(object sender, EventArgs e) - { - RegisterHyperLink.NavigateUrl = "Register"; - OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"]; - - var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]); - if (!String.IsNullOrEmpty(returnUrl)) - { - RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl; - } - } - } -} \ No newline at end of file diff --git a/C2P/Account/Login.aspx.designer.cs b/C2P/Account/Login.aspx.designer.cs deleted file mode 100644 index c52676d..0000000 --- a/C2P/Account/Login.aspx.designer.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace C2P.Account -{ - - - public partial class Login - { - - /// - /// RegisterHyperLink control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HyperLink RegisterHyperLink; - - /// - /// OpenAuthLogin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::C2P.Account.OpenAuthProviders OpenAuthLogin; - } -} diff --git a/C2P/Account/Manage.aspx b/C2P/Account/Manage.aspx deleted file mode 100644 index 06d656b..0000000 --- a/C2P/Account/Manage.aspx +++ /dev/null @@ -1,126 +0,0 @@ -<%@ Page Title="Manage Account" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="C2P.Account.Manage" %> -<%@ Register Src="~/Account/OpenAuthProviders.ascx" TagPrefix="uc" TagName="OpenAuthProviders" %> - - -
-

<%: Title %>.

-
- -
- -

<%: SuccessMessage %>

-
- -

You're logged in as <%: User.Identity.Name %>.

- - -

- You do not have a local password for this site. Add a local - password so you can log in without an external login. -

-
- Set Password Form -
    -
  1. - Password - - - - - -
  2. -
  3. - Confirm password - - - -
  4. -
- -
-
- - -

Change password

- - -

- -

-
- Change password details -
    -
  1. - Current password - - -
  2. -
  3. - New password - - -
  4. -
  5. - Confirm new password - - - -
  6. -
- -
-
-
-
-
- -
- - - - -

Registered external logins

- - - - - -
ServiceUser NameLast Used 
-
- - - - <%#: Item.ProviderDisplayName %> - <%#: Item.ProviderUserName %> - <%#: ConvertToDisplayDateTime(Item.LastUsedUtc) %> - - - - - - -
- -

Add an external login

- -
-
diff --git a/C2P/Account/Manage.aspx.cs b/C2P/Account/Manage.aspx.cs deleted file mode 100644 index efa5e4e..0000000 --- a/C2P/Account/Manage.aspx.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Microsoft.AspNet.Membership.OpenAuth; - -namespace C2P.Account -{ - public partial class Manage : System.Web.UI.Page - { - protected string SuccessMessage - { - get; - private set; - } - - protected bool CanRemoveExternalLogins - { - get; - private set; - } - - protected void Page_Load() - { - if (!IsPostBack) - { - // Determine the sections to render - var hasLocalPassword = OpenAuth.HasLocalPassword(User.Identity.Name); - setPassword.Visible = !hasLocalPassword; - changePassword.Visible = hasLocalPassword; - - CanRemoveExternalLogins = hasLocalPassword; - - // Render success message - var message = Request.QueryString["m"]; - if (message != null) - { - // Strip the query string from action - Form.Action = ResolveUrl("~/Account/Manage"); - - SuccessMessage = - message == "ChangePwdSuccess" ? "Your password has been changed." - : message == "SetPwdSuccess" ? "Your password has been set." - : message == "RemoveLoginSuccess" ? "The external login was removed." - : String.Empty; - successMessage.Visible = !String.IsNullOrEmpty(SuccessMessage); - } - } - - } - - protected void setPassword_Click(object sender, EventArgs e) - { - if (IsValid) - { - var result = OpenAuth.AddLocalPassword(User.Identity.Name, password.Text); - if (result.IsSuccessful) - { - Response.Redirect("~/Account/Manage?m=SetPwdSuccess"); - } - else - { - - ModelState.AddModelError("NewPassword", result.ErrorMessage); - - } - } - } - - - public IEnumerable GetExternalLogins() - { - var accounts = OpenAuth.GetAccountsForUser(User.Identity.Name); - CanRemoveExternalLogins = CanRemoveExternalLogins || accounts.Count() > 1; - return accounts; - } - - public void RemoveExternalLogin(string providerName, string providerUserId) - { - var m = OpenAuth.DeleteAccount(User.Identity.Name, providerName, providerUserId) - ? "?m=RemoveLoginSuccess" - : String.Empty; - Response.Redirect("~/Account/Manage" + m); - } - - - protected static string ConvertToDisplayDateTime(DateTime? utcDateTime) - { - // You can change this method to convert the UTC date time into the desired display - // offset and format. Here we're converting it to the server timezone and formatting - // as a short date and a long time string, using the current thread culture. - return utcDateTime.HasValue ? utcDateTime.Value.ToLocalTime().ToString("G") : "[never]"; - } - } -} \ No newline at end of file diff --git a/C2P/Account/Manage.aspx.designer.cs b/C2P/Account/Manage.aspx.designer.cs deleted file mode 100644 index 0ee6f34..0000000 --- a/C2P/Account/Manage.aspx.designer.cs +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace C2P.Account -{ - - - public partial class Manage - { - - /// - /// successMessage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder successMessage; - - /// - /// setPassword control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder setPassword; - - /// - /// password control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox password; - - - - /// - /// confirmPassword control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox confirmPassword; - - /// - /// changePassword control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder changePassword; - - - } -} diff --git a/C2P/Account/OpenAuthProviders.ascx b/C2P/Account/OpenAuthProviders.ascx deleted file mode 100644 index 4e57ceb..0000000 --- a/C2P/Account/OpenAuthProviders.ascx +++ /dev/null @@ -1,21 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OpenAuthProviders.ascx.cs" Inherits="C2P.Account.OpenAuthProviders" %> - -
- Log in using another service - - - - - - - -
-

There are no external authentication services configured. See this article for details on setting up this ASP.NET application to support logging in via external services.

-
-
-
-
\ No newline at end of file diff --git a/C2P/Account/OpenAuthProviders.ascx.cs b/C2P/Account/OpenAuthProviders.ascx.cs deleted file mode 100644 index 3a1d57e..0000000 --- a/C2P/Account/OpenAuthProviders.ascx.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using Microsoft.AspNet.Membership.OpenAuth; - -namespace C2P.Account -{ - public partial class OpenAuthProviders : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) - { - - if (IsPostBack) - { - var provider = Request.Form["provider"]; - if (provider == null) - { - return; - } - - var redirectUrl = "~/Account/RegisterExternalLogin"; - if (!String.IsNullOrEmpty(ReturnUrl)) - { - var resolvedReturnUrl = ResolveUrl(ReturnUrl); - redirectUrl += "?ReturnUrl=" + HttpUtility.UrlEncode(resolvedReturnUrl); - } - - OpenAuth.RequestAuthentication(provider, redirectUrl); - } - } - - - - public string ReturnUrl { get; set; } - - - public IEnumerable GetProviderNames() - { - return OpenAuth.AuthenticationClients.GetAll(); - } - - } -} \ No newline at end of file diff --git a/C2P/Account/OpenAuthProviders.ascx.designer.cs b/C2P/Account/OpenAuthProviders.ascx.designer.cs deleted file mode 100644 index be695b9..0000000 --- a/C2P/Account/OpenAuthProviders.ascx.designer.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace C2P.Account -{ - - - public partial class OpenAuthProviders - { - - /// - /// providerDetails control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ListView providerDetails; - - } -} diff --git a/C2P/Account/Register.aspx b/C2P/Account/Register.aspx deleted file mode 100644 index 0e27e97..0000000 --- a/C2P/Account/Register.aspx +++ /dev/null @@ -1,62 +0,0 @@ -<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="C2P.Account.Register" %> - - -
-

<%: Title %>.

-

Use the form below to create a new account.

-
- - - - - - - - - -

- Passwords are required to be a minimum of <%: Membership.MinRequiredPasswordLength %> characters in length. -

- -

- -

- -
- Registration Form -
    -
  1. - User name - - -
  2. -
  3. - Email address - - -
  4. -
  5. - Password - - -
  6. -
  7. - Confirm password - - - -
  8. -
- -
-
- -
-
-
-
\ No newline at end of file diff --git a/C2P/Account/Register.aspx.cs b/C2P/Account/Register.aspx.cs deleted file mode 100644 index 568d168..0000000 --- a/C2P/Account/Register.aspx.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using Microsoft.AspNet.Membership.OpenAuth; - -namespace C2P.Account -{ - public partial class Register : Page - { - protected void Page_Load(object sender, EventArgs e) - { - RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"]; - } - - protected void RegisterUser_CreatedUser(object sender, EventArgs e) - { - FormsAuthentication.SetAuthCookie(RegisterUser.UserName, createPersistentCookie: false); - - string continueUrl = RegisterUser.ContinueDestinationPageUrl; - if (!OpenAuth.IsLocalUrl(continueUrl)) - { - continueUrl = "~/"; - } - Response.Redirect(continueUrl); - } - } -} \ No newline at end of file diff --git a/C2P/Account/Register.aspx.designer.cs b/C2P/Account/Register.aspx.designer.cs deleted file mode 100644 index 4425d0b..0000000 --- a/C2P/Account/Register.aspx.designer.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace C2P.Account -{ - - - public partial class Register - { - - /// - /// RegisterUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CreateUserWizard RegisterUser; - - /// - /// RegisterUserWizardStep control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CreateUserWizardStep RegisterUserWizardStep; - } -} diff --git a/C2P/Account/Web.config b/C2P/Account/Web.config deleted file mode 100644 index 90fe314..0000000 --- a/C2P/Account/Web.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/C2P/C2P.csproj b/C2P/C2P.csproj index 130ac47..03117f2 100644 --- a/C2P/C2P.csproj +++ b/C2P/C2P.csproj @@ -16,8 +16,8 @@ v4.5 true - - + disabled + enabled @@ -260,6 +260,7 @@ + @@ -326,6 +327,7 @@ + @@ -468,6 +470,13 @@ JumboPage.master + + login.aspx + ASPXCodeBehind + + + login.aspx + MarginReport.aspx ASPXCodeBehind @@ -625,6 +634,13 @@ mod_lemmiVocab.ascx + + mod_login.ascx + ASPXCodeBehind + + + mod_login.ascx + mod_MaRepActData.ascx ASPXCodeBehind @@ -823,7 +839,6 @@ - diff --git a/C2P/Services/WS_data.asmx.cs b/C2P/Services/WS_data.asmx.cs index ebb58a0..a29b93b 100644 --- a/C2P/Services/WS_data.asmx.cs +++ b/C2P/Services/WS_data.asmx.cs @@ -96,11 +96,6 @@ namespace C2P.Services { //suggerimenti.Add(riga.label); suggerimenti.Add(string.Format("{0}#{1}#{2}", riga.Lingua, riga.Lemma, riga.Traduzione)); - if (suggerimenti.Count == memLayer.ML.confReadInt("maxNumSuggest")) - { - suggerimenti.Add("...more#"); - return suggerimenti.ToArray(); - } } return suggerimenti.ToArray(); } diff --git a/C2P/Web.config b/C2P/Web.config index 9a367fe..4298895 100644 --- a/C2P/Web.config +++ b/C2P/Web.config @@ -18,6 +18,8 @@ + + @@ -45,6 +47,8 @@ + + @@ -75,7 +79,7 @@ - + diff --git a/C2P/WebUserControls/mod_Q_Quot.ascx b/C2P/WebUserControls/mod_Q_Quot.ascx index b5661d7..587e090 100644 --- a/C2P/WebUserControls/mod_Q_Quot.ascx +++ b/C2P/WebUserControls/mod_Q_Quot.ascx @@ -18,7 +18,7 @@
- +
@@ -40,14 +40,14 @@
- +
- +
@@ -64,7 +64,7 @@
- +
@@ -93,14 +93,14 @@
- +
- +
diff --git a/C2P/WebUserControls/mod_Q_Quot.ascx.cs b/C2P/WebUserControls/mod_Q_Quot.ascx.cs index 5bfe9cf..9b2ec2a 100644 --- a/C2P/WebUserControls/mod_Q_Quot.ascx.cs +++ b/C2P/WebUserControls/mod_Q_Quot.ascx.cs @@ -81,5 +81,16 @@ namespace C2P.WebUserControls { frmView.DataBind(); } + /// + /// verifica se utente sia admin altrimenti non vede dati... + /// + public bool userIsAdmin + { + get + { + bool answ = SteamWare.user_std.UtSn.userHasRight("SuperUser"); + return answ; + } + } } } \ No newline at end of file diff --git a/C2P/WebUserControls/mod_login.ascx b/C2P/WebUserControls/mod_login.ascx new file mode 100644 index 0000000..3f039a5 --- /dev/null +++ b/C2P/WebUserControls/mod_login.ascx @@ -0,0 +1,54 @@ +<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %> + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ +
+
+ + + + + + + +
+ +
+ +
diff --git a/C2P/WebUserControls/mod_login.ascx.cs b/C2P/WebUserControls/mod_login.ascx.cs new file mode 100644 index 0000000..c442579 --- /dev/null +++ b/C2P/WebUserControls/mod_login.ascx.cs @@ -0,0 +1,243 @@ +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 C2P_Data; + +/// +/// classe gestione login e forzatura login +/// +public partial class mod_login : ApplicationUserControl +{ + #region area protected/private + + #region area proprietà + + private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale; + + #endregion + + #region area metodi + + /// + /// imposta la modalità di login tra normale / forceUser + /// + 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"); + } + + /// + /// prova a verificare se l'utente sia ok x AD credentials + /// + private void AdLogin() + { + lblMessage.Text = traduci("UserNotAuth"); + 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); + // passo al controllo di verifica ADuserOk... + user_std _utente = new user_std(); + if (_utente.ADuserOk(dom_user[0], dom_user[1])) + { + bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); + 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); + if (Login_ok != null) + { + Login_ok(this, new EventArgs()); + } + } + else + { + lblMessage.Text = String.Format("{0}
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); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); + } + } + } + else + { + if (memLayer.ML.confReadBool("autoEnrollEnabled")) + { + // rimando al modulo di auto enroll... + Response.Redirect("autoEnroll.aspx"); + } + else + { + lblMessage.Text = String.Format("{0}
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); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); + } + } + } + } + else + { + lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth"); + httpLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); + } + } + } + + /// + /// effettua verifiche e se concesso permette di forzare l'accesso utente + /// + 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 == "triplete") // 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); + httpLog(_rigaLog, SteamWare.tipoLog.INFO); + if (Login_ok != null) + { + Login_ok(this, new EventArgs()); + } + } + } + else + { + lblMessage.Text = String.Format("{0}
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!
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); + httpLog(_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!
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); + httpLog(_rigaLog, SteamWare.tipoLog.WARNING); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); + } + } + } + else + { + lblMessage.Text = string.Format("{0}
user not authenticated!
", 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); + httpLog(_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à + + /// + /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser + /// + public SteamWare.loginMode modoLogin + { + get + { + return _isForceUser; + } + set + { + _isForceUser = value; + } + } + + #endregion + + + /// + /// avvio pagina + /// + protected override void Page_Load(object sender, EventArgs e) + { + //base.Page_Load(sender, e); + //carico da web.config i default values + loadDefaultsWebConfig(); + // procedo... + setLoginMode(); + Session.RemoveAll(); + if (_isForceUser == SteamWare.loginMode.normale) + { + AdLogin(); + } + } + + #endregion +} diff --git a/C2P/WebUserControls/mod_login.ascx.designer.cs b/C2P/WebUserControls/mod_login.ascx.designer.cs new file mode 100644 index 0000000..1bf31fd --- /dev/null +++ b/C2P/WebUserControls/mod_login.ascx.designer.cs @@ -0,0 +1,113 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + +public partial class mod_login { + + /// + /// pnlForceUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlForceUser; + + /// + /// lblTitolo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTitolo; + + /// + /// lblPwd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPwd; + + /// + /// authKey control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox authKey; + + /// + /// lblDominio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDominio; + + /// + /// dominio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox dominio; + + /// + /// lblUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblUser; + + /// + /// user control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox user; + + /// + /// btnOk control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnOk; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// HypLinkSSO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO; +} diff --git a/C2P/bin/C2P.dll b/C2P/bin/C2P.dll index 364c8a8..4abc0fa 100644 Binary files a/C2P/bin/C2P.dll and b/C2P/bin/C2P.dll differ diff --git a/C2P/bin/C2P_Data.dll b/C2P/bin/C2P_Data.dll index e9d22d0..c545410 100644 Binary files a/C2P/bin/C2P_Data.dll and b/C2P/bin/C2P_Data.dll differ diff --git a/C2P/bin/SteamWare.dll b/C2P/bin/SteamWare.dll index 5c29db3..d4bac5f 100644 Binary files a/C2P/bin/SteamWare.dll and b/C2P/bin/SteamWare.dll differ diff --git a/C2P/login.aspx b/C2P/login.aspx new file mode 100644 index 0000000..5b94896 --- /dev/null +++ b/C2P/login.aspx @@ -0,0 +1,26 @@ +<%@ Page Language="C#" MasterPageFile="~/JumboPage.master" AutoEventWireup="true" + Inherits="login" Title="Login" CodeBehind="login.aspx.cs" %> + +<%@ Register Src="~/WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %> + + +
+
+
+

CostiMateline

+
+

Cost to Price for Extrusion

+
+
+
+
+
+ +
+
+
+ +
+
+
+
diff --git a/C2P/login.aspx.cs b/C2P/login.aspx.cs new file mode 100644 index 0000000..70de007 --- /dev/null +++ b/C2P/login.aspx.cs @@ -0,0 +1,56 @@ +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; + +public partial class login : System.Web.UI.Page +{ + protected string _nextPage + { + get + { + string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); + if (pagina == "") + { + pagina = "Default.aspx"; + } + return pagina; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + Mod_login1.modoLogin = SteamWare.loginMode.normale; + // pulisco dir temp dai file dei cartellini stampati + reportPrinter.obj.pulisciDir(); + } + + 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) + { + Response.Redirect(_nextPage); + } + protected override void OnUnload(EventArgs e) + { + base.OnUnload(e); + Mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok); + Mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error); + } +} diff --git a/C2P/login.aspx.designer.cs b/C2P/login.aspx.designer.cs new file mode 100644 index 0000000..cd20b3b --- /dev/null +++ b/C2P/login.aspx.designer.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + +public partial class login { + + /// + /// Mod_login1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::mod_login Mod_login1; +} diff --git a/C2P_Report/bin/C2P_Data.dll b/C2P_Report/bin/C2P_Data.dll index e9d22d0..c545410 100644 Binary files a/C2P_Report/bin/C2P_Data.dll and b/C2P_Report/bin/C2P_Data.dll differ diff --git a/C2P_Report/bin/C2P_Report.dll b/C2P_Report/bin/C2P_Report.dll index 148db65..45b526d 100644 Binary files a/C2P_Report/bin/C2P_Report.dll and b/C2P_Report/bin/C2P_Report.dll differ diff --git a/C2P_Report/bin/SteamWare.dll b/C2P_Report/bin/SteamWare.dll index 5c29db3..d4bac5f 100644 Binary files a/C2P_Report/bin/SteamWare.dll and b/C2P_Report/bin/SteamWare.dll differ diff --git a/VersGen/C2P.cs b/VersGen/C2P.cs index 35c2db7..7cad3dc 100644 --- a/VersGen/C2P.cs +++ b/VersGen/C2P.cs @@ -5,7 +5,7 @@ using System.Reflection; -[assembly: AssemblyVersion("0.8.102.229")] -[assembly: AssemblyFileVersion("0.8.102.229")] +[assembly: AssemblyVersion("0.8.103.229")] +[assembly: AssemblyFileVersion("0.8.103.229")] [assembly: AssemblyCopyright("Proxima & Steamware © 2013-2014")] [assembly: AssemblyCompany("Steamware")] diff --git a/VersGen/C2P.tt b/VersGen/C2P.tt index 5858880..98ac367 100644 --- a/VersGen/C2P.tt +++ b/VersGen/C2P.tt @@ -6,8 +6,8 @@ using System.Reflection; -[assembly: AssemblyVersion("0.8.102.<#= this.RevisionNumber #>")] -[assembly: AssemblyFileVersion("0.8.102.<#= this.RevisionNumber #>")] +[assembly: AssemblyVersion("0.8.103.<#= this.RevisionNumber #>")] +[assembly: AssemblyFileVersion("0.8.103.<#= this.RevisionNumber #>")] [assembly: AssemblyCopyright("Proxima & Steamware © 2013-<#= DateTime.Now.Year #>")] [assembly: AssemblyCompany("Steamware")] <#+