From 2ec0cdbc306b99ebf10614c7304a3b3960d6dbfe Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 19 Aug 2013 04:53:10 -0700 Subject: [PATCH] Add 'Connect without credentials' I have my username/password stored in mRemote, but sometimes i want to log in as the service account or administrator account for various reasons. This "new feature" allows you to quickly enter credentials without changing other settings. --- mRemoteV1/App/App.Runtime.vb | 1 - mRemoteV1/Connection/Connection.Info.vb | 1 + mRemoteV1/Connection/Connection.Protocol.RDP.vb | 7 +++++++ mRemoteV1/Language/Language.Designer.vb | 11 ++++++++++- mRemoteV1/Language/Language.resx | 9 ++++++--- mRemoteV1/UI/UI.Window.Tree.vb | 17 ++++++++++++++++- 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/mRemoteV1/App/App.Runtime.vb b/mRemoteV1/App/App.Runtime.vb index 5fdd784c9..dbd0e5a27 100644 --- a/mRemoteV1/App/App.Runtime.vb +++ b/mRemoteV1/App/App.Runtime.vb @@ -1769,7 +1769,6 @@ Namespace App AddHandler newProtocol.Connected, AddressOf Prot_Event_Connected AddHandler newProtocol.Closed, AddressOf Prot_Event_Closed AddHandler newProtocol.ErrorOccured, AddressOf Prot_Event_ErrorOccured - newProtocol.InterfaceControl = New Connection.InterfaceControl(cContainer, newProtocol, newConnectionInfo) newProtocol.Force = Force diff --git a/mRemoteV1/Connection/Connection.Info.vb b/mRemoteV1/Connection/Connection.Info.vb index 2897e4102..fc3ad3531 100644 --- a/mRemoteV1/Connection/Connection.Info.vb +++ b/mRemoteV1/Connection/Connection.Info.vb @@ -2504,6 +2504,7 @@ Namespace Connection DoNotJump = 4 OverridePanel = 8 DontUseConsoleSession = 16 + NoCredentials = 32 End Enum End Class End Namespace \ No newline at end of file diff --git a/mRemoteV1/Connection/Connection.Protocol.RDP.vb b/mRemoteV1/Connection/Connection.Protocol.RDP.vb index c5e429345..ad76bc2be 100644 --- a/mRemoteV1/Connection/Connection.Protocol.RDP.vb +++ b/mRemoteV1/Connection/Connection.Protocol.RDP.vb @@ -244,6 +244,9 @@ Namespace Connection _rdpClient.TransportSettings.GatewayCredsSource = 1 ' TSC_PROXY_CREDS_MODE_SMARTCARD End If If _rdpVersion >= Versions.RDC61 Then + If Me.Force And Info.Force.NoCredentials = Info.Force.NoCredentials Then + Return + End If If _connectionInfo.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.Yes Then _rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.Username _rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.Password @@ -291,6 +294,10 @@ Namespace Connection Private Sub SetCredentials() Try + If Me.Force And Info.Force.NoCredentials = Info.Force.NoCredentials Then + Return + End If + Dim userName As String = _connectionInfo.Username Dim password As String = _connectionInfo.Password Dim domain As String = _connectionInfo.Domain diff --git a/mRemoteV1/Language/Language.Designer.vb b/mRemoteV1/Language/Language.Designer.vb index fc8562500..145abd754 100644 --- a/mRemoteV1/Language/Language.Designer.vb +++ b/mRemoteV1/Language/Language.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.296 +' Runtime Version:4.0.30319.18052 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -1289,6 +1289,15 @@ Namespace My End Get End Property + ''' + ''' Looks up a localized string similar to Connect without credentials (enter it yourself). + ''' + Friend Shared ReadOnly Property strConnectNoCredentials() As String + Get + Return ResourceManager.GetString("strConnectNoCredentials", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Connect to console session. ''' diff --git a/mRemoteV1/Language/Language.resx b/mRemoteV1/Language/Language.resx index 74b3e9f57..51292a0ff 100644 --- a/mRemoteV1/Language/Language.resx +++ b/mRemoteV1/Language/Language.resx @@ -105,15 +105,15 @@ - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - text/microsoft-resx 2.0 + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -2261,4 +2261,7 @@ mRemoteNG will now quit and begin with the installation. Yes + + Connect without credentials (enter it yourself) + \ No newline at end of file diff --git a/mRemoteV1/UI/UI.Window.Tree.vb b/mRemoteV1/UI/UI.Window.Tree.vb index b3412485b..da3489e5c 100644 --- a/mRemoteV1/UI/UI.Window.Tree.vb +++ b/mRemoteV1/UI/UI.Window.Tree.vb @@ -24,6 +24,7 @@ Namespace UI Friend WithEvents cMenTreeConnect As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cMenTreeConnectWithOptions As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cMenTreeConnectWithOptionsConnectToConsoleSession As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cMenTreeConnectWithOptionsNoCredentials As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cMenTreeConnectWithOptionsConnectInFullscreen As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cMenTreeDisconnect As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cMenTreeSep2 As System.Windows.Forms.ToolStripSeparator @@ -63,6 +64,7 @@ Namespace UI Me.cMenTreeSep1 = New System.Windows.Forms.ToolStripSeparator() Me.cMenTreeConnect = New System.Windows.Forms.ToolStripMenuItem() Me.cMenTreeConnectWithOptions = New System.Windows.Forms.ToolStripMenuItem() + Me.cMenTreeConnectWithOptionsNoCredentials = New System.Windows.Forms.ToolStripMenuItem() Me.cMenTreeConnectWithOptionsConnectToConsoleSession = New System.Windows.Forms.ToolStripMenuItem() Me.cMenTreeConnectWithOptionsDontConnectToConsoleSession = New System.Windows.Forms.ToolStripMenuItem() Me.cMenTreeConnectWithOptionsConnectInFullscreen = New System.Windows.Forms.ToolStripMenuItem() @@ -164,7 +166,8 @@ Namespace UI ' 'cMenTreeConnectWithOptions ' - Me.cMenTreeConnectWithOptions.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeConnectWithOptionsConnectToConsoleSession, Me.cMenTreeConnectWithOptionsDontConnectToConsoleSession, Me.cMenTreeConnectWithOptionsConnectInFullscreen, Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting}) + Me.cMenTreeConnectWithOptions.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeConnectWithOptionsConnectToConsoleSession, Me.cMenTreeConnectWithOptionsDontConnectToConsoleSession, Me.cMenTreeConnectWithOptionsConnectInFullscreen, Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting, Me.cMenTreeConnectWithOptionsNoCredentials + }) Me.cMenTreeConnectWithOptions.Name = "cMenTreeConnectWithOptions" Me.cMenTreeConnectWithOptions.Size = New System.Drawing.Size(186, 22) Me.cMenTreeConnectWithOptions.Text = "Connect (with options)" @@ -189,6 +192,13 @@ Namespace UI Me.cMenTreeConnectWithOptionsConnectInFullscreen.Size = New System.Drawing.Size(231, 22) Me.cMenTreeConnectWithOptionsConnectInFullscreen.Text = "Connect in fullscreen" ' + 'cMenTreeConnectWithOptionsNoCredentials + ' + Me.cMenTreeConnectWithOptionsConnectInFullscreen.Image = Global.mRemoteNG.My.Resources.Resources.Fullscreen + Me.cMenTreeConnectWithOptionsConnectInFullscreen.Name = "cMenTreeConnectWithOptionsNoCredentials" + Me.cMenTreeConnectWithOptionsConnectInFullscreen.Size = New System.Drawing.Size(231, 22) + Me.cMenTreeConnectWithOptionsConnectInFullscreen.Text = "Connect without credentials" + ' 'cMenTreeConnectWithOptionsChoosePanelBeforeConnecting ' Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting.Image = Global.mRemoteNG.My.Resources.Resources.Panels @@ -481,6 +491,7 @@ Namespace UI cMenTreeConnect.Text = My.Language.strConnect cMenTreeConnectWithOptions.Text = My.Language.strConnectWithOptions cMenTreeConnectWithOptionsConnectToConsoleSession.Text = My.Language.strConnectToConsoleSession + cMenTreeConnectWithOptionsNoCredentials.Text = My.Language.strConnectNoCredentials cMenTreeConnectWithOptionsConnectInFullscreen.Text = My.Language.strConnectInFullscreen cMenTreeConnectWithOptionsChoosePanelBeforeConnecting.Text = My.Language.strChoosePanelBeforeConnecting cMenTreeDisconnect.Text = My.Language.strMenuDisconnect @@ -937,6 +948,10 @@ Namespace UI App.Runtime.OpenConnection(mRemoteNG.Connection.Info.Force.UseConsoleSession Or mRemoteNG.Connection.Info.Force.DoNotJump) End Sub + Private Sub cMenTreeConnectWithOptionsNoCredentials_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cMenTreeConnectWithOptionsNoCredentials.Click + App.Runtime.OpenConnection(mRemoteNG.Connection.Info.Force.NoCredentials) + End Sub + Private Sub cMenTreeConnectWithOptionsDontConnectToConsoleSession_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cMenTreeConnectWithOptionsDontConnectToConsoleSession.Click App.Runtime.OpenConnection(mRemoteNG.Connection.Info.Force.DontUseConsoleSession Or mRemoteNG.Connection.Info.Force.DoNotJump) End Sub