Skip to content

Commit

Permalink
fix domain vs email username logons
Browse files Browse the repository at this point in the history
- earlier email usernames got converted into domain logons
  • Loading branch information
MutonUfoAI committed Jan 2, 2017
1 parent 6732758 commit 8fc821b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pGina/src/Service/Impl/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 8fc821b

Please sign in to comment.