public virtual void UpdatePassword(string password) { if (String.IsNullOrEmpty(password)) { throw new ArgumentNullException("password"); } var blog = SubtextContext.Blog; blog.Password = blog.IsPasswordHashed ? SecurityHelper.HashPassword(password) : password; SubtextContext.Repository.UpdateBlog(blog); }
public override void UpdatePassword(string password) { _hostInfo.Password = Config.Settings.UseHashedPasswords ? SecurityHelper.HashPassword(password, _hostInfo.Salt) : password; HostInfo.UpdateHost(_repository, _hostInfo); }
protected bool IsValidPassword(string password, string storedPassword, bool hashed, string salt) { return(storedPassword == (hashed ? SecurityHelper.HashPassword(password, salt) : password)); }