Makes MakeLocalConnection() used

This commit is contained in:
Cyberboss
2017-09-17 23:56:02 -04:00
parent bb31704c6a
commit 5ddb4887fb
3 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -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":
+1 -1
View File
@@ -28,7 +28,7 @@ namespace TGControlPanel
private void LocalLoginButton_Click(object sender, EventArgs e)
{
Server.SetRemoteLoginInformation(null, 0, null, null);
Server.MakeLocalConnection();
VerifyAndConnect();
}
+7 -6
View File
@@ -43,7 +43,8 @@ namespace TGServiceInterface
public static void MakeLocalConnection()
{
HTTPSURL = null;
}
HTTPSPassword = null;
}
/// <summary>
/// Set the interface to look for services on a remote computer
@@ -56,7 +57,7 @@ namespace TGServiceInterface
HTTPSPort = port;
HTTPSUsername = username;
HTTPSPassword = password;
}
}
/// <summary>
/// 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();
}
/// <summary>