IdFTPServerContextBase.pas 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.0 8/24/2003 06:47:42 PM JPMugaas
  18. FTPContext base class so that the ThreadClass may be shared with the
  19. FileSystem classes.
  20. }
  21. unit IdFTPServerContextBase;
  22. {
  23. This is for a basic thread class that can be shared with the FTP File System
  24. component and any other file system class so they can share more information
  25. than just the Username
  26. }
  27. interface
  28. {$i IdCompilerDefines.inc}
  29. uses
  30. IdCustomTCPServer, IdFTPList;
  31. type
  32. TIdFTPUserType = (utNone, utAnonymousUser, utNormalUser);
  33. TIdFTPServerContextBase = class(TIdServerContext)
  34. protected
  35. FUserType: TIdFTPUserType;
  36. FAuthenticated: Boolean;
  37. FALLOSize: Integer;
  38. FCurrentDir: TIdFTPFileName;
  39. FHomeDir: TIdFTPFileName;
  40. FHost : String;
  41. FUsername: string;
  42. FPassword: string;
  43. FAccount : String;
  44. FAccountNeeded : Boolean;
  45. FRESTPos: Integer;
  46. FRNFR: string;
  47. FNLSTUtf8: Boolean;
  48. procedure ReInitialize; virtual;
  49. public
  50. property Authenticated: Boolean read FAuthenticated write FAuthenticated;
  51. property ALLOSize: Integer read FALLOSize write FALLOSize;
  52. property CurrentDir: TIdFTPFileName read FCurrentDir write FCurrentDir;
  53. property HomeDir: TIdFTPFileName read FHomeDir write FHomeDir;
  54. property Password: string read FPassword write FPassword;
  55. property Username: string read FUsername write FUsername;
  56. property Account : String read FAccount write FAccount;
  57. property AccountNeeded : Boolean read FAccountNeeded write FAccountNeeded;
  58. //for virtual domains
  59. property Host: string read FHost write FHost;
  60. property UserType: TIdFTPUserType read FUserType write FUserType;
  61. property RESTPos: Integer read FRESTPos write FRESTPos;
  62. property RNFR: string read FRNFR write FRNFR;
  63. property NLSTUtf8: Boolean read FNLSTUtf8 write FNLSTUtf8;
  64. end;
  65. implementation
  66. { TIdFTPServerContextBase }
  67. procedure TIdFTPServerContextBase.ReInitialize;
  68. begin
  69. UserType := utNone;
  70. FAuthenticated := False;
  71. FALLOSize := 0;
  72. FCurrentDir := '/'; {Do not Localize}
  73. FHomeDir := ''; {Do not Localize}
  74. FHost := ''; {Do not localize}
  75. FUsername := ''; {Do not Localize}
  76. FPassword := ''; {Do not Localize}
  77. FAccount := ''; {Do not localize}
  78. FRESTPos := 0;
  79. FRNFR := ''; {Do not Localize}
  80. FNLSTUtf8 := False;
  81. FAccountNeeded := False;
  82. end;
  83. end.