Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

273 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1994-2001 Microsoft Corporation
  3. Module Name :
  4. ftpsht.h
  5. Abstract:
  6. FTP Property sheet definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Sergei Antonov (sergeia)
  10. Project:
  11. Internet Services Manager (cluster edition)
  12. Revision History:
  13. --*/
  14. #ifndef __FTPSHT_H__
  15. #define __FTPSHT_H__
  16. #include "shts.h"
  17. #ifndef LOGGING_ENABLED
  18. #define LOGGING_ENABLED
  19. inline BOOL LoggingEnabled(
  20. IN DWORD dwLogType
  21. )
  22. {
  23. return (dwLogType == MD_LOG_TYPE_ENABLED);
  24. }
  25. #endif
  26. #ifndef ENABLE_LOGGING
  27. #define ENABLE_LOGGING
  28. inline void EnableLogging(
  29. OUT DWORD & dwLogType,
  30. IN BOOL fEnabled = TRUE
  31. )
  32. {
  33. dwLogType = fEnabled ? MD_LOG_TYPE_ENABLED : MD_LOG_TYPE_DISABLED;
  34. }
  35. #endif
  36. class CFTPInstanceProps : public CInstanceProps
  37. /*++
  38. Class Description:
  39. FTP Properties
  40. Public Interface:
  41. CFTPInstanceProps : Constructor
  42. --*/
  43. {
  44. public:
  45. //
  46. // Constructor
  47. //
  48. CFTPInstanceProps(
  49. IN CComAuthInfo * pAuthInfo,
  50. IN LPCTSTR lpszMDPath
  51. );
  52. public:
  53. //
  54. // Write Data if dirty
  55. //
  56. virtual HRESULT WriteDirtyProps();
  57. BOOL HasADUserIsolation()
  58. {
  59. return MP_V(m_UserIsolation) == 2;
  60. }
  61. BOOL HasUserIsolation()
  62. {
  63. return MP_V(m_UserIsolation) == 1;
  64. }
  65. protected:
  66. //
  67. // Break out GetAllData() data to data fields
  68. //
  69. virtual void ParseFields();
  70. public:
  71. //
  72. // Service Page
  73. //
  74. MP_CILong m_nMaxConnections;
  75. MP_CILong m_nConnectionTimeOut;
  76. MP_DWORD m_dwLogType;
  77. //
  78. // Accounts Page
  79. //
  80. MP_CString m_strUserName;
  81. MP_CStrPassword m_strPassword;
  82. MP_BOOL m_fAllowAnonymous;
  83. MP_BOOL m_fOnlyAnonymous;
  84. MP_BOOL m_fPasswordSync;
  85. MP_CBlob m_acl;
  86. //
  87. // Message Page
  88. //
  89. MP_CString m_strExitMessage;
  90. MP_CString m_strMaxConMsg;
  91. MP_CStringListEx m_strlWelcome;
  92. MP_CStringListEx m_strlBanner;
  93. //
  94. // Directory Properties Page
  95. //
  96. MP_BOOL m_fDosDirOutput;
  97. //
  98. // Default Site page
  99. //
  100. MP_DWORD m_dwDownlevelInstance;
  101. MP_DWORD m_dwMaxBandwidth;
  102. // Supporting properties
  103. MP_DWORD m_UserIsolation;
  104. };
  105. class CFTPDirProps : public CChildNodeProps
  106. /*++
  107. Class Description:
  108. FTP Directory properties
  109. Public Interface:
  110. CFTPDirProps : Constructor
  111. --*/
  112. {
  113. public:
  114. CFTPDirProps(
  115. IN CComAuthInfo * pAuthInfo,
  116. IN LPCTSTR lpszMDPath
  117. );
  118. public:
  119. //
  120. // Write Data if dirty
  121. //
  122. virtual HRESULT WriteDirtyProps();
  123. protected:
  124. //
  125. // Break out GetAllData() data to data fields
  126. //
  127. virtual void ParseFields();
  128. public:
  129. //
  130. // Directory properties page
  131. //
  132. MP_CString m_strUserName;
  133. MP_CStrPassword m_strPassword;
  134. MP_BOOL m_fDontLog;
  135. MP_CBlob m_ipl;
  136. };
  137. class CFtpSheet : public CInetPropertySheet
  138. /*++
  139. Class Description:
  140. Ftp Property sheet
  141. Public Interface:
  142. CFtpSheet : Constructor
  143. Initialize : Initialize config data
  144. --*/
  145. {
  146. public:
  147. //
  148. // Constructor
  149. //
  150. CFtpSheet(
  151. IN CComAuthInfo * pAuthInfo,
  152. IN LPCTSTR lpszMetaPath,
  153. IN CWnd * pParentWnd = NULL,
  154. IN LPARAM lParam = 0L,
  155. IN LPARAM lParamParent= 0L,
  156. IN UINT iSelectPage = 0
  157. );
  158. ~CFtpSheet();
  159. public:
  160. HRESULT QueryInstanceResult() const;
  161. HRESULT QueryDirectoryResult() const;
  162. CFTPInstanceProps & GetInstanceProperties() { return *m_ppropInst; }
  163. CFTPDirProps & GetDirectoryProperties() { return *m_ppropDir; }
  164. BOOL HasADUserIsolation()
  165. {
  166. return m_ppropInst->HasADUserIsolation();
  167. }
  168. virtual HRESULT LoadConfigurationParameters();
  169. virtual void FreeConfigurationParameters();
  170. enum
  171. {
  172. SHEET_TYPE_SERVER,
  173. SHEET_TYPE_SITE,
  174. SHEET_TYPE_VDIR,
  175. SHEET_TYPE_DIR,
  176. SHEET_TYPE_FILE
  177. };
  178. HRESULT SetSheetType(int fSheetType);
  179. protected:
  180. virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT);
  181. //{{AFX_MSG(CFtpSheet)
  182. //}}AFX_MSG
  183. DECLARE_MESSAGE_MAP()
  184. private:
  185. CFTPInstanceProps * m_ppropInst;
  186. CFTPDirProps * m_ppropDir;
  187. int m_fSheetType;
  188. };
  189. //
  190. // Inline Expansion
  191. //
  192. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  193. inline HRESULT CFtpSheet::QueryInstanceResult() const
  194. {
  195. //
  196. // BUGBUG: S_OK if object not yet instantiated
  197. //
  198. return m_ppropInst ? m_ppropInst->QueryResult() : S_OK;
  199. }
  200. inline HRESULT CFtpSheet::QueryDirectoryResult() const
  201. {
  202. //
  203. // BUGBUG: S_OK if object not yet instantiated
  204. //
  205. return m_ppropDir ? m_ppropDir->QueryResult() : S_OK;
  206. }
  207. #endif // __FTPSHT_H__