Skip to content

Commit

Permalink
Ldap plugin fix AD UserChangePassword
Browse files Browse the repository at this point in the history
  • Loading branch information
MutonUfoAI committed Apr 11, 2018
1 parent cffd462 commit 1922de0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Plugins/LdapPlugin/Ldap/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,21 @@ public BooleanResult ChangePassword(SessionProperties properties, ChangePassword
{
if (entry.Method.HasFlag(Methods.ADPWD))
{
bool ADpwd = false;
string pwdmessage = "";
foreach (string server in hosts)
{
if (Abstractions.WindowsApi.pInvokes.UserChangePassword(server, userInfo.Username, userInfo.oldPassword, userInfo.Password) == "")
pwdmessage = Abstractions.WindowsApi.pInvokes.UserChangePassword(server, userInfo.Username, userInfo.oldPassword, userInfo.Password);
if (pwdmessage == "")
{
ADpwd = true;
break;
}
}
if (!ADpwd)
{
return new BooleanResult { Success = false, Message = "Failed to change password.\n" + pwdmessage };
}
continue;
}

Expand Down

0 comments on commit 1922de0

Please sign in to comment.