SiteAdvanced.h 13 KB

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