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.

266 lines
8.5 KiB

  1. // ftpgenp1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ISAdmin.h"
  5. #include "compsdef.h"
  6. #include "ftpgenp1.h"
  7. #include "ftpadvp1.h"
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CFTPGENP1 property page
  14. IMPLEMENT_DYNCREATE(CFTPGENP1, CGenPage)
  15. CFTPGENP1::CFTPGENP1() : CGenPage(CFTPGENP1::IDD)
  16. {
  17. //{{AFX_DATA_INIT(CFTPGENP1)
  18. //}}AFX_DATA_INIT
  19. }
  20. CFTPGENP1::~CFTPGENP1()
  21. {
  22. }
  23. void CFTPGENP1::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CGenPage::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CFTPGENP1)
  27. DDX_Control(pDX, IDC_LOWERCASEFILESDATA1, m_cboxLowercaseFiles);
  28. DDX_Control(pDX, IDC_MSDOSDIROUTPUT, m_cboxMsdosDirOutput);
  29. DDX_Control(pDX, IDC_ENPORTATTACKDATA1, m_cboxEnPortAttack);
  30. DDX_Control(pDX, IDC_ANNOTATEDIRECTORIESDATA1, m_cboxAnnotateDirectories);
  31. DDX_Control(pDX, IDC_ALLOWGUESTACCESSDATA1, m_cboxAllowGuestAccess);
  32. DDX_Control(pDX, IDC_LOGNONANONDATA1, m_cboxLogNonAnon);
  33. DDX_Control(pDX, IDC_LOGANONDATA1, m_cboxLogAnon);
  34. DDX_Control(pDX, IDC_ENSVCLOCDATA1, m_cboxEnSvcLoc);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CFTPGENP1, CGenPage)
  38. //{{AFX_MSG_MAP(CFTPGENP1)
  39. ON_BN_CLICKED(IDC_ENPORTATTACKDATA1, OnEnportattackdata1)
  40. ON_BN_CLICKED(IDC_ENSVCLOCDATA1, OnEnsvclocdata1)
  41. ON_BN_CLICKED(IDC_LOGANONDATA1, OnLoganondata1)
  42. ON_BN_CLICKED(IDC_LOGNONANONDATA1, OnLognonanondata1)
  43. ON_BN_CLICKED(IDC_ALLOWGUESTACCESSDATA1, OnAllowguestaccessdata1)
  44. ON_BN_CLICKED(IDC_ANNOTATEDIRECTORIESDATA1, OnAnnotatedirectoriesdata1)
  45. ON_BN_CLICKED(IDC_LOWERCASEFILESDATA1, OnLowercasefilesdata1)
  46. ON_BN_CLICKED(IDC_MSDOSDIROUTPUT, OnMsdosdiroutput)
  47. //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CFTPGENP1 message handlers
  51. BOOL CFTPGENP1::OnInitDialog()
  52. {
  53. int i;
  54. CGenPage::OnInitDialog();
  55. // TODO: Add extra initialization here
  56. for (i = 0; i < FTPPage_TotalNumRegEntries; i++) {
  57. m_binNumericRegistryEntries[i].bIsChanged = FALSE;
  58. m_binNumericRegistryEntries[i].ulMultipleFactor = 1;
  59. }
  60. m_binNumericRegistryEntries[FTPPage_EnableSvcLoc].strFieldName = _T(ENABLESVCLOCNAME);
  61. m_binNumericRegistryEntries[FTPPage_EnableSvcLoc].ulDefaultValue = DEFAULTENABLESVCLOC;
  62. m_binNumericRegistryEntries[FTPPage_LogAnonymous].strFieldName = _T(LOGANONYMOUSNAME);
  63. m_binNumericRegistryEntries[FTPPage_LogAnonymous].ulDefaultValue = DEFAULTLOGANONYMOUS;
  64. m_binNumericRegistryEntries[FTPPage_LogNonAnonymous].strFieldName = _T(LOGNONANONYMOUSNAME);
  65. m_binNumericRegistryEntries[FTPPage_LogNonAnonymous].ulDefaultValue = DEFAULTLOGNONANONYMOUS;
  66. m_binNumericRegistryEntries[FTPPage_EnablePortAttack].strFieldName = _T(ENABLEPORTATTACKNAME);
  67. m_binNumericRegistryEntries[FTPPage_EnablePortAttack].ulDefaultValue = DEFAULTENABLEPORTATTACK;
  68. m_binNumericRegistryEntries[FTPPage_AllowGuestAccess].strFieldName = _T(ALLOWGUESTACCESSNAME);
  69. m_binNumericRegistryEntries[FTPPage_AllowGuestAccess].ulDefaultValue = DEFAULTALLOWGUESTACCESS;
  70. m_binNumericRegistryEntries[FTPPage_AnnotateDirectories].strFieldName = _T(ANNOTATEDIRECTORIESNAME);
  71. m_binNumericRegistryEntries[FTPPage_AnnotateDirectories].ulDefaultValue = DEFAULTANNOTATEDIRECTORIES;
  72. m_binNumericRegistryEntries[FTPPage_MsdosDirOutput].strFieldName = _T(MSDOSDIROUTPUTNAME);
  73. m_binNumericRegistryEntries[FTPPage_MsdosDirOutput].ulDefaultValue = DEFAULTMSDOSDIROUTPUT;
  74. m_binNumericRegistryEntries[FTPPage_LowercaseFiles].strFieldName = _T(LOWERCASEFILESNAME);
  75. m_binNumericRegistryEntries[FTPPage_LowercaseFiles].ulDefaultValue = DEFAULTLOWERCASEFILES;
  76. for (i = 0; i < FTPPage_TotalNumRegEntries; i++) {
  77. if (m_rkMainKey->QueryValue(m_binNumericRegistryEntries[i].strFieldName,
  78. m_binNumericRegistryEntries[i].ulFieldValue) != ERROR_SUCCESS) {
  79. m_binNumericRegistryEntries[i].ulFieldValue = m_binNumericRegistryEntries[i].ulDefaultValue;
  80. }
  81. }
  82. m_cboxEnSvcLoc.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_EnableSvcLoc].ulFieldValue));
  83. m_cboxLogAnon.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_LogAnonymous].ulFieldValue));
  84. m_cboxLogNonAnon.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_LogNonAnonymous].ulFieldValue));
  85. m_cboxEnPortAttack.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_EnablePortAttack].ulFieldValue));
  86. m_cboxAllowGuestAccess.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_AllowGuestAccess].ulFieldValue));
  87. m_cboxAnnotateDirectories.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_AnnotateDirectories].ulFieldValue));
  88. m_cboxMsdosDirOutput.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_MsdosDirOutput].ulFieldValue));
  89. m_cboxLowercaseFiles.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[FTPPage_LowercaseFiles].ulFieldValue));
  90. m_bSetChanged = TRUE; // Any more changes come from the user
  91. return TRUE; // return TRUE unless you set the focus to a control
  92. // EXCEPTION: OCX Property Pages should return FALSE
  93. }
  94. void CFTPGENP1::OnEnportattackdata1()
  95. {
  96. // TODO: Add your control notification handler code here
  97. if (m_bSetChanged) {
  98. m_binNumericRegistryEntries[FTPPage_EnablePortAttack].bIsChanged = TRUE;
  99. m_binNumericRegistryEntries[FTPPage_EnablePortAttack].ulFieldValue =
  100. GETREGVALUEFROMCHECKBOX(m_cboxEnPortAttack.GetCheck());
  101. m_bIsDirty = TRUE;
  102. SetModified(TRUE);
  103. }
  104. }
  105. void CFTPGENP1::OnEnsvclocdata1()
  106. {
  107. // TODO: Add your control notification handler code here
  108. if (m_bSetChanged) {
  109. m_binNumericRegistryEntries[FTPPage_EnableSvcLoc].bIsChanged = TRUE;
  110. m_binNumericRegistryEntries[FTPPage_EnableSvcLoc].ulFieldValue =
  111. GETREGVALUEFROMCHECKBOX(m_cboxEnSvcLoc.GetCheck());
  112. m_bIsDirty = TRUE;
  113. SetModified(TRUE);
  114. }
  115. }
  116. void CFTPGENP1::OnLoganondata1()
  117. {
  118. // TODO: Add your control notification handler code here
  119. if (m_bSetChanged) {
  120. m_binNumericRegistryEntries[FTPPage_LogAnonymous].bIsChanged = TRUE;
  121. m_binNumericRegistryEntries[FTPPage_LogAnonymous].ulFieldValue =
  122. GETREGVALUEFROMCHECKBOX(m_cboxLogAnon.GetCheck());
  123. m_bIsDirty = TRUE;
  124. SetModified(TRUE);
  125. }
  126. }
  127. void CFTPGENP1::OnLognonanondata1()
  128. {
  129. // TODO: Add your control notification handler code here
  130. if (m_bSetChanged) {
  131. m_binNumericRegistryEntries[FTPPage_LogNonAnonymous].bIsChanged = TRUE;
  132. m_binNumericRegistryEntries[FTPPage_LogNonAnonymous].ulFieldValue =
  133. GETREGVALUEFROMCHECKBOX(m_cboxLogNonAnon.GetCheck());
  134. m_bIsDirty = TRUE;
  135. SetModified(TRUE);
  136. }
  137. }
  138. void CFTPGENP1::OnAllowguestaccessdata1()
  139. {
  140. // TODO: Add your control notification handler code here
  141. if (m_bSetChanged) {
  142. m_binNumericRegistryEntries[FTPPage_AllowGuestAccess].bIsChanged = TRUE;
  143. m_binNumericRegistryEntries[FTPPage_AllowGuestAccess].ulFieldValue =
  144. GETREGVALUEFROMCHECKBOX(m_cboxAllowGuestAccess.GetCheck());
  145. m_bIsDirty = TRUE;
  146. SetModified(TRUE);
  147. }
  148. }
  149. void CFTPGENP1::OnAnnotatedirectoriesdata1()
  150. {
  151. // TODO: Add your control notification handler code here
  152. if (m_bSetChanged) {
  153. m_binNumericRegistryEntries[FTPPage_AnnotateDirectories].bIsChanged = TRUE;
  154. m_binNumericRegistryEntries[FTPPage_AnnotateDirectories].ulFieldValue =
  155. GETREGVALUEFROMCHECKBOX(m_cboxAnnotateDirectories.GetCheck());
  156. m_bIsDirty = TRUE;
  157. SetModified(TRUE);
  158. }
  159. }
  160. void CFTPGENP1::OnMsdosdiroutput()
  161. {
  162. // TODO: Add your control notification handler code here
  163. if (m_bSetChanged) {
  164. m_binNumericRegistryEntries[FTPPage_MsdosDirOutput].bIsChanged = TRUE;
  165. m_binNumericRegistryEntries[FTPPage_MsdosDirOutput].ulFieldValue =
  166. GETREGVALUEFROMCHECKBOX(m_cboxMsdosDirOutput.GetCheck());
  167. m_bIsDirty = TRUE;
  168. SetModified(TRUE);
  169. }
  170. }
  171. void CFTPGENP1::OnLowercasefilesdata1()
  172. {
  173. // TODO: Add your control notification handler code here
  174. if (m_bSetChanged) {
  175. m_binNumericRegistryEntries[FTPPage_LowercaseFiles].bIsChanged = TRUE;
  176. m_binNumericRegistryEntries[FTPPage_LowercaseFiles].ulFieldValue =
  177. GETREGVALUEFROMCHECKBOX(m_cboxLowercaseFiles.GetCheck());
  178. m_bIsDirty = TRUE;
  179. SetModified(TRUE);
  180. }
  181. }
  182. void CFTPGENP1::SaveInfo()
  183. {
  184. if (m_bIsDirty) {
  185. SaveNumericInfo(m_binNumericRegistryEntries, FTPPage_TotalNumRegEntries);
  186. }
  187. CGenPage::SaveInfo();
  188. }