Merge branch 'Patch9' of https://github.com/mRemoteNG/mRemoteNG into Patch9

This commit is contained in:
Sean Kaim
2017-09-18 10:02:09 -04:00

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using mRemoteNG.Connection;
using mRemoteNG.Security.SymmetricEncryption;
using mRemoteNG.App;
namespace mRemoteNG.Tools
{
@@ -169,12 +171,26 @@ namespace mRemoteNG.Tools
break;
case "username":
replacement = _connectionInfo.Username;
if (string.IsNullOrEmpty(replacement))
if (Settings.Default.EmptyCredentials == "windows")
replacement = Environment.UserName;
else if (Settings.Default.EmptyCredentials == "custom")
replacement = Settings.Default.DefaultUsername;
break;
case "password":
replacement = _connectionInfo.Password;
if (string.IsNullOrEmpty(replacement) && Settings.Default.EmptyCredentials == "custom")
replacement = new LegacyRijndaelCryptographyProvider()
.Decrypt(Convert.ToString(Settings.Default.DefaultPassword),
Runtime.EncryptionKey);
break;
case "domain":
replacement = _connectionInfo.Domain;
if (string.IsNullOrEmpty(replacement))
if (Settings.Default.EmptyCredentials == "windows")
replacement = Environment.UserDomainName;
else if (Settings.Default.EmptyCredentials == "custom")
replacement = Settings.Default.DefaultDomain;
break;
case "description":
replacement = _connectionInfo.Description;