Source code of Windows XP (NT5)
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.

116 lines
3.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: domainui.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "preDNSsn.h"
  11. #include <SnapBase.h>
  12. #include "resource.h"
  13. #include "dnsutil.h"
  14. #include "DNSSnap.h"
  15. #include "snapdata.h"
  16. #include "server.h"
  17. #include "domain.h"
  18. #include "record.h"
  19. #include "zone.h"
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // CDNSDelegatedDomainNameServersPropertyPage
  22. void CDNSDelegatedDomainNameServersPropertyPage::ReadRecordNodesList()
  23. {
  24. CString szBuffer;
  25. szBuffer.LoadString(IDS_DELEGATION_DESCR);
  26. SetDescription(szBuffer);
  27. ASSERT(m_pCloneInfoList != NULL);
  28. CDNSDomainPropertyPageHolder* pHolder = (CDNSDomainPropertyPageHolder*)GetHolder();
  29. CDNSDomainNode* pDomainNode = pHolder->GetDomainNode();
  30. SetDomainNode(pDomainNode);
  31. pDomainNode->GetNSRecordNodesInfo(m_pCloneInfoList);
  32. }
  33. ///////////////////////////////////////////////////////////////////////////////
  34. CDNSDomainPropertyPageHolder::CDNSDomainPropertyPageHolder(CDNSDomainNode* pContainerDomainNode,
  35. CDNSDomainNode* pThisDomainNode, CComponentDataObject* pComponentData)
  36. : CPropertyPageHolderBase(pContainerDomainNode, pThisDomainNode, pComponentData)
  37. {
  38. ASSERT(pComponentData != NULL);
  39. ASSERT(pContainerDomainNode != NULL);
  40. ASSERT(pContainerDomainNode == GetContainerNode());
  41. ASSERT(pThisDomainNode != NULL);
  42. ASSERT(pThisDomainNode == GetDomainNode());
  43. ASSERT(pThisDomainNode->IsDelegation());
  44. m_bAutoDeletePages = FALSE; // we have the page as embedded member
  45. //
  46. // add NS page if delegation
  47. //
  48. if (pThisDomainNode->IsDelegation())
  49. {
  50. AddPageToList((CPropertyPageBase*)&m_nameServersPage);
  51. DWORD dwZoneType = pThisDomainNode->GetZoneNode()->GetZoneType();
  52. if (dwZoneType == DNS_ZONE_TYPE_SECONDARY ||
  53. dwZoneType == DNS_ZONE_TYPE_STUB)
  54. {
  55. m_nameServersPage.SetReadOnly();
  56. }
  57. }
  58. //
  59. // security page added only if DS integrated and it is a delegation:
  60. // if a delegation, we are guaranteed we have RR's at the node
  61. //
  62. m_pAclEditorPage = NULL;
  63. CDNSZoneNode* pZoneNode = pThisDomainNode->GetZoneNode();
  64. if (pZoneNode->IsDSIntegrated() && pThisDomainNode->IsDelegation())
  65. {
  66. CString szPath;
  67. pZoneNode->GetServerNode()->CreateDsNodeLdapPath(pZoneNode, pThisDomainNode, szPath);
  68. if (!szPath.IsEmpty())
  69. m_pAclEditorPage = CAclEditorPage::CreateInstance(szPath, this);
  70. }
  71. }
  72. CDNSDomainPropertyPageHolder::~CDNSDomainPropertyPageHolder()
  73. {
  74. if (m_pAclEditorPage != NULL)
  75. delete m_pAclEditorPage;
  76. }
  77. CDNSDomainNode* CDNSDomainPropertyPageHolder::GetDomainNode()
  78. {
  79. CDNSDomainNode* pDomainNode = (CDNSDomainNode*)GetTreeNode();
  80. ASSERT(!pDomainNode->IsZone());
  81. return pDomainNode;
  82. }
  83. HRESULT CDNSDomainPropertyPageHolder::OnAddPage(int nPage, CPropertyPageBase*)
  84. {
  85. // add the ACL editor page after the last, if present
  86. if ( (nPage != -1) || (m_pAclEditorPage == NULL) )
  87. return S_OK;
  88. // add the ACLU page
  89. HPROPSHEETPAGE hPage = m_pAclEditorPage->CreatePage();
  90. if (hPage == NULL)
  91. return E_FAIL;
  92. // add the raw HPROPSHEETPAGE to sheet, not in the list
  93. return AddPageToSheetRaw(hPage);
  94. }