Skip to content

Commit

Permalink
Add feature MR-212 - Add option to connect without credentials
Browse files Browse the repository at this point in the history
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.
(cherry picked from commit 2ec0cdb by cyclops1982)

Conflicts:
	mRemoteV1/Language/Language.Designer.vb
	mRemoteV1/Language/Language.resx
  • Loading branch information
rmcardle committed Nov 16, 2013
1 parent b600411 commit 2db0422
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1.73:
Added feature MR-16 - Add keyboard shortcuts to switch between tabs
Added feature MR-141 - Add a default protocol option
Added feature MR-212 - Add option to connect without credentials
Added feature MR-547 - Add support for Xming Portable PuTTY
Made improvement MR-367 - Make the 'Connect' button on the 'Quick Connect' toolbar a forced dropdown
Made improvement MR-590 - Make panels docked to the edge of the window keep their size
Expand Down
1 change: 1 addition & 0 deletions CREDITS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Contributors
Jason Barbier
Wiktor Beryt
Lionel Caignec
Ruben d'Arco
Felix Deimel
Holger Henke
Tom Hiller
Expand Down
1 change: 1 addition & 0 deletions mRemoteV1/Connection/Connection.Info.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,7 @@ Namespace Connection
DoNotJump = 4
OverridePanel = 8
DontUseConsoleSession = 16
NoCredentials = 32
End Enum
End Class
End Namespace
2 changes: 1 addition & 1 deletion mRemoteV1/Connection/Connection.Protocol.HTTPBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Namespace Connection
Dim strHost As String = Me.InterfaceControl.Info.Hostname
Dim strAuth As String = ""

If Me.InterfaceControl.Info.Username <> "" And Me.InterfaceControl.Info.Password <> "" Then
If Not ((Force And Info.Force.NoCredentials) = Info.Force.NoCredentials) And Not String.IsNullOrEmpty(InterfaceControl.Info.Username) And Not String.IsNullOrEmpty(InterfaceControl.Info.Password) Then
strAuth = "Authorization: Basic " + Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(Me.InterfaceControl.Info.Username & ":" & Me.InterfaceControl.Info.Password)) & vbNewLine
End If

Expand Down
2 changes: 2 additions & 0 deletions mRemoteV1/Connection/Connection.Protocol.ICA.vb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ Namespace Connection
#Region "Private Methods"
Private Sub SetCredentials()
Try
If (Force And Info.Force.NoCredentials) = Info.Force.NoCredentials Then Return

Dim _user As String = Me.Info.Username
Dim _pass As String = Me.Info.Password
Dim _dom As String = Me.Info.Domain
Expand Down
13 changes: 8 additions & 5 deletions mRemoteV1/Connection/Connection.Protocol.PuttyBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,14 @@ Namespace Connection
End If

arguments.Add("-" & _PuttySSHVersion)
If Not String.IsNullOrEmpty(username) Then
arguments.Add("-l", username)
End If
If Not String.IsNullOrEmpty(password) Then
arguments.Add("-pw", password)

If Not ((Force And Info.Force.NoCredentials) = Info.Force.NoCredentials) Then
If Not String.IsNullOrEmpty(username) Then
arguments.Add("-l", username)
End If
If Not String.IsNullOrEmpty(password) Then
arguments.Add("-pw", password)
End If
End If
End If

Expand Down
4 changes: 3 additions & 1 deletion mRemoteV1/Connection/Connection.Protocol.RDP.vb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Namespace Connection
If _connectionInfo.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.SmartCard Then
_rdpClient.TransportSettings.GatewayCredsSource = 1 ' TSC_PROXY_CREDS_MODE_SMARTCARD
End If
If _rdpVersion >= Versions.RDC61 Then
If _rdpVersion >= Versions.RDC61 And Not ((Force And Info.Force.NoCredentials) = Info.Force.NoCredentials) Then
If _connectionInfo.RDGatewayUseConnectionCredentials = RDGatewayUseConnectionCredentials.Yes Then
_rdpClient.TransportSettings2.GatewayUsername = _connectionInfo.Username
_rdpClient.TransportSettings2.GatewayPassword = _connectionInfo.Password
Expand Down Expand Up @@ -298,6 +298,8 @@ Namespace Connection

Private Sub SetCredentials()
Try
If (Force And Info.Force.NoCredentials) = Info.Force.NoCredentials Then Return

Dim userName As String = _connectionInfo.Username
Dim password As String = _connectionInfo.Password
Dim domain As String = _connectionInfo.Domain
Expand Down
2 changes: 1 addition & 1 deletion mRemoteV1/Connection/Connection.Protocol.VNC.vb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Namespace Connection
AddHandler VNC.ConnectComplete, AddressOf VNCEvent_Connected
AddHandler VNC.ConnectionLost, AddressOf VNCEvent_Disconnected
AddHandler mRemoteNG.frmMain.clipboardchange, AddressOf VNCEvent_ClipboardChanged
If Not String.IsNullOrEmpty(Info.Password) Then
If Not ((Force And Info.Force.NoCredentials) = Info.Force.NoCredentials) And Not String.IsNullOrEmpty(Info.Password) Then
VNC.GetPassword = AddressOf VNCEvent_Authenticate
End If
Catch ex As Exception
Expand Down
9 changes: 9 additions & 0 deletions mRemoteV1/Language/Language.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions mRemoteV1/Language/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ Starting with new connections file.</value>
<data name="strConnectionsFileCouldNotSaveAs" xml:space="preserve">
<value>Couldn't save connections file as "{0}"!</value>
</data>
<data name="strConnectNoCredentials" xml:space="preserve">
<value>Connect without credentials</value>
</data>
<data name="strConnectToConsoleSession" xml:space="preserve">
<value>Connect to console session</value>
</data>
Expand Down
7 changes: 7 additions & 0 deletions mRemoteV1/My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions mRemoteV1/My Project/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,8 @@
<data name="PuttySessions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\PuttySessions.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="key_delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\key_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added mRemoteV1/Resources/key_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions mRemoteV1/UI/UI.Window.Tree.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,6 +67,7 @@ Namespace UI
Me.cMenTreeConnectWithOptionsConnectToConsoleSession = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsDontConnectToConsoleSession = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsConnectInFullscreen = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsNoCredentials = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeDisconnect = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep2 = New System.Windows.Forms.ToolStripSeparator()
Expand Down Expand Up @@ -132,7 +134,7 @@ Namespace UI
Me.cMenTree.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeAddConnection, Me.cMenTreeAddFolder, Me.cMenTreeSep1, Me.cMenTreeConnect, Me.cMenTreeConnectWithOptions, Me.cMenTreeDisconnect, Me.cMenTreeSep2, Me.cMenTreeToolsTransferFile, Me.cMenTreeToolsImportExport, Me.cMenTreeToolsSort, Me.cMenTreeToolsExternalApps, Me.cMenTreeSep3, Me.cMenTreeDuplicate, Me.cMenTreeRename, Me.cMenTreeDelete, Me.cMenTreeSep4, Me.cMenTreeMoveUp, Me.cMenTreeMoveDown})
Me.cMenTree.Name = "cMenTree"
Me.cMenTree.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional
Me.cMenTree.Size = New System.Drawing.Size(187, 336)
Me.cMenTree.Size = New System.Drawing.Size(187, 358)
'
'cMenTreeAddConnection
'
Expand Down Expand Up @@ -164,7 +166,7 @@ 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.cMenTreeConnectWithOptionsNoCredentials, Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting})
Me.cMenTreeConnectWithOptions.Name = "cMenTreeConnectWithOptions"
Me.cMenTreeConnectWithOptions.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeConnectWithOptions.Text = "Connect (with options)"
Expand All @@ -189,6 +191,13 @@ Namespace UI
Me.cMenTreeConnectWithOptionsConnectInFullscreen.Size = New System.Drawing.Size(231, 22)
Me.cMenTreeConnectWithOptionsConnectInFullscreen.Text = "Connect in fullscreen"
'
'cMenTreeConnectWithOptionsNoCredentials
'
Me.cMenTreeConnectWithOptionsNoCredentials.Image = Global.mRemoteNG.My.Resources.Resources.key_delete
Me.cMenTreeConnectWithOptionsNoCredentials.Name = "cMenTreeConnectWithOptionsNoCredentials"
Me.cMenTreeConnectWithOptionsNoCredentials.Size = New System.Drawing.Size(231, 22)
Me.cMenTreeConnectWithOptionsNoCredentials.Text = "Connect without credentials"
'
'cMenTreeConnectWithOptionsChoosePanelBeforeConnecting
'
Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting.Image = Global.mRemoteNG.My.Resources.Resources.Panels
Expand Down Expand Up @@ -481,6 +490,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
Expand Down Expand Up @@ -697,6 +707,10 @@ Namespace UI
cMenTreeConnectWithOptionsConnectToConsoleSession.Enabled = False
End If

If (connectionInfo.Protocol = mRemoteNG.Connection.Protocol.Protocols.IntApp) Then
cMenTreeConnectWithOptionsNoCredentials.Enabled = False
End If

cMenTreeToolsImportExport.Enabled = False
Case mRemoteNG.Tree.Node.Type.PuttySession
Dim puttySessionInfo As mRemoteNG.Connection.PuttySession.Info = selectedNode.Tag
Expand Down Expand Up @@ -937,6 +951,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
Expand Down
1 change: 1 addition & 0 deletions mRemoteV1/mRemoteV1.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@
<Content Include="Help\Update.htm">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\key_delete.png" />
<None Include="Resources\Images\PuttySessions.png" />
<None Include="Notes\Help.txt" />
<None Include="Notes\ICA.txt" />
Expand Down

0 comments on commit 2db0422

Please sign in to comment.