diff --git a/pGina/src/Service/Impl/Service.cs b/pGina/src/Service/Impl/Service.cs index 942848b0..43c23907 100644 --- a/pGina/src/Service/Impl/Service.cs +++ b/pGina/src/Service/Impl/Service.cs @@ -287,6 +287,7 @@ private LoginResponseMessage HandleLoginRequest(LoginRequestMessage msg) PluginDriver sessionDriver = new PluginDriver(); bool LastUsernameEnable = Settings.Get.LastUsernameEnable; + string oriUsername = msg.Username; //to distinguish email from domain msg = SplitDomainfromUsername(msg); sessionDriver.UserInformation.Username = msg.Username; sessionDriver.UserInformation.Password = (String.IsNullOrEmpty(msg.Password)) ? "" : msg.Password; @@ -389,6 +390,15 @@ private LoginResponseMessage HandleLoginRequest(LoginRequestMessage msg) } } + // for those who are logging in by using a mail address + if (oriUsername.Contains("@")) + { + sessionDriver.UserInformation.Username = oriUsername; + sessionDriver.UserInformation.Domain = Environment.MachineName; + m_logger.DebugFormat("Reintegrate username from username:{0} domain:{1} to {2} and domain:{3}", msg.Username, msg.Domain, oriUsername, Environment.MachineName); + } + // mail mod end + BooleanResult result = new BooleanResult() { Success = true, Message = "" }; if (new[] { LoginRequestMessage.LoginReason.Login, LoginRequestMessage.LoginReason.CredUI }.Contains(msg.Reason))