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.

365 lines
13 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE>Edit ACE</TITLE>
  5. <LINK REL="STYLESHEET" HREF="sdstyle.css">
  6. <SCRIPT LANGUAGE=VBScript>
  7. dim ace
  8. dim bModify
  9. Sub window_onload
  10. ' Here we can determine whether we have been passed an existing
  11. ' ACE to modify, or whether we are creating anew
  12. if IsEmpty (window.dialogArguments) OR IsNull (window.dialogArguments) _
  13. OR vbError = varType(window.dialogArguments) then
  14. bModify = false
  15. dsSpecific_onclick
  16. set ace = CreateObject("AccessControlEntry")
  17. else
  18. bModify = true
  19. set ace = window.dialogArguments
  20. ' 1. Access Mask
  21. accessMask = ace.AccessMask
  22. if accessMask AND CLng(adDelete.value) then adDelete.checked = true
  23. if accessMask AND CLng(adReadControl.value) then adReadControl.checked = true
  24. if accessMask AND CLng(adWriteDAC.value) then adWriteDAC.checked = true
  25. if accessMask AND CLng(adWriteOwner.value) then adWriteOwner.checked = true
  26. if accessMask AND CLng(adSynchronize.value) then adSynchronize.checked = true
  27. if accessMask AND CLng(adAccessSystemSecurity.value) then adAccessSystemSecurity.checked = true
  28. if accessMask AND CLng(adGenericRead.value) then adGenericRead.checked = true
  29. if accessMask AND CLng(adGenericWrite.value) then adGenericWrite.checked = true
  30. if accessMask AND CLng(adGenericExecute.value) then adGenericExecute.checked = true
  31. if accessMask AND CLng(adGenericAll.value) then adGenericAll.checked = true
  32. dsSpecificMaskBitsSet = false
  33. if accessMask AND CLng(adCreateChild.value) then
  34. adCreateChild.checked = true
  35. dsSpecificMaskBitsSet = true
  36. end if
  37. if accessMask AND CLng(adDeleteChild.value) then
  38. adDeleteChild.checked = true
  39. dsSpecificMaskBitsSet = true
  40. end if
  41. if accessMask AND CLng(adListChildren.value) then
  42. adListChildren.checked = true
  43. dsSpecificMaskBitsSet = true
  44. end if
  45. if accessMask AND CLng(adModifyGroupMembership.value) then
  46. adModifyGroupMembership.checked = true
  47. dsSpecificMaskBitsSet = true
  48. end if
  49. if accessMask AND CLng(adReadProperties.value) then
  50. adReadProperties.checked = true
  51. dsSpecificMaskBitsSet = true
  52. end if
  53. if accessMask AND CLng(adWriteProperties.value) then
  54. adWriteProperties.checked = true
  55. dsSpecificMaskBitsSet = true
  56. end if
  57. if accessMask AND CLng(adDeleteChildren.value) then
  58. adDeleteChildren.checked = true
  59. dsSpecificMaskBitsSet = true
  60. end if
  61. if accessMask AND CLng(adListObject.value) then
  62. adListObject.checked = true
  63. dsSpecificMaskBitsSet = true
  64. end if
  65. if accessMask AND CLng(adControlAccess.value) then
  66. adControlAccess.checked = true
  67. dsSpecificMaskBitsSet = true
  68. end if
  69. if dsSpecificMaskBitsSet then
  70. dsSpecific.checked = true
  71. end if
  72. dsSpecific_onclick
  73. ' 2. Type
  74. aceType.value = ace.AceType
  75. if ace.AceType >= 5 then
  76. aceType.value = ace.AceType - 5
  77. applicableToObjects.checked = true
  78. applicableToObjects_onclick
  79. if Not(dsSpecific.checked) then
  80. dsSpecific.checked = true
  81. dsSpecific_onclick
  82. end if
  83. else
  84. aceType.value = ace.AceType
  85. end if
  86. ' 3. Flags
  87. flagValue = ace.AceFlags
  88. if flagValue AND CLng(adInheritACE.value) then adInheritACE.checked = true
  89. if flagValue AND CLng(adDontPropagateInheritedACE.value) then adDontPropagateInheritedACE.checked = true
  90. if flagValue AND CLng(adInheritOnlyACE.value) then adInheritOnlyACE.checked = true
  91. if flagValue AND CLng(adAuditSuccessfulAccess.value) then adAuditSuccessfulAccess.checked = true
  92. if flagValue AND CLng(adAuditFailedAccess.value) then adAuditFailedAccess.checked = true
  93. ' 4. Object Type
  94. if applicableToObjects.checked then
  95. if ace.Flags AND &H1 then
  96. objectTypeMarkAsPresent.checked = true
  97. objectType.value = ace.ObjectType
  98. end if
  99. if ace.Flags AND &H2 then
  100. inheritedObjectTypeMarkAsPresent.checked = true
  101. inheritedObjectType.value = ace.InheritedObjectType
  102. end if
  103. end if
  104. ' 5. Trustee
  105. trustee.value = ace.trustee
  106. end if
  107. End Sub
  108. Sub applicableToObjects_onclick
  109. if applicableToObjects.checked then
  110. ' Show the object and inherited object sections
  111. objectsApplicable.style.display = "inline"
  112. else
  113. ' Hide them
  114. objectsApplicable.style.display = "none"
  115. end if
  116. End Sub
  117. Sub OK_onmouseover
  118. window.status = "Save this ACE in the ACL"
  119. OK.style.color = "Green"
  120. OK.style.fontWeight = "bolder"
  121. OK.style.cursor = "hand"
  122. End Sub
  123. Sub OK_onmouseout
  124. window.status = ""
  125. OK.style.color = "SaddleBrown"
  126. OK.style.fontWeight = "lighter"
  127. OK.style.cursor = "auto"
  128. End Sub
  129. Sub Cancel_onmouseover
  130. window.status = "Discard new ACE without adding to ACL"
  131. Cancel.style.color = "Green"
  132. Cancel.style.fontWeight = "bolder"
  133. Cancel.style.cursor = "hand"
  134. End Sub
  135. Sub Cancel_onmouseout
  136. window.status = ""
  137. Cancel.style.color = "SaddleBrown"
  138. Cancel.style.fontWeight = "lighter"
  139. Cancel.style.cursor = "auto"
  140. End Sub
  141. Sub dsSpecific_onclick
  142. on error resume next
  143. for each e in document.all.item("ADSISpecific")
  144. if dsSpecific.checked then
  145. e.style.display = "inline"
  146. else
  147. e.style.display = "none"
  148. end if
  149. next
  150. End Sub
  151. Sub OK_onclick
  152. on error resume next
  153. ' 1. Set the access mask
  154. accessMask = 0
  155. if adDelete.checked then accessMask = accessMask + CLng(adDelete.value)
  156. if adReadControl.checked then accessMask = accessMask + CLng(adReadControl.value)
  157. if adWriteDAC.checked then accessMask = accessMask + CLng(adWriteDAC.value)
  158. if adWriteOwner.checked then accessMask = accessMask + CLng(adWriteOwner.value)
  159. if adSynchronize.checked then accessMask = accessMask + CLng(adSynchronize.value)
  160. if adAccessSystemSecurity.checked then accessMask = accessMask + CLng(adAccessSystemSecurity.value)
  161. if adGenericRead.checked then accessMask = accessMask + CLng(adGenericRead.value)
  162. if adGenericWrite.checked then accessMask = accessMask + CLng(adGenericWrite.value)
  163. if adGenericExecute.checked then accessMask = accessMask + CLng(adGenericExecute.value)
  164. if adGenericAll.checked then accessMask = accessMask + CLng(adGenericAll.value)
  165. if dsSpecific.checked then
  166. if adCreateChild.checked then accessMask = accessMask + CLng(adCreateChild.value)
  167. if adDeleteChild.checked then accessMask = accessMask + CLng(adDeleteChild.value)
  168. if adListChildren.checked then accessMask = accessMask + CLng(adListChildren.value)
  169. if adModifyGroupMembership.checked then accessMask = accessMask + CLng(adModifyGroupMembership.value)
  170. if adReadProperties.checked then accessMask = accessMask + CLng(adReadProperties.value)
  171. if adWriteProperties.checked then accessMask = accessMask + CLng(adWriteProperties.value)
  172. if adDeleteChildren.checked then accessMask = accessMask + CLng(adDeleteChildren.value)
  173. if adListObject.checked then accessMask = accessMask + CLng(adListObject.value)
  174. if adControlAccess.checked then accessMask = accessMask + CLng(adControlAccess.value)
  175. end if
  176. ace.AccessMask = accessMask
  177. ' 2. Set the Type
  178. typeValue = aceType.value
  179. if dsSpecific.checked and applicableToObjects.checked then typeValue = typeValue + CLng(applicableToObjects.value)
  180. ace.AceType = typeValue
  181. ' 3. Set the flags
  182. flagValue = 0
  183. if adInheritACE.checked then flagValue = flagValue + CLng(adInheritACE.value)
  184. if adDontPropagateInheritedACE.checked then flagValue = flagValue + CLng(adDontPropagateInheritedACE.value)
  185. if adInheritOnlyACE.checked then flagValue = flagValue + CLng(adInheritOnlyACE.value)
  186. if adAuditSuccessfulAccess.checked then flagValue = flagValue + CLng(adAuditSuccessfulAccess.value)
  187. if adAuditFailedAccess.checked then flagValue = flagValue + CLng(adAuditFailedAccess.value)
  188. ace.AceFlags = flagValue
  189. ' 4. Set the Object Type
  190. if dsSpecific.checked AND applicableToObjects.checked then
  191. if objectTypeMarkAsPresent.checked AND Len(objectType.value) > 0 then
  192. ace.Flags = ace.Flags OR &H1
  193. ace.ObjectType = objectType.value
  194. end if
  195. if inheritedObjectTypeMarkAsPresent.checked AND Len(inheritedObjectType.value) > 0 then
  196. ace.Flags = ace.Flags OR &H2
  197. ace.InheritedObjectType = inheritedObjectType.value
  198. end if
  199. end if
  200. ' 5. Set the Trustee
  201. ace.Trustee = trustee.value
  202. if err <> 0 then
  203. alert Err.Description & ": 0x" & Hex(Err.number)
  204. if bModify then window.returnValue = false
  205. else
  206. if bModify then
  207. window.returnValue = true
  208. else
  209. window.returnValue = ace
  210. end if
  211. window.close
  212. end if
  213. End Sub
  214. Sub Cancel_onclick
  215. window.returnValue = null
  216. window.close
  217. End Sub
  218. </SCRIPT>
  219. </HEAD>
  220. <BODY LANGUAGE=javascript>
  221. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  222. <TR>
  223. <TD><H3>Access Mask</H3></TD>
  224. <TD><INPUT type=checkbox id=dsSpecific
  225. >
  226. <SPAN CLASS=BoxText>Display DS-specific options</SPAN></TD></TR>
  227. </TABLE>
  228. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 CLASS="data" id=tableAccessMask>
  229. <TR>
  230. <TD><INPUT type=checkbox id=adDelete value="&H10000">Delete</TD>
  231. <TD id=ADSISpecific><INPUT type=checkbox id=adCreateChild value="&H1">Create Child</TD></TR>
  232. <TR>
  233. <TD><INPUT type=checkbox id=adReadControl value="&H20000">Read Control</TD>
  234. <TD id=ADSISpecific><INPUT type=checkbox id=adDeleteChild value="&H2">Delete Child</TD></TR>
  235. <TR>
  236. <TD><INPUT type=checkbox id=adWriteDAC value="&H40000">Write DAC</TD>
  237. <TD id=ADSISpecific><INPUT type=checkbox id=adListChildren value="&H4">List Children</TD></TR>
  238. <TR>
  239. <TD><INPUT type=checkbox id=adWriteOwner value="&H80000">Write Owner</TD>
  240. <TD id=ADSISpecific><INPUT type=checkbox id=adModifyGroupMembership value="&H8">Modify Group Membership</TD></TR>
  241. <TR>
  242. <TD><INPUT type=checkbox id=adSynchronize value="&H100000">Synchronize</TD>
  243. <TD id=ADSISpecific><INPUT type=checkbox id=adReadProperties value="&H10">Read Properties</TD></TR>
  244. <TR>
  245. <TD><INPUT type=checkbox id=adAccessSystemSecurity value="&H1000000">Access System Security</TD>
  246. <TD id=ADSISpecific><INPUT type=checkbox id=adWriteProperties value="&H20">Write Properties</TD></TR>
  247. <TR>
  248. <TD><INPUT type=checkbox id=adGenericRead value="&H80000000">Generic Read</TD>
  249. <TD id=ADSISpecific><INPUT type=checkbox id=adDeleteChildren value="&H40">Delete Children</TD></TR>
  250. <TR>
  251. <TD><INPUT type=checkbox id=adGenericWrite value="&H40000000">Generic Write</TD>
  252. <TD id=ADSISpecific><INPUT type=checkbox id=adListObject value="&H80">List Object</TD></TR>
  253. <TR>
  254. <TD><INPUT type=checkbox id=adGenericExecute value="&H20000000">Generic Execute</TD>
  255. <TD id=ADSISpecific><INPUT type=checkbox id=adControlAccess value="&H100">Control Access</TD></TR>
  256. <TR>
  257. <TD>
  258. <P><INPUT type=checkbox id=adGenericAll value="&H10000000">Generic All</P></TD>
  259. <TD></TD></TR></TABLE>
  260. <HR>
  261. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  262. <TR>
  263. <TD><H3>Type</H3></TD><TD><H3>Trustee</H3></TD>
  264. </TR>
  265. <TR>
  266. <TD>
  267. <SELECT style="WIDTH: 230px" id=aceType>
  268. <OPTION value="0" selected>Access Allowed
  269. <OPTION value="1">Access Denied
  270. <OPTION value="2">System Audit</OPTION>
  271. </SELECT>
  272. </TD>
  273. <TD>
  274. <INPUT style="WIDTH: 314px; HEIGHT: 22px" size=44 id=trustee name=text1></TD>
  275. </TR>
  276. <TR id=ADSISpecific><TD><INPUT type=checkbox id=applicableToObjects value="5"><SPAN CLASS=BoxText>Applicable to Objects</SPAN></TD>
  277. </TR>
  278. </TABLE>
  279. <HR>
  280. <H3>Flags</H3>
  281. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 CLASS="data">
  282. <TR>
  283. <TD><INPUT type=checkbox id=adInheritACE value="&H2">Inherit ACE</TD>
  284. <TD><INPUT type=checkbox id=adDontPropagateInheritedACE value="&H4">Don't Propagate Inherited ACE</TD></TR>
  285. <TR>
  286. <TD><INPUT type=checkbox id=adInheritOnlyACE value="&H8">Inherit Only ACE</TD>
  287. <TD><INPUT type=checkbox id=adAuditSuccessfulAccess value="&H40">Audit Successful Access</TD></TR>
  288. <TR>
  289. <TD><INPUT type=checkbox id=adAuditFailedAccess value="&H80">Audit Failed Access</TD>
  290. </TR>
  291. </TABLE>
  292. <HR>
  293. <SPAN ID=ADSISpecific>
  294. <SPAN ID=objectsApplicable STYLE="DISPLAY: none">
  295. <H3>Object Type</H3>
  296. <INPUT style="WIDTH: 464px; HEIGHT: 22px" size=66 id=objectType>&nbsp;
  297. <INPUT id=objectTypeMarkAsPresent type=checkbox>
  298. <SPAN CLASS=BoxText>Mark as Present</SPAN>
  299. <HR>
  300. <H3>Inherited Object Type</H3>
  301. <INPUT style="WIDTH: 464px; HEIGHT: 22px" size=66 id=inheritedObjectType>&nbsp;
  302. <INPUT id=inheritedObjectTypeMarkAsPresent type=checkbox>
  303. <SPAN CLASS=BoxText>Mark as Present</SPAN>
  304. <HR>
  305. </SPAN></SPAN>
  306. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  307. <COLGROUP width="50%"><COLGROUP width="50%">
  308. <TR>
  309. <TD>
  310. <P align=center CLASS=HotText id=OK>OK</P></TD>
  311. <TD>
  312. <P align=center CLASS=HotText id=Cancel>Cancel</P></TD>
  313. </TR></TABLE>
  314. </BODY>
  315. </HTML>