public override bool ChangePassword(string username, string oldPassword, string newPassword)
{
var doc = new XmlDocument();
doc.Load(XmlFullyQualifiedPath);
var nodes = doc.GetElementsByTagName("User");
foreach (XmlNode node in nodes)
{
if (!node["UserName"].InnerText.Equals(username, StringComparison.OrdinalIgnoreCase))
{
continue;
}
if (!this.CheckPassword(node["Password"].InnerText, oldPassword))
{
continue;
}
string passwordPrep = this.passwordFormat == MembershipPasswordFormat.Hashed ? Utils.HashPassword(newPassword) : newPassword;
node["Password"].InnerText = passwordPrep;
doc.Save(XmlFullyQualifiedPath);
this.users = null;
this.ReadMembershipDataStore();
return true;
}
return false;
}