Example #1
0
        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();
        }
Example #2
0
 private static bool ValidatePassword(UserLogin user, string password)
 {
     return(user.Password.SequenceEqual(PasswordEncrypter.EncryptPassword(user.Username, password)));
 }
Example #3
0
 private void CreateAdminAccountClicked(object sender, RoutedEventArgs e)
 {
     password = PasswordEncrypter.EncryptPassword("admin", password1.Password);
     Close();
 }