Allow users to change/set their password for the webserver

This commit is contained in:
lukeIam committed 2013-12-13 17:43:16 +01:00
1 parent eca41bab2f
commit 652fdabc3e
4 files changed
+25 -2

No files matched your search

+14 -1
View File
@@ -197,7 +197,20 @@ namespace ServerLib
return false;
}
return CServer.SendProfileData(profile);
bool result = CServer.SendProfileData(profile);
if (profile.Password != null && profile.Password != "")
{
int profileId = profile.ProfileId;
if (profileId == -1)
{
profileId = CServer.GetUserIdFromUsername(profile.PlayerName);
}
CServer.SetPassword(profileId, profile.Password);
}
return result;
}
public ProfileData getProfile(int profileId)
@@ -34,6 +34,8 @@ namespace ServerLib
public int ProfileId;
[DataMember]
public bool IsEditable;
[DataMember]
public string Password;
}
#endregion