RDPConf: Add feature to hide users on logon

This commit is contained in:
binarymaster 2016-07-23 22:08:44 +03:00
parent 2d482b29be
commit 3edd0e5300
2 changed files with 105 additions and 72 deletions

View File

@ -3,8 +3,8 @@ object MainForm: TMainForm
Top = 0 Top = 0
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'RDP Wrapper Configuration' Caption = 'RDP Wrapper Configuration'
ClientHeight = 352 ClientHeight = 314
ClientWidth = 351 ClientWidth = 404
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -18,78 +18,53 @@ object MainForm: TMainForm
OnDestroy = FormDestroy OnDestroy = FormDestroy
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
object lRDPPort: TLabel
Left = 225
Top = 103
Width = 47
Height = 13
Caption = 'RDP Port:'
end
object bOK: TButton object bOK: TButton
Left = 10 Left = 40
Top = 319 Top = 281
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'OK' Caption = 'OK'
ModalResult = 1 ModalResult = 1
TabOrder = 0 TabOrder = 4
OnClick = bOKClick OnClick = bOKClick
end end
object bCancel: TButton object bCancel: TButton
Left = 91 Left = 121
Top = 319 Top = 281
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
ModalResult = 2 ModalResult = 2
TabOrder = 1 TabOrder = 5
OnClick = bCancelClick OnClick = bCancelClick
end end
object bApply: TButton object bApply: TButton
Left = 172 Left = 202
Top = 319 Top = 281
Width = 75 Width = 75
Height = 25 Height = 25
Caption = 'Apply' Caption = 'Apply'
Enabled = False Enabled = False
TabOrder = 2 TabOrder = 6
OnClick = bApplyClick OnClick = bApplyClick
end end
object cbSingleSessionPerUser: TCheckBox
Left = 8
Top = 112
Width = 130
Height = 17
Caption = 'Single Session Per User'
TabOrder = 3
OnClick = cbAllowTSConnectionsClick
end
object rgNLA: TRadioGroup object rgNLA: TRadioGroup
Left = 8 Left = 202
Top = 132
Width = 335
Height = 73
Caption = 'Security Mode'
Items.Strings = (
'Disable Security (not recommended)'
'Default Authentication (compatibility with older clients)'
'Network Level Authentication (best)')
TabOrder = 4
OnClick = cbAllowTSConnectionsClick
end
object cbAllowTSConnections: TCheckBox
Left = 8
Top = 89 Top = 89
Width = 174 Width = 194
Height = 17 Height = 73
Caption = 'Enable Remote Desktop Protocol' Caption = 'Authentication Mode'
TabOrder = 5 Items.Strings = (
'GUI Authentication Only'
'Default RDP Authentication'
'Network Level Authentication')
TabOrder = 2
OnClick = cbAllowTSConnectionsClick OnClick = cbAllowTSConnectionsClick
end end
object rgShadow: TRadioGroup object rgShadow: TRadioGroup
Left = 8 Left = 202
Top = 208 Top = 168
Width = 335 Width = 194
Height = 105 Height = 105
Caption = 'Session Shadowing Mode' Caption = 'Session Shadowing Mode'
Items.Strings = ( Items.Strings = (
@ -98,36 +73,25 @@ object MainForm: TMainForm
'Full access without permission' 'Full access without permission'
'View only with user'#39's permission' 'View only with user'#39's permission'
'View only without permission') 'View only without permission')
TabOrder = 6 TabOrder = 3
OnClick = cbAllowTSConnectionsClick OnClick = cbAllowTSConnectionsClick
end end
object seRDPPort: TSpinEdit
Left = 278
Top = 100
Width = 62
Height = 22
MaxValue = 65535
MinValue = 0
TabOrder = 7
Value = 0
OnChange = seRDPPortChange
end
object bLicense: TButton object bLicense: TButton
Left = 253 Left = 283
Top = 319 Top = 281
Width = 87 Width = 87
Height = 25 Height = 25
Caption = 'View license...' Caption = 'View license...'
TabOrder = 8 TabOrder = 7
OnClick = bLicenseClick OnClick = bLicenseClick
end end
object gbDiag: TGroupBox object gbDiag: TGroupBox
Left = 8 Left = 8
Top = 6 Top = 6
Width = 335 Width = 388
Height = 77 Height = 77
Caption = 'Diagnostics' Caption = 'Diagnostics'
TabOrder = 9 TabOrder = 0
object lListener: TLabel object lListener: TLabel
Left = 11 Left = 11
Top = 55 Top = 55
@ -157,7 +121,7 @@ object MainForm: TMainForm
Caption = 'Unknown' Caption = 'Unknown'
end end
object lsTSVer: TLabel object lsTSVer: TLabel
Left = 206 Left = 226
Top = 36 Top = 36
Width = 44 Width = 44
Height = 13 Height = 13
@ -171,14 +135,14 @@ object MainForm: TMainForm
Caption = 'Unknown' Caption = 'Unknown'
end end
object lsWrapVer: TLabel object lsWrapVer: TLabel
Left = 206 Left = 226
Top = 17 Top = 17
Width = 44 Width = 44
Height = 13 Height = 13
Caption = 'Unknown' Caption = 'Unknown'
end end
object lTSVer: TLabel object lTSVer: TLabel
Left = 182 Left = 202
Top = 36 Top = 36
Width = 20 Width = 20
Height = 13 Height = 13
@ -192,24 +156,77 @@ object MainForm: TMainForm
Caption = 'Wrapper state:' Caption = 'Wrapper state:'
end end
object lWrapVer: TLabel object lWrapVer: TLabel
Left = 182 Left = 202
Top = 17 Top = 17
Width = 20 Width = 20
Height = 13 Height = 13
Caption = 'ver.' Caption = 'ver.'
end end
object lsSuppVer: TLabel object lsSuppVer: TLabel
Left = 182 Left = 202
Top = 55 Top = 55
Width = 70 Width = 70
Height = 13 Height = 13
Caption = '[support level]' Caption = '[support level]'
end end
end end
object gbGeneral: TGroupBox
Left = 8
Top = 89
Width = 188
Height = 184
Caption = 'General Settings'
TabOrder = 1
object lRDPPort: TLabel
Left = 8
Top = 44
Width = 47
Height = 13
Caption = 'RDP port:'
end
object cbAllowTSConnections: TCheckBox
Left = 8
Top = 18
Width = 132
Height = 17
Caption = 'Enable Remote Desktop'
TabOrder = 0
OnClick = cbAllowTSConnectionsClick
end
object cbSingleSessionPerUser: TCheckBox
Left = 8
Top = 69
Width = 129
Height = 17
Caption = 'Single session per user'
TabOrder = 2
OnClick = cbAllowTSConnectionsClick
end
object cbHideUsers: TCheckBox
Left = 8
Top = 92
Width = 149
Height = 17
Caption = 'Hide users on logon screen'
TabOrder = 3
OnClick = cbAllowTSConnectionsClick
end
object seRDPPort: TSpinEdit
Left = 61
Top = 41
Width = 62
Height = 22
MaxValue = 65535
MinValue = 0
TabOrder = 1
Value = 0
OnChange = seRDPPortChange
end
end
object Timer: TTimer object Timer: TTimer
Interval = 250 Interval = 250
OnTimer = TimerTimer OnTimer = TimerTimer
Left = 280 Left = 352
Top = 19 Top = 27
end end
end end

View File

@ -47,6 +47,8 @@ type
bLicense: TButton; bLicense: TButton;
gbDiag: TGroupBox; gbDiag: TGroupBox;
lsSuppVer: TLabel; lsSuppVer: TLabel;
cbHideUsers: TCheckBox;
gbGeneral: TGroupBox;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure cbAllowTSConnectionsClick(Sender: TObject); procedure cbAllowTSConnectionsClick(Sender: TObject);
procedure seRDPPortChange(Sender: TObject); procedure seRDPPortChange(Sender: TObject);
@ -400,6 +402,13 @@ begin
rgShadow.ItemIndex := Reg.ReadInteger('Shadow'); rgShadow.ItemIndex := Reg.ReadInteger('Shadow');
except except
end;
Reg.CloseKey;
Reg.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System');
try
cbHideUsers.Checked := Reg.ReadBool('dontdisplaylastusername');
except
end; end;
Reg.CloseKey; Reg.CloseKey;
Reg.Free; Reg.Free;
@ -477,6 +486,13 @@ begin
except except
end; end;
end;
Reg.CloseKey;
Reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', True);
try
Reg.WriteBool('dontdisplaylastusername', cbHideUsers.Checked);
except
end; end;
Reg.CloseKey; Reg.CloseKey;
Reg.Free; Reg.Free;