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.

178 lines
4.5 KiB

  1. <!--
  2. '------------------------------------------------------------------------------
  3. '
  4. ' Directory Service Administration Property Pages
  5. '
  6. ' Microsoft Windows
  7. ' Copyright (C) Microsoft Corporation, 1992 - 1997.
  8. '
  9. ' File: memberof.htm
  10. '
  11. ' Contents: MemberOf property page.
  12. '
  13. ' History: 2-26-97 ericb created.
  14. '
  15. '------------------------------------------------------------------------------
  16. -->
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
  18. <HTML>
  19. <HEAD>
  20. <META http-equiv=Content-Type content="text/html; charset=ANSI_X3.4-1968">
  21. </HEAD>
  22. <BODY bgcolor=silver onload="DoOnLoad()">
  23. <OBJECT ID=ActiveDir CLASSID="Clsid:0998BB05-DFFD-11CF-927F-00AA00688A38">
  24. </OBJECT>
  25. <SCRIPT language=vbscript>
  26. dim DsObj
  27. '------------------------------------------------------------------------------
  28. '
  29. ' Subroutine: DoOnLoad
  30. '
  31. ' Synopsis: Bind to the DS object and set the initial control values.
  32. '
  33. '------------------------------------------------------------------------------
  34. sub DoOnLoad
  35. on error resume next
  36. '
  37. ' Extract the object path from the URL params. This assumes that
  38. ' path= immediatly follows the ?
  39. '
  40. strUrl = document.URL
  41. URLlen = len(strUrl)
  42. i = InStr(strUrl, "?")
  43. i = InStr(i, strUrl, "=")
  44. EncodedPath = right(strUrl, URLlen - i)
  45. err.clear
  46. path = ActiveDir.DecodeURL((EncodedPath))
  47. if err.number <> 0 then
  48. alert("ActiveDir.DecodeURL failed with error " & hex(err.number) &_
  49. " " & err.description)
  50. exit sub
  51. end if
  52. '
  53. ' Activate the object.
  54. '
  55. set DsObj = ActiveDir.DSGetObject((path))
  56. if err.number <> 0 then
  57. alert("ActiveDir.DSGetObject failed with error " & hex(err.number) &_
  58. " " & err.description)
  59. exit sub
  60. end if
  61. '
  62. ' Get the object attribute, MemberOf, for this page.
  63. '
  64. MemberList = DsObj.Get("memberOf")
  65. if err.number <> 0 then
  66. alert("Get memberOf failed with error " & hex(err.number) & " " &_
  67. err.desctiption)
  68. err.clear
  69. end if
  70. MemberHTML = "<SELECT size=5 readonly>"
  71. if not IsEmpty(MemberList) then
  72. Const vbString = 8
  73. if VarType(MemberList) = vbString then
  74. MemberHTML = MemberHTML & "<option>" & TrimPath(MemberList) & "</option>"
  75. else
  76. for each i in MemberList
  77. MemberHTML = MemberHTML & "<option>" & TrimPath(i) & "</option>"
  78. next
  79. end if
  80. end if
  81. MemberHTML = MemberHTML & "</SELECT>"
  82. set Element = document.all.item("members", 0)
  83. if err.number <> 0 then
  84. alert("item(members) failed with error " & hex(err.number) & " " &_
  85. err.desctiption)
  86. err.clear
  87. end if
  88. set MemberRange = document.rangeFromElement(Element)
  89. MemberRange.pasteHTML(MemberHTML)
  90. end sub
  91. '------------------------------------------------------------------------------
  92. '
  93. ' Function: TrimPath
  94. '
  95. ' Synopsis: Remove the leading X500: and trailing ,DC=domain parts.
  96. '
  97. '------------------------------------------------------------------------------
  98. function TrimPath(FullPath)
  99. colon = InStr(FullPath, ":")
  100. if colon = 0 then
  101. p1 = FullPath
  102. else
  103. p1 = Right(FullPath, len(FullPath) - colon)
  104. end if
  105. ' BUGBUG: instr(p1, "DC", 1) is not working!
  106. dc = instr(p1, "DC")
  107. if dc <> 0 then
  108. TrimPath = left(p1, dc - 2)
  109. else
  110. TrimPath = p1
  111. end if
  112. end function
  113. '------------------------------------------------------------------------------
  114. '
  115. ' Subroutine: DoApply
  116. '
  117. ' Synopsis: Set the DS object to the new control values.
  118. '
  119. '------------------------------------------------------------------------------
  120. sub DoApply
  121. on error resume next
  122. 'DsObj.Put "description", document.forms(0).description.value
  123. 'if err.number <> 0 then
  124. ' alert("Put description failed with error " & hex(err.number) & " " &_
  125. ' err.desctiption)
  126. ' err.clear
  127. 'end if
  128. 'DsObj.SetInfo
  129. 'if err.number <> 0 then
  130. ' alert("SetInfo failed with error " & hex(err.number) & " " &_
  131. ' err.desctiption)
  132. 'end if
  133. end sub
  134. </SCRIPT>
  135. <font face=Arial size=2>
  136. <div style="position:absolute; top:0.4em; left:0.3em; height:8em; width:29em;">
  137. <div style="position:absolute; top:0.3em; left:0em;">Member Of:</div>
  138. <div style="position:absolute; top:0.2em; left:9em; height:6em; width:15em;" id=members></div>
  139. </div>
  140. </font>
  141. <div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
  142. </div>
  143. <div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
  144. </div>
  145. </BODY>
  146. </HTML>