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.

248 lines
7.0 KiB

  1. <!--
  2. '------------------------------------------------------------------------------
  3. '
  4. ' Directory Service Administration Property Pages
  5. '
  6. ' Microsoft Windows
  7. ' Copyright (C) Microsoft Corporation, 1992 - 1997.
  8. '
  9. ' File: usrorg.htm
  10. '
  11. ' Contents: User Organization property page.
  12. '
  13. ' History: 2-19-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 attributes for this page.
  63. '
  64. document.forms(0).title.value = DsObj.Get("title")
  65. if (err.number <> 0) and (err.number <> &h8000500D) then
  66. alert("Get title failed with error " & hex(err.number) & " " &_
  67. err.description)
  68. err.clear
  69. end if
  70. document.forms(0).department.value = DsObj.Get("department")
  71. if (err.number <> 0) and (err.number <> &h8000500D) then
  72. alert("Get department failed with error " & hex(err.number) & " " &_
  73. err.description)
  74. err.clear
  75. end if
  76. document.forms(0).manager.value = DsObj.Get("manager")
  77. if (err.number <> 0) and (err.number <> &h8000500D) then
  78. alert("Get manager failed with error " & hex(err.number) & " " &_
  79. err.description)
  80. err.clear
  81. end if
  82. end sub
  83. '------------------------------------------------------------------------------
  84. '
  85. ' Subroutine: DoApply
  86. '
  87. ' Synopsis: Set the DS object to the new control values.
  88. '
  89. '------------------------------------------------------------------------------
  90. sub DoApply
  91. on error resume next
  92. if not isobject(DsObj) then
  93. alert("DsObject is not active on entry to DoApply subroutine!")
  94. end if
  95. err.clear
  96. DsObj.Put "title", (document.forms(0).title.value)
  97. if err.number <> 0 then
  98. alert("Put title failed with error " & hex(err.number) & " " &_
  99. err.description)
  100. err.clear
  101. end if
  102. DsObj.Put "department", (document.forms(0).department.value)
  103. if err.number <> 0 then
  104. alert("Put department failed with error " & hex(err.number) & " " &_
  105. err.description)
  106. err.clear
  107. end if
  108. ' BUGBUG: Need a 'person-picker' to do DS DN properties like this.
  109. 'DsObj.Put "manager", (document.forms(0).manager.value)
  110. if err.number <> 0 then
  111. alert("Put manager failed with error " & hex(err.number) & " " &_
  112. err.description)
  113. err.clear
  114. end if
  115. DsObj.Put "company", (document.forms(0).company.value)
  116. if err.number <> 0 then
  117. alert("Put company failed with error " & hex(err.number) & " " &_
  118. err.description)
  119. err.clear
  120. end if
  121. DsObj.SetInfo
  122. if err.number <> 0 then
  123. errstr = "SetInfo failed with error " & hex(err.number) & " " &_
  124. err.description
  125. if err.number = &h800704B8 then
  126. errstr = errstr & ". Extended error: " & ActiveDir.DSGetLastError
  127. end if
  128. alert(errstr)
  129. err.clear
  130. end if
  131. end sub
  132. </SCRIPT>
  133. <form>
  134. <font face=Arial size=2>
  135. <div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
  136. <div style="position:absolute; top:0.3em; left:0em;">Title:</div>
  137. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=title>
  138. </div>
  139. <div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
  140. <div style="position:absolute; top:0.3em; left:0em;">Department:</div>
  141. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=department>
  142. </div>
  143. <div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
  144. <div style="position:absolute; top:0.3em; left:0em;">Manager*:</div>
  145. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=manager>
  146. </div>
  147. <div style="position:absolute; top:7.3em; left:0.3em; height:2em; width:29em;">
  148. <div style="position:absolute; top:0.3em; left:0em;">Company:</div>
  149. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=company>
  150. </div>
  151. <div style="position:absolute; top:9.6em; left:0.3em; height:2em; width:29em;">
  152. </div>
  153. <div style="position:absolute; top:11.9em; left:0.3em; height:2em; width:29em;">
  154. </div>
  155. <div style="position:absolute; top:14.2em; left:0.3em; height:2em; width:29em;">
  156. </div>
  157. <div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
  158. </div>
  159. <div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
  160. </div>
  161. </font>
  162. </form>
  163. <SCRIPT language=vbscript>
  164. '------------------------------------------------------------------------------
  165. '
  166. ' Subroutine: Filler
  167. '
  168. ' Synopsis: This is here only as a work around for the display bug in the
  169. ' layout engine.
  170. '
  171. '------------------------------------------------------------------------------
  172. sub Filler
  173. on error resume next
  174. DsObj.Put "givenName", (document.forms(0).title.value)
  175. if err.number <> 0 then
  176. alert("Put title failed with error " & hex(err.number) & " " &_
  177. err.description)
  178. end if
  179. DsObj.Put "sn", (document.forms(0).lastname.value)
  180. if err.number <> 0 then
  181. alert("Put lastname failed with error " & hex(err.number) & " " &_
  182. err.description)
  183. end if
  184. DsObj.Put "url", (document.forms(0).homepage.value)
  185. if err.number <> 0 then
  186. alert("Put homepage failed with error " & hex(err.number) & " " &_
  187. err.description)
  188. end if
  189. DsObj.SetInfo
  190. if err.number <> 0 then
  191. alert("SetInfo failed with error " & hex(err.number) & " " &_
  192. err.description)
  193. end if
  194. end sub
  195. </SCRIPT>
  196. </BODY>
  197. </HTML>