Skip to content

Commit

Permalink
Fix for writing SMTP credentials to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
r-smith committed Dec 18, 2018
1 parent 06842e7 commit beaa474
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions vmPing/Classes/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static void WriteConfiguration()
{
configuration.AppendChild(GenerateOptionNode(
xmlDocument: xd,
name: "EmailPassword",
name: "EmailUser",
value: string.Empty));
}

Expand Down Expand Up @@ -393,11 +393,13 @@ public static void LoadConfiguration()

if (configuration.TryGetValue("EmailUser", out optionValue))
{
ApplicationOptions.EmailUser = DecryptStringAES(optionValue);
if (optionValue.Length > 0)
ApplicationOptions.EmailUser = DecryptStringAES(optionValue);
}
if (configuration.TryGetValue("EmailPassword", out optionValue))
{
ApplicationOptions.EmailPassword = DecryptStringAES(optionValue);
if (optionValue.Length > 0)
ApplicationOptions.EmailPassword = DecryptStringAES(optionValue);
}
}

Expand Down
4 changes: 2 additions & 2 deletions vmPing/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.10.0")]
[assembly: AssemblyFileVersion("1.2.10.0")]
[assembly: AssemblyVersion("1.2.11.0")]
[assembly: AssemblyFileVersion("1.2.11.0")]
6 changes: 6 additions & 0 deletions vmPing/Views/OptionsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ private bool SaveEmailAlertOptions()
return false;
}
}
else
{
ApplicationOptions.IsEmailAuthenticationRequired = false;
SmtpUsername.Text = string.Empty;
SmtpPassword.Password = string.Empty;
}

ApplicationOptions.IsEmailAlertEnabled = true;
ApplicationOptions.EmailServer = SmtpServer.Text;
Expand Down

0 comments on commit beaa474

Please sign in to comment.