public override bool ChangePassword(string username, string oldPassword, string newPassword) { // from the OneWeb membership provider oldPassword is now no longer supplied when user forgets password which calls changes password in the provider if (String.IsNullOrEmpty(oldPassword)) { SimpleAES aes = new SimpleAES(); string pw = aes.Encrypt(newPassword); MembershipBs mr = new MembershipBs(); UserProfile up = mr.GetUserProfile(username); up.password = pw; mr.ProcessNurseProfile(up); return(true); } else // we can validate the user { if (ValidateUser(username, oldPassword)) { SimpleAES aes = new SimpleAES(); string pw = aes.Encrypt(newPassword); MembershipBs mr = new MembershipBs(); UserProfile up = mr.GetUserProfile(username); up.password = pw; mr.ProcessNurseProfile(up); return(true); } return(false); } }
public override MembershipUser GetUser(string username, bool userIsOnline) { MembershipBs mr = new MembershipBs(); UserProfile up = mr.GetUserProfile(username); return(GetMembershipUser(up)); }
public override bool ValidateUser(string username, string password) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || username.Length > 100) { return(false); } MembershipBs mr = new MembershipBs(); UserProfile up = mr.GetUserProfile(username, password); return((up == null) ? false : true); }