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.

280 lines
9.4 KiB

  1. // webgenp1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ISAdmin.h"
  5. #include "compsdef.h"
  6. #include "webgenp1.h"
  7. #include "webadvp1.h"
  8. #ifdef _DEBUG
  9. #undef THIS_FILE
  10. static char BASED_CODE THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CWEBGENP1 property page
  14. IMPLEMENT_DYNCREATE(CWEBGENP1, CGenPage)
  15. CWEBGENP1::CWEBGENP1() : CGenPage(CWEBGENP1::IDD)
  16. {
  17. //{{AFX_DATA_INIT(CWEBGENP1)
  18. m_strWebAccessDeniedMessage = _T("");
  19. //}}AFX_DATA_INIT
  20. }
  21. CWEBGENP1::~CWEBGENP1()
  22. {
  23. }
  24. void CWEBGENP1::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CGenPage::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(CWEBGENP1)
  28. DDX_Control(pDX, IDC_DIRBROWSECONTROLDATA1, m_editDirBrowseControl);
  29. DDX_Control(pDX, IDC_MAXCONNECTIONSSPIN1, m_spinMaxConnections);
  30. DDX_Control(pDX, IDC_LOGNONANONDATA1, m_cboxLogNonAnon);
  31. DDX_Control(pDX, IDC_LOGANONDATA1, m_cboxLogAnon);
  32. DDX_Control(pDX, IDC_ENWAISDATA1, m_cboxEnWais);
  33. DDX_Control(pDX, IDC_ENSVCLOCDATA1, m_cboxEnSvcLoc);
  34. DDX_TexttoHex(pDX, IDC_DIRBROWSECONTROLDATA1, m_ulDirBrowseControl);
  35. DDX_Text(pDX, IDC_NTAUTHENTICATIONPROVIDERSDATA1, m_strNTAuthenticationProviders);
  36. DDV_MaxChars(pDX, m_strNTAuthenticationProviders, 512);
  37. DDX_Text(pDX, IDC_WEBACCESSDENIEDMESSAGEDATA1, m_strWebAccessDeniedMessage);
  38. //}}AFX_DATA_MAP
  39. }
  40. BEGIN_MESSAGE_MAP(CWEBGENP1, CGenPage)
  41. //{{AFX_MSG_MAP(CWEBGENP1)
  42. ON_BN_CLICKED(IDC_ENSVCLOCDATA1, OnEnsvclocdata1)
  43. ON_BN_CLICKED(IDC_ENWAISDATA1, OnEnwaisdata1)
  44. ON_BN_CLICKED(IDC_LOGANONDATA1, OnLoganondata1)
  45. ON_BN_CLICKED(IDC_LOGNONANONDATA1, OnLognonanondata1)
  46. ON_EN_CHANGE(IDC_MAXCONNECTIONSDATA1, OnChangeMaxconnectionsdata1)
  47. ON_EN_CHANGE(IDC_DIRBROWSECONTROLDATA1, OnChangeDirbrowsecontroldata1)
  48. ON_EN_CHANGE(IDC_NTAUTHENTICATIONPROVIDERSDATA1, OnChangeNtauthenticationprovidersdata1)
  49. ON_EN_CHANGE(IDC_WEBACCESSDENIEDMESSAGEDATA1, OnChangeWebaccessdeniedmessagedata1)
  50. //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CWEBGENP1 message handlers
  54. BOOL CWEBGENP1::OnInitDialog()
  55. {
  56. int i;
  57. CGenPage::OnInitDialog();
  58. // TODO: Add extra initialization here
  59. for (i = 0; i < WebPage_TotalNumRegEntries; i++) {
  60. m_binNumericRegistryEntries[i].bIsChanged = FALSE;
  61. m_binNumericRegistryEntries[i].ulMultipleFactor = 1;
  62. }
  63. for (i = 0; i < WebPage_TotalStringRegEntries; i++) {
  64. m_binStringRegistryEntries[i].bIsChanged = FALSE;
  65. }
  66. m_binNumericRegistryEntries[WebPage_EnableSvcLoc].strFieldName = _T(ENABLESVCLOCNAME);
  67. m_binNumericRegistryEntries[WebPage_EnableSvcLoc].ulDefaultValue = DEFAULTENABLESVCLOC;
  68. m_binNumericRegistryEntries[WebPage_LogAnonymous].strFieldName = _T(LOGANONYMOUSNAME);
  69. m_binNumericRegistryEntries[WebPage_LogAnonymous].ulDefaultValue = DEFAULTLOGANONYMOUS;
  70. m_binNumericRegistryEntries[WebPage_LogNonAnonymous].strFieldName = _T(LOGNONANONYMOUSNAME);
  71. m_binNumericRegistryEntries[WebPage_LogNonAnonymous].ulDefaultValue = DEFAULTLOGNONANONYMOUS;
  72. m_binNumericRegistryEntries[WebPage_CheckForWAISDB].strFieldName = _T(CHECKFORWAISDBNAME);
  73. m_binNumericRegistryEntries[WebPage_CheckForWAISDB].ulDefaultValue = DEFAULTCHECKFORWAISDB;
  74. m_binNumericRegistryEntries[WebPage_MaxConnections].strFieldName = _T(MAXCONNECTIONSNAME);
  75. m_binNumericRegistryEntries[WebPage_MaxConnections].ulMultipleFactor = 100;
  76. m_binNumericRegistryEntries[WebPage_MaxConnections].ulDefaultValue = DEFAULTMAXCONNECTIONS;
  77. m_binNumericRegistryEntries[WebPage_DirBrowseControl].strFieldName = _T(DIRBROWSECONTROLNAME);
  78. m_binNumericRegistryEntries[WebPage_DirBrowseControl].ulDefaultValue = DEFAULTDIRBROWSECONTROL;
  79. m_binStringRegistryEntries[WebPage_NTAuthenticationProviders].strFieldName = _T(NTAUTHENTICATIONPROVIDERSNAME);
  80. m_binStringRegistryEntries[WebPage_NTAuthenticationProviders].strFieldValue = _T(DEFAULTNTAUTHENTICATIONPROVIDERS);
  81. m_binStringRegistryEntries[WebPage_AccessDeniedMessage].strFieldName = _T(ACCESSDENIEDMESSAGENAME);
  82. m_binStringRegistryEntries[WebPage_AccessDeniedMessage].strFieldValue = _T(DEFAULTACCESSDENIEDMESSAGE);
  83. for (i = 0; i < WebPage_TotalNumRegEntries; i++) {
  84. if (m_rkMainKey->QueryValue(m_binNumericRegistryEntries[i].strFieldName,
  85. m_binNumericRegistryEntries[i].ulFieldValue) != ERROR_SUCCESS) {
  86. m_binNumericRegistryEntries[i].ulFieldValue = m_binNumericRegistryEntries[i].ulDefaultValue;
  87. }
  88. }
  89. for (i = 0; i < WebPage_TotalStringRegEntries; i++) {
  90. m_rkMainKey->QueryValue(m_binStringRegistryEntries[i].strFieldName,
  91. m_binStringRegistryEntries[i].strFieldValue);
  92. }
  93. m_cboxEnSvcLoc.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[WebPage_EnableSvcLoc].ulFieldValue));
  94. m_cboxLogAnon.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[WebPage_LogAnonymous].ulFieldValue));
  95. m_cboxLogNonAnon.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[WebPage_LogNonAnonymous].ulFieldValue));
  96. m_cboxEnWais.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[WebPage_CheckForWAISDB].ulFieldValue));
  97. m_spinMaxConnections.SetRange(MINMAXCONNECTIONS, MAXMAXCONNECTIONS);
  98. m_spinMaxConnections.SetPos(LESSOROF((m_binNumericRegistryEntries[WebPage_MaxConnections].ulFieldValue /
  99. m_binNumericRegistryEntries[WebPage_MaxConnections].ulMultipleFactor), MAXMAXCONNECTIONS));
  100. m_editDirBrowseControl.LimitText(8);
  101. m_ulDirBrowseControl = m_binNumericRegistryEntries[WebPage_DirBrowseControl].ulFieldValue;
  102. m_strNTAuthenticationProviders = m_binStringRegistryEntries[WebPage_NTAuthenticationProviders].strFieldValue;
  103. m_strWebAccessDeniedMessage = m_binStringRegistryEntries[WebPage_AccessDeniedMessage].strFieldValue;
  104. UpdateData(FALSE); // Force Edit box(es) to pick up value(s)
  105. m_bSetChanged = TRUE; // Any more changes come from the user
  106. return TRUE; // return TRUE unless you set the focus to a control
  107. // EXCEPTION: OCX Property Pages should return FALSE
  108. }
  109. void CWEBGENP1::OnEnsvclocdata1()
  110. {
  111. // TODO: Add your control notification handler code here
  112. if (m_bSetChanged) {
  113. m_binNumericRegistryEntries[WebPage_EnableSvcLoc].bIsChanged = TRUE;
  114. m_binNumericRegistryEntries[WebPage_EnableSvcLoc].ulFieldValue =
  115. GETREGVALUEFROMCHECKBOX(m_cboxEnSvcLoc.GetCheck());
  116. m_bIsDirty = TRUE;
  117. SetModified(TRUE);
  118. }
  119. }
  120. void CWEBGENP1::OnEnwaisdata1()
  121. {
  122. // TODO: Add your control notification handler code here
  123. if (m_bSetChanged) {
  124. m_binNumericRegistryEntries[WebPage_CheckForWAISDB].bIsChanged = TRUE;
  125. m_binNumericRegistryEntries[WebPage_CheckForWAISDB].ulFieldValue =
  126. GETREGVALUEFROMCHECKBOX(m_cboxEnWais.GetCheck());
  127. m_bIsDirty = TRUE;
  128. SetModified(TRUE);
  129. }
  130. }
  131. void CWEBGENP1::OnLoganondata1()
  132. {
  133. // TODO: Add your control notification handler code here
  134. if (m_bSetChanged) {
  135. m_binNumericRegistryEntries[WebPage_LogAnonymous].bIsChanged = TRUE;
  136. m_binNumericRegistryEntries[WebPage_LogAnonymous].ulFieldValue =
  137. GETREGVALUEFROMCHECKBOX(m_cboxLogAnon.GetCheck());
  138. m_bIsDirty = TRUE;
  139. SetModified(TRUE);
  140. }
  141. }
  142. void CWEBGENP1::OnLognonanondata1()
  143. {
  144. // TODO: Add your control notification handler code here
  145. if (m_bSetChanged) {
  146. m_binNumericRegistryEntries[WebPage_LogNonAnonymous].bIsChanged = TRUE;
  147. m_binNumericRegistryEntries[WebPage_LogNonAnonymous].ulFieldValue =
  148. GETREGVALUEFROMCHECKBOX(m_cboxLogNonAnon.GetCheck());
  149. m_bIsDirty = TRUE;
  150. SetModified(TRUE);
  151. }
  152. }
  153. void CWEBGENP1::OnChangeMaxconnectionsdata1()
  154. {
  155. // TODO: Add your control notification handler code here
  156. if (m_bSetChanged) {
  157. m_binNumericRegistryEntries[WebPage_MaxConnections].bIsChanged = TRUE;
  158. m_binNumericRegistryEntries[WebPage_MaxConnections].ulFieldValue = m_spinMaxConnections.GetPos()
  159. * m_binNumericRegistryEntries[WebPage_MaxConnections].ulMultipleFactor;
  160. m_bIsDirty = TRUE;
  161. SetModified(TRUE);
  162. }
  163. }
  164. void CWEBGENP1::OnChangeDirbrowsecontroldata1()
  165. {
  166. // TODO: Add your control notification handler code here
  167. if (m_bSetChanged) {
  168. m_binNumericRegistryEntries[WebPage_DirBrowseControl].bIsChanged = TRUE;
  169. m_bIsDirty = TRUE;
  170. SetModified(TRUE);
  171. }
  172. }
  173. void CWEBGENP1::OnChangeNtauthenticationprovidersdata1()
  174. {
  175. // TODO: Add your control notification handler code here
  176. if (m_bSetChanged) {
  177. m_binStringRegistryEntries[WebPage_NTAuthenticationProviders].bIsChanged = TRUE;
  178. m_bIsDirty = TRUE;
  179. SetModified(TRUE);
  180. }
  181. }
  182. void CWEBGENP1::OnChangeWebaccessdeniedmessagedata1()
  183. {
  184. // TODO: Add your control notification handler code here
  185. if (m_bSetChanged) {
  186. m_binStringRegistryEntries[WebPage_AccessDeniedMessage].bIsChanged = TRUE;
  187. m_bIsDirty = TRUE;
  188. SetModified(TRUE);
  189. }
  190. }
  191. void CWEBGENP1::SaveInfo()
  192. {
  193. if (m_bIsDirty) {
  194. m_binNumericRegistryEntries[WebPage_DirBrowseControl].ulFieldValue = m_ulDirBrowseControl;
  195. m_binStringRegistryEntries[WebPage_NTAuthenticationProviders].strFieldValue = m_strNTAuthenticationProviders;
  196. m_binStringRegistryEntries[WebPage_AccessDeniedMessage].strFieldValue = m_strWebAccessDeniedMessage;
  197. SaveNumericInfo(m_binNumericRegistryEntries, WebPage_TotalNumRegEntries);
  198. SaveStringInfo(m_binStringRegistryEntries, WebPage_TotalStringRegEntries);
  199. }
  200. CGenPage::SaveInfo();
  201. }