private void ChangePasswordClick(object sender, RoutedEventArgs e) { var currentEncrypted = PasswordEncrypter.EncryptPassword(user.Username, currrent.Password); var newPasswordEncrypted = PasswordEncrypter.EncryptPassword(user.Username, password1.Password); if (currentEncrypted.SequenceEqual(user.Password)) { user.Password = newPasswordEncrypted; user.UserMustChangePassword = false; ESB2UserEventLog.LogUserEvent(user.Username, EventLoggerEvents.UserPasswordChanged); } else { new PasswordChangeFailDialog().ShowDialog(); new ChangePasswordDialog(user).ShowDialog(); } Close(); }
private static bool ValidatePassword(UserLogin user, string password) { return(user.Password.SequenceEqual(PasswordEncrypter.EncryptPassword(user.Username, password))); }
private void CreateAdminAccountClicked(object sender, RoutedEventArgs e) { password = PasswordEncrypter.EncryptPassword("admin", password1.Password); Close(); }