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.

312 lines
8.8 KiB

  1. <!--
  2. '------------------------------------------------------------------------------
  3. '
  4. ' Directory Service Administration Property Pages
  5. '
  6. ' Microsoft Windows
  7. ' Copyright (C) Microsoft Corporation, 1992 - 1997.
  8. '
  9. ' File: grpgen.htm
  10. '
  11. ' Contents: Group General 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. <style>
  22. <!--
  23. body, input {font-size: 9pt; font-family: "MS Sans Serif, sans-serif"}
  24. -->
  25. </style>
  26. </HEAD>
  27. <BODY bgcolor=silver onload="DoOnLoad()">
  28. <OBJECT ID=ActiveDir CLASSID="Clsid:0998BB05-DFFD-11CF-927F-00AA00688A38">
  29. </OBJECT>
  30. <SCRIPT language=vbscript>
  31. dim DsObj
  32. '------------------------------------------------------------------------------
  33. '
  34. ' Subroutine: DoOnLoad
  35. '
  36. ' Synopsis: Bind to the DS object and set the initial control values.
  37. '
  38. '------------------------------------------------------------------------------
  39. sub DoOnLoad
  40. on error resume next
  41. '
  42. ' Extract the object path from the URL params. This assumes that
  43. ' path= immediatly follows the ?
  44. '
  45. strUrl = document.URL
  46. URLlen = len(strUrl)
  47. i = InStr(strUrl, "?")
  48. i = InStr(i, strUrl, "=")
  49. EncodedPath = right(strUrl, URLlen - i)
  50. err.clear
  51. path = ActiveDir.DecodeURL((EncodedPath))
  52. if err.number <> 0 then
  53. alert("ActiveDir.DecodeURL failed with error " & hex(err.number) &_
  54. " " & err.description)
  55. exit sub
  56. end if
  57. '
  58. ' Activate the object.
  59. '
  60. set DsObj = ActiveDir.DSGetObject((path))
  61. if err.number <> 0 then
  62. alert("ActiveDir.DSGetObject failed with error " & hex(err.number) &_
  63. " " & err.description)
  64. exit sub
  65. end if
  66. '
  67. ' Get the object attributes for this page.
  68. '
  69. set AllColl = document.all
  70. '
  71. ' Common Name - read only
  72. '
  73. ObjName = DsObj.Get("name")
  74. if (err.number <> 0) and (err.number <> &h8000500D) then
  75. alert("Get fullname failed with error " & hex(err.number) & " " &_
  76. err.description)
  77. err.clear
  78. end if
  79. set Element = AllColl.item("commonname", 0)
  80. if err.number <> 0 then
  81. alert("item(commonname) failed with error " & hex(err.number) & " " &_
  82. err.description)
  83. err.clear
  84. end if
  85. set NameRange = document.rangeFromElement(Element)
  86. NameRange.pasteHTML(ObjName)
  87. set Element = nothing
  88. '
  89. ' Member List - read only drop-down list
  90. '
  91. MemberList = DsObj.Get("member")
  92. if (err.number <> 0) and (err.number <> &h8000500D) then
  93. alert("Get fullname failed with error " & hex(err.number) & " " &_
  94. err.description)
  95. err.clear
  96. end if
  97. set Element = AllColl.item("memberslist", 0)
  98. if err.number <> 0 then
  99. alert("item(members) failed with error " & hex(err.number) & " " &_
  100. err.description)
  101. err.clear
  102. end if
  103. MemberHTML = "<SELECT size=5 id=memberslist>"
  104. if not IsEmpty(MemberList) then
  105. Const vbString = 8
  106. if VarType(MemberList) = vbString then
  107. MemberHTML = MemberHTML & "<option>" & TrimPath(MemberList) & "</option>"
  108. 'document.forms(0).member_list.options(0).value = TrimPath(MemberList)
  109. else
  110. n = 0
  111. for each i in MemberList
  112. MemberHTML = MemberHTML & "<option>" & TrimPath(i) & "</option>"
  113. 'document.forms(0).member_list.options(n).value = TrimPath(i)
  114. n = n + 1
  115. next
  116. end if
  117. end if
  118. MemberHTML = MemberHTML & "</SELECT>"
  119. set MemberRange = document.rangeFromElement(Element)
  120. MemberRange.pasteHTML(MemberHTML)
  121. set Element = nothing
  122. '
  123. ' Description - text input control
  124. '
  125. document.forms(0).description.value = DsObj.Get("adminDescription")
  126. if err.number <> 0 then
  127. alert("Get description failed with error " & hex(err.number) & " " &_
  128. err.description)
  129. err.clear
  130. end if
  131. '
  132. ' SAM Account Name - read only
  133. '
  134. SamAcctName = DsObj.Get("sAMAccountName")
  135. if (err.number <> 0) and (err.number <> &h8000500D) then
  136. alert("Get sAMAccountName failed with error " & hex(err.number) & " " &_
  137. err.description)
  138. err.clear
  139. end if
  140. set Element = AllColl.item("samacct", 0)
  141. if err.number <> 0 then
  142. alert("item(samacct) failed with error " & hex(err.number) & " " &_
  143. err.description)
  144. err.clear
  145. end if
  146. set NameRange = document.rangeFromElement(Element)
  147. NameRange.pasteHTML(SamAcctName)
  148. end sub
  149. '------------------------------------------------------------------------------
  150. '
  151. ' Function: TrimPath
  152. '
  153. ' Synopsis: Remove the leading X500: and trailing ,DC=domain parts.
  154. '
  155. '------------------------------------------------------------------------------
  156. function TrimPath(FullPath)
  157. colon = InStr(FullPath, ":")
  158. if colon = 0 then
  159. p1 = FullPath
  160. else
  161. p1 = Right(FullPath, len(FullPath) - colon)
  162. end if
  163. ' BUGBUG: instr(p1, "DC", 1) is not working!
  164. dc = instr(p1, "DC")
  165. if dc <> 0 then
  166. TrimPath = left(p1, dc - 2)
  167. else
  168. TrimPath = p1
  169. end if
  170. end function
  171. '------------------------------------------------------------------------------
  172. '
  173. ' Subroutine: DoApply
  174. '
  175. ' Synopsis: Set the DS object to the new control values.
  176. '
  177. '------------------------------------------------------------------------------
  178. sub DoApply
  179. on error resume next
  180. DsObj.Put "description", (document.forms(0).description.value)
  181. if err.number <> 0 then
  182. alert("Put description failed with error " & hex(err.number) & " " &_
  183. err.description)
  184. err.clear
  185. end if
  186. DsObj.SetInfo
  187. if err.number <> 0 then
  188. errstr = "SetInfo failed with error " & hex(err.number) & " " &_
  189. err.description
  190. if err.number = &h800704B8 then
  191. errstr = errstr & ". Extended error: " & ActiveDir.DSGetLastError
  192. end if
  193. alert(errstr)
  194. err.clear
  195. end if
  196. end sub
  197. </SCRIPT>
  198. <div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
  199. <div style="position:absolute; top:0.3em; left:0em;">Common Name:</div>
  200. <div style="position:absolute; top:0.4em; left:9em; height:1.4em; width:15em;" id=commonname></div>
  201. </div>
  202. <div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
  203. <div style="position:absolute; top:0.3em; left:0em;">SAM Name:</div>
  204. <div style="position:absolute; top:0.4em; left:9em; height:1.4em; width:15em;" id=samacct></div>
  205. </div>
  206. <form>
  207. <div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
  208. <div style="position:absolute; top:0.3em; left:0em;">Description:</div>
  209. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:8em; height:1.6em; width:15em;" name=description>
  210. </div>
  211. <div style="position:absolute; top:7.3em; left:0.3em; height:10em; width:29em;">
  212. <div style="position:absolute; top:0.3em; left:0em;">Members:</div>
  213. <div style="position:absolute; top:0.3em; left:9em; height:5.3em; width:15em;">
  214. <select size=5 id=memberslist name="member_list"></select></div>
  215. <input type=button value="Add Members..." name=AddMember style="position:absolute; top:6.5em; left:1em; height:2em; width:11em;">
  216. <input type=button value="Remove Member" name=RmMember style="position:absolute; top:6.5em; left:13em; height:2em; width:11em;" disabled>
  217. </div>
  218. </form>
  219. <div style="position:absolute; top:17.5em; left:0.3em; height:2em; width:29em;">
  220. </div>
  221. <div style="position:absolute; top:20.5em; left:0.3em; height:2em; width:29em;">
  222. </div>
  223. <SCRIPT for=memberslist event="onclick()" language=vbscript>
  224. '------------------------------------------------------------------------------
  225. '
  226. ' Subroutine: memberslist_OnChange
  227. '
  228. ' Synopsis:
  229. '
  230. '------------------------------------------------------------------------------
  231. 'sub memberslist_OnClick
  232. alert "members_OnChange."
  233. document.forms(0).RmMember.disabled = 0
  234. 'end sub
  235. </script>
  236. <SCRIPT language=vbscript>
  237. '------------------------------------------------------------------------------
  238. '
  239. ' Subroutine: AddMember_OnClick
  240. '
  241. ' Synopsis:
  242. '
  243. '------------------------------------------------------------------------------
  244. sub AddMember_OnClick
  245. alert "Someday this will post a dialog allowing a new member to be selected."
  246. end sub
  247. '------------------------------------------------------------------------------
  248. '
  249. ' Subroutine: RmMember_OnClick
  250. '
  251. ' Synopsis:
  252. '
  253. '------------------------------------------------------------------------------
  254. sub RmMember_OnClick
  255. alert "Someday this will remove the selected item from this group."
  256. end sub
  257. </script>
  258. </BODY>
  259. </HTML>