From 5ddb4887fb332bf43c15080ae23f3cc5f847de0c Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Sun, 17 Sep 2017 23:56:02 -0400 Subject: [PATCH] Makes MakeLocalConnection() used --- TGCommandLine/Program.cs | 6 +++--- TGControlPanel/Login.cs | 2 +- TGServiceInterface/Server.cs | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/TGCommandLine/Program.cs b/TGCommandLine/Program.cs index 6c1e5f9aef..2d60af356b 100644 --- a/TGCommandLine/Program.cs +++ b/TGCommandLine/Program.cs @@ -149,12 +149,12 @@ namespace TGCommandLine if (res != null) { Console.WriteLine("Unable to connect: " + res); - Server.SetRemoteLoginInformation(null, 0, null, null); + Server.MakeLocalConnection(); } else if (!Server.Authenticate()) { Console.WriteLine("Authentication error: Username/password/windows identity is not authorized! Returning to local mode..."); - Server.SetRemoteLoginInformation(null, 0, null, null); + Server.MakeLocalConnection(); } else { @@ -163,7 +163,7 @@ namespace TGCommandLine } break; case "disconnect": - Server.SetRemoteLoginInformation(null, 0, null, null); + Server.MakeLocalConnection(); Console.WriteLine("Switch to local mode"); break; case "quit": diff --git a/TGControlPanel/Login.cs b/TGControlPanel/Login.cs index d37e5a6c8b..b6292425df 100644 --- a/TGControlPanel/Login.cs +++ b/TGControlPanel/Login.cs @@ -28,7 +28,7 @@ namespace TGControlPanel private void LocalLoginButton_Click(object sender, EventArgs e) { - Server.SetRemoteLoginInformation(null, 0, null, null); + Server.MakeLocalConnection(); VerifyAndConnect(); } diff --git a/TGServiceInterface/Server.cs b/TGServiceInterface/Server.cs index 31360754ff..855250dfb2 100644 --- a/TGServiceInterface/Server.cs +++ b/TGServiceInterface/Server.cs @@ -43,7 +43,8 @@ namespace TGServiceInterface public static void MakeLocalConnection() { HTTPSURL = null; - } + HTTPSPassword = null; + } /// /// Set the interface to look for services on a remote computer @@ -56,7 +57,7 @@ namespace TGServiceInterface HTTPSPort = port; HTTPSUsername = username; HTTPSPassword = password; - } + } /// /// Returns the requested server component interface. This does not guarantee a successful connection @@ -91,12 +92,12 @@ namespace TGServiceInterface { outChannel.Credentials.UserName.UserName = HTTPSUsername; outChannel.Credentials.UserName.Password = HTTPSPassword; - } + } #if DEBUG - //allow self signed certs in debug mode - ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true; + //allow self signed certs in debug mode + ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true; #endif - return outChannel.CreateChannel(); + return outChannel.CreateChannel(); } ///