SiteAdvanced.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. //----------------------------------------------------------------------------
  2. #ifndef SiteAdvancedH
  3. #define SiteAdvancedH
  4. //----------------------------------------------------------------------------
  5. #include "ComboEdit.hpp"
  6. #include "PasswordEdit.hpp"
  7. #include "UpDownEdit.hpp"
  8. #include <System.Classes.hpp>
  9. #include <Vcl.ActnList.hpp>
  10. #include <Vcl.ComCtrls.hpp>
  11. #include <Vcl.Controls.hpp>
  12. #include <Vcl.ExtCtrls.hpp>
  13. #include <Vcl.Forms.hpp>
  14. #include <Vcl.ImgList.hpp>
  15. #include <Vcl.Mask.hpp>
  16. #include <Vcl.Menus.hpp>
  17. #include <Vcl.StdCtrls.hpp>
  18. #include "PngImageList.hpp"
  19. //----------------------------------------------------------------------------
  20. #include <Configuration.h>
  21. #include <SessionData.h>
  22. #include <PasTools.hpp>
  23. #include <GUITools.h>
  24. //----------------------------------------------------------------------------
  25. class TSiteAdvancedDialog : public TForm
  26. {
  27. __published:
  28. TPanel *MainPanel;
  29. TPageControl *PageControl;
  30. TTabSheet *AdvancedSheet;
  31. TGroupBox *ProtocolGroup;
  32. TCheckBox *CompressionCheck;
  33. TTabSheet *EnvironmentSheet;
  34. TTabSheet *ScpSheet;
  35. TGroupBox *OtherShellOptionsGroup;
  36. TCheckBox *LookupUserGroupsCheck;
  37. TCheckBox *ClearAliasesCheck;
  38. TCheckBox *UnsetNationalVarsCheck;
  39. TCheckBox *Scp1CompatibilityCheck;
  40. TGroupBox *ShellGroup;
  41. TComboBox *ShellEdit;
  42. TPanel *LeftPanel;
  43. TTreeView *NavigationTree;
  44. TTabSheet *ConnSheet;
  45. TGroupBox *TimeoutGroup;
  46. TLabel *Label11;
  47. TLabel *Label12;
  48. TUpDownEdit *TimeoutEdit;
  49. TTabSheet *ProxySheet;
  50. TGroupBox *ProxyTypeGroup;
  51. TLabel *ProxyHostLabel;
  52. TLabel *ProxyPortLabel;
  53. TUpDownEdit *ProxyPortEdit;
  54. TEdit *ProxyHostEdit;
  55. TEdit *ProxyUsernameEdit;
  56. TLabel *ProxyUsernameLabel;
  57. TLabel *ProxyPasswordLabel;
  58. TPasswordEdit *ProxyPasswordEdit;
  59. TGroupBox *ProxySettingsGroup;
  60. TLabel *ProxyTelnetCommandLabel;
  61. TEdit *ProxyTelnetCommandEdit;
  62. TTabSheet *BugsSheet;
  63. TGroupBox *BugsGroupBox;
  64. TLabel *BugHMAC2Label;
  65. TComboBox *BugHMAC2Combo;
  66. TLabel *BugDeriveKey2Label;
  67. TComboBox *BugDeriveKey2Combo;
  68. TLabel *BugRSAPad2Label;
  69. TComboBox *BugRSAPad2Combo;
  70. TTabSheet *AuthSheet;
  71. TGroupBox *AuthenticationGroup;
  72. TCheckBox *AuthKICheck;
  73. TGroupBox *EncryptionGroup;
  74. TListBox *CipherListBox;
  75. TLabel *Label8;
  76. TCheckBox *Ssh2LegacyDESCheck;
  77. TButton *CipherUpButton;
  78. TButton *CipherDownButton;
  79. TGroupBox *EnvironmentGroup;
  80. TLabel *BugPKSessID2Label;
  81. TComboBox *BugPKSessID2Combo;
  82. TCheckBox *ProxyLocalhostCheck;
  83. TLabel *Label17;
  84. TGroupBox *PingGroup;
  85. TLabel *PingIntervalLabel;
  86. TUpDownEdit *PingIntervalSecEdit;
  87. TRadioButton *PingOffButton;
  88. TRadioButton *PingNullPacketButton;
  89. TRadioButton *PingDummyCommandButton;
  90. TCheckBox *AuthKIPasswordCheck;
  91. TTabSheet *DirectoriesSheet;
  92. TGroupBox *DirectoriesGroup;
  93. TLabel *LocalDirectoryLabel;
  94. TLabel *RemoteDirectoryLabel;
  95. TLabel *LocalDirectoryDescLabel;
  96. TDirectoryEdit *LocalDirectoryEdit;
  97. TEdit *RemoteDirectoryEdit;
  98. TCheckBox *UpdateDirectoriesCheck;
  99. TCheckBox *CacheDirectoriesCheck;
  100. TCheckBox *ResolveSymlinksCheck;
  101. TCheckBox *CacheDirectoryChangesCheck;
  102. TCheckBox *PreserveDirectoryChangesCheck;
  103. TGroupBox *DSTModeGroup;
  104. TRadioButton *DSTModeUnixCheck;
  105. TRadioButton *DSTModeWinCheck;
  106. TGroupBox *ScpLsOptionsGroup;
  107. TCheckBox *IgnoreLsWarningsCheck;
  108. TCheckBox *SCPLsFullTimeAutoCheck;
  109. TTabSheet *SftpSheet;
  110. TGroupBox *SFTPBugsGroupBox;
  111. TLabel *Label10;
  112. TLabel *Label36;
  113. TComboBox *SFTPBugSymlinkCombo;
  114. TTabSheet *KexSheet;
  115. TGroupBox *KexOptionsGroup;
  116. TLabel *Label28;
  117. TListBox *KexListBox;
  118. TButton *KexUpButton;
  119. TButton *KexDownButton;
  120. TGroupBox *KexReexchangeGroup;
  121. TLabel *Label31;
  122. TUpDownEdit *RekeyTimeEdit;
  123. TLabel *Label32;
  124. TEdit *RekeyDataEdit;
  125. TGroupBox *IPvGroup;
  126. TRadioButton *IPAutoButton;
  127. TRadioButton *IPv4Button;
  128. TRadioButton *IPv6Button;
  129. TLabel *BugRekey2Label;
  130. TComboBox *BugRekey2Combo;
  131. TGroupBox *SFTPProtocolGroup;
  132. TLabel *Label34;
  133. TComboBox *SFTPMaxVersionCombo;
  134. TComboBox *SFTPBugSignedTSCombo;
  135. TGroupBox *DirectoryOptionsGroup;
  136. TTabSheet *TunnelSheet;
  137. TGroupBox *TunnelSessionGroup;
  138. TLabel *Label6;
  139. TLabel *Label14;
  140. TLabel *Label15;
  141. TLabel *Label16;
  142. TLabel *Label18;
  143. TEdit *TunnelHostNameEdit;
  144. TEdit *TunnelUserNameEdit;
  145. TPasswordEdit *TunnelPasswordEdit;
  146. TUpDownEdit *TunnelPortNumberEdit;
  147. TFilenameEdit *TunnelPrivateKeyEdit3;
  148. TLabel *Label19;
  149. TComboBox *ReturnVarEdit;
  150. TLabel *Label20;
  151. TGroupBox *AuthenticationParamsGroup;
  152. TCheckBox *AgentFwdCheck;
  153. TCheckBox *TunnelCheck;
  154. TGroupBox *TunnelOptionsGroup;
  155. TLabel *Label21;
  156. TComboBox *TunnelLocalPortNumberEdit;
  157. TRadioButton *DSTModeKeepCheck;
  158. TGroupBox *ConnectionGroup;
  159. TCheckBox *FtpPasvModeCheck;
  160. TTabSheet *RecycleBinSheet;
  161. TGroupBox *RecycleBinGroup;
  162. TLabel *RecycleBinPathLabel;
  163. TCheckBox *DeleteToRecycleBinCheck;
  164. TCheckBox *OverwrittenToRecycleBinCheck;
  165. TEdit *RecycleBinPathEdit;
  166. TLabel *EOLTypeLabel;
  167. TComboBox *EOLTypeCombo;
  168. TLabel *UtfLabel;
  169. TComboBox *UtfCombo;
  170. TLabel *TimeDifferenceLabel;
  171. TUpDownEdit *TimeDifferenceEdit;
  172. TLabel *TimeDifferenceHoursLabel;
  173. TUpDownEdit *TimeDifferenceMinutesEdit;
  174. TLabel *TimeDifferenceMinutesLabel;
  175. TLabel *Label9;
  176. TComboBox *ListingCommandEdit;
  177. TCheckBox *SshNoUserAuthCheck;
  178. TCheckBox *TryAgentCheck;
  179. TLabel *ProxyMethodLabel;
  180. TComboBox *SshProxyMethodCombo;
  181. TComboBox *ProxyDNSCombo;
  182. TComboBox *FtpProxyMethodCombo;
  183. TLabel *ProxyLocalCommandLabel;
  184. TEdit *ProxyLocalCommandEdit;
  185. TButton *ProxyLocalCommandBrowseButton;
  186. TStaticText *ProxyTelnetCommandHintText;
  187. TStaticText *ProxyLocalCommandHintText;
  188. TGroupBox *FtpPingGroup;
  189. TLabel *FtpPingIntervalLabel;
  190. TUpDownEdit *FtpPingIntervalSecEdit;
  191. TRadioButton *FtpPingOffButton;
  192. TRadioButton *FtpPingNullPacketButton;
  193. TRadioButton *FtpPingDummyCommandButton;
  194. TLabel *Label23;
  195. TComboBox *SftpServerEdit;
  196. TTabSheet *FtpSheet;
  197. TGroupBox *FtpGroup;
  198. TLabel *Label25;
  199. TMemo *PostLoginCommandsMemo;
  200. TLabel *BugMaxPkt2Label;
  201. TComboBox *BugMaxPkt2Combo;
  202. TLabel *FtpListAllLabel;
  203. TComboBox *FtpListAllCombo;
  204. TComboBox *FtpForcePasvIpCombo;
  205. TCheckBox *AllowScpFallbackCheck;
  206. TCheckBox *BufferSizeCheck;
  207. TCheckBox *SynchronizeBrowsingCheck;
  208. TGroupBox *GSSAPIGroup;
  209. TCheckBox *AuthGSSAPICheck3;
  210. TCheckBox *GSSAPIFwdTGTCheck;
  211. TLabel *BugIgnore2Label;
  212. TComboBox *BugIgnore2Combo;
  213. TComboBox *NeonProxyMethodCombo;
  214. TLabel *Label24;
  215. TComboBox *FtpUseMlsdCombo;
  216. TLabel *FtpForcePasvIpLabel;
  217. TButton *OKBtn;
  218. TButton *CancelBtn;
  219. TButton *HelpButton;
  220. TLabel *FtpAccountLabel;
  221. TEdit *FtpAccountEdit;
  222. TLabel *PrivateKeyLabel;
  223. TFilenameEdit *PrivateKeyEdit3;
  224. TGroupBox *TunnelAuthenticationParamsGroup;
  225. TImageList *ColorImageList;
  226. TButton *ColorButton;
  227. TTabSheet *SslSheet;
  228. TGroupBox *SslGroup;
  229. TLabel *Label1;
  230. TComboBox *MinTlsVersionCombo;
  231. TLabel *Label2;
  232. TComboBox *MaxTlsVersionCombo;
  233. TCheckBox *SslSessionReuseCheck;
  234. TLabel *BugWinAdjLabel;
  235. TComboBox *BugWinAdjCombo;
  236. TButton *ProxyAutodetectButton;
  237. TTabSheet *NoteSheet;
  238. TGroupBox *NoteGroup;
  239. TMemo *NoteMemo;
  240. TCheckBox *TimeDifferenceAutoCheck;
  241. TLabel *Label3;
  242. TComboBox *FtpHostCombo;
  243. TGroupBox *TlsAuthenticationGroup;
  244. TLabel *Label4;
  245. TFilenameEdit *TlsCertificateFileEdit;
  246. TCheckBox *TrimVMSVersionsCheck;
  247. TCheckBox *FollowDirectorySymlinksCheck;
  248. TImageList *ColorImageList120;
  249. TImageList *ColorImageList144;
  250. TImageList *ColorImageList192;
  251. TButton *PrivateKeyToolsButton;
  252. TPopupMenu *PrivateKeyMenu;
  253. TMenuItem *PrivateKeyGenerateItem;
  254. TMenuItem *PrivateKeyUploadItem;
  255. TButton *PrivateKeyViewButton;
  256. TTabSheet *EncryptionSheet;
  257. TCheckBox *EncryptFilesCheck;
  258. TGroupBox *EncryptFilesGroup;
  259. TLabel *Label13;
  260. TPasswordEdit *EncryptKeyPasswordEdit;
  261. TCheckBox *ShowEncryptionKeyCheck;
  262. TButton *GenerateKeyButton;
  263. TEdit *EncryptKeyVisibleEdit;
  264. TTabSheet *S3Sheet;
  265. TGroupBox *S3Group;
  266. TLabel *Label27;
  267. TComboBox *S3DefaultReqionCombo;
  268. TLabel *S3UrlStyleLabel;
  269. TComboBox *S3UrlStyleCombo;
  270. TGroupBox *PuttyGroup;
  271. TButton *PuttySettingsButton;
  272. TLabel *PuttySettingsLabel;
  273. TEdit *PuttySettingsEdit;
  274. TCheckBox *AuthGSSAPIKEXCheck;
  275. TTabSheet *WebDavSheet;
  276. TGroupBox *WebdavGroup;
  277. TCheckBox *WebDavLiberalEscapingCheck;
  278. TGroupBox *S3AuthenticationGroup;
  279. TLabel *S3SessionTokenLabel;
  280. TMemo *S3SessionTokenMemo;
  281. TCheckBox *VMSAllRevisionsCheck;
  282. void __fastcall DataChange(TObject *Sender);
  283. void __fastcall FormShow(TObject *Sender);
  284. void __fastcall PageControlChange(TObject *Sender);
  285. void __fastcall AlgListBoxStartDrag(TObject *Sender,
  286. TDragObject *&DragObject);
  287. void __fastcall AlgListBoxDragOver(TObject *Sender, TObject *Source,
  288. int X, int Y, TDragState State, bool &Accept);
  289. void __fastcall AlgListBoxDragDrop(TObject *Sender, TObject *Source,
  290. int X, int Y);
  291. void __fastcall CipherButtonClick(TObject *Sender);
  292. void __fastcall AuthGSSAPICheck3Click(TObject *Sender);
  293. void __fastcall KexButtonClick(TObject *Sender);
  294. void __fastcall HelpButtonClick(TObject *Sender);
  295. void __fastcall PrivateKeyEdit3AfterDialog(TObject *Sender,
  296. UnicodeString &Name, bool &Action);
  297. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  298. void __fastcall PathEditBeforeDialog(TObject *Sender, UnicodeString &Name,
  299. bool &Action);
  300. void __fastcall PathEditAfterDialog(TObject * Sender,
  301. UnicodeString & Name, bool & Action);
  302. void __fastcall NavigationTreeCollapsing(TObject *Sender,
  303. TTreeNode *Node, bool &AllowCollapse);
  304. void __fastcall ProxyLocalCommandBrowseButtonClick(TObject *Sender);
  305. void __fastcall NavigationTreeChange(TObject * Sender,
  306. TTreeNode * Node);
  307. void __fastcall ColorButtonClick(TObject *Sender);
  308. void __fastcall MinTlsVersionComboChange(TObject *Sender);
  309. void __fastcall MaxTlsVersionComboChange(TObject *Sender);
  310. void __fastcall ProxyAutodetectButtonClick(TObject *Sender);
  311. void __fastcall NoteMemoKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
  312. void __fastcall TlsCertificateFileEditAfterDialog(TObject *Sender, UnicodeString &Name,
  313. bool &Action);
  314. void __fastcall PrivateKeyUploadItemClick(TObject *Sender);
  315. void __fastcall PrivateKeyGenerateItemClick(TObject *Sender);
  316. void __fastcall PrivateKeyToolsButtonClick(TObject *Sender);
  317. void __fastcall PrivateKeyViewButtonClick(TObject *Sender);
  318. void __fastcall ShowEncryptionKeyCheckClick(TObject *Sender);
  319. void __fastcall GenerateKeyButtonClick(TObject *Sender);
  320. void __fastcall EncryptKeyEditExit(TObject *Sender);
  321. void __fastcall PuttySettingsButtonClick(TObject *Sender);
  322. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  323. public:
  324. virtual __fastcall TSiteAdvancedDialog(TComponent * AOwner);
  325. bool __fastcall Execute(TSessionData * SessionData);
  326. protected:
  327. void __fastcall ChangePage(TTabSheet * Tab);
  328. void __fastcall PageChanged();
  329. virtual void __fastcall Dispatch(void * Message);
  330. bool __fastcall AllowAlgDrag(TListBox * AlgListBox, int X, int Y);
  331. void __fastcall AlgMove(TListBox * AlgListBox, int Source, int Dest);
  332. void __fastcall InitControls();
  333. bool IsDefaultSftpServer();
  334. private:
  335. int NoUpdate;
  336. int FAlgDragSource;
  337. int FAlgDragDest;
  338. int FOptions;
  339. UnicodeString FBeforeDialogPath;
  340. TFSProtocol FFSProtocol;
  341. TSessionData * FSessionData;
  342. TColor FColor;
  343. std::unique_ptr<TPopupMenu> FColorPopupMenu;
  344. std::unique_ptr<TObjectList> FPrivateKeyMonitors;
  345. std::unique_ptr<TStrings> FPuttyRegSettings;
  346. std::unique_ptr<TTimer> FPuttySettingsTimer;
  347. void __fastcall LoadSession();
  348. void __fastcall UpdateControls();
  349. TSessionData * __fastcall GetSessionData();
  350. void __fastcall SaveSession(TSessionData * SessionData);
  351. void __fastcall CMDialogKey(TWMKeyDown & Message);
  352. void __fastcall WMHelp(TWMHelp & Message);
  353. int __fastcall LastSupportedFtpProxyMethod();
  354. bool __fastcall SupportedFtpProxyMethod(int Method);
  355. int __fastcall GetSupportedFtpProxyMethod(int Method);
  356. int __fastcall GetSupportedNeonProxyMethod(int Method);
  357. TProxyMethod __fastcall GetProxyMethod();
  358. int __fastcall GetFtpProxyLogonType();
  359. void __fastcall UpdateNavigationTree();
  360. void __fastcall SessionColorChange(TColor Color);
  361. TTlsVersion __fastcall IndexToTlsVersion(int Index);
  362. int __fastcall TlsVersionToIndex(TTlsVersion TlsVersion);
  363. bool __fastcall IsNeon(TFSProtocol FSProtocol);
  364. void __fastcall PrivateKeyCreatedOrModified(TObject * Sender, const UnicodeString FileName);
  365. TCustomEdit * __fastcall GetEncryptKeyEdit(bool AShow = true);
  366. void __fastcall PuttySettingsTimer(TObject * Sender);
  367. UnicodeString __fastcall GetPuttySiteName();
  368. UnicodeString __fastcall GetPuttySiteKey();
  369. void __fastcall ClosePuttySettings();
  370. void SerializePuttyRegistry(const UnicodeString & Key, TStrings * Values);
  371. INTERFACE_HOOK;
  372. };
  373. //----------------------------------------------------------------------------
  374. #endif