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.

254 lines
7.7 KiB

  1. <!--
  2. '------------------------------------------------------------------------------
  3. '
  4. ' Directory Service Administration Property Pages
  5. '
  6. ' Microsoft Windows
  7. ' Copyright (C) Microsoft Corporation, 1992 - 1997.
  8. '
  9. ' File: usrgen.htm
  10. '
  11. ' Contents: User 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. </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).fullname.value = DsObj.Get("userFullName")
  65. if (err.number <> 0) and (err.number <> &h8000500D) then
  66. alert("Get fullname failed with error " & hex(err.number) & " " &_
  67. err.description)
  68. err.clear
  69. end if
  70. document.forms(0).firstname.value = DsObj.Get("givenName")
  71. if (err.number <> 0) and (err.number <> &h8000500D) then
  72. alert("Get firstname failed with error " & hex(err.number) & " " &_
  73. err.description)
  74. err.clear
  75. end if
  76. document.forms(0).lastname.value = DsObj.Get("sn")
  77. if (err.number <> 0) and (err.number <> &h8000500D) then
  78. alert("Get lastname failed with error " & hex(err.number) & " " &_
  79. err.description)
  80. err.clear
  81. end if
  82. document.forms(0).prefix.value = DsObj.Get("personalTitle")
  83. if (err.number <> 0) and (err.number <> &h8000500D) then
  84. alert("Get prefix failed with error " & hex(err.number) & " " &_
  85. err.description)
  86. err.clear
  87. end if
  88. document.forms(0).suffix.value = DsObj.Get("generationQualifier")
  89. if (err.number <> 0) and (err.number <> &h8000500D) then
  90. alert("Get suffix failed with error " & hex(err.number) & " " &_
  91. err.description)
  92. err.clear
  93. end if
  94. '
  95. ' Email addresses: loop through the list.
  96. '
  97. document.forms(0).description.value = DsObj.Get("description")
  98. if (err.number <> 0) and (err.number <> &h8000500D) then
  99. alert("Get description failed with error " & hex(err.number) & " " &_
  100. err.description)
  101. err.clear
  102. end if
  103. end sub
  104. '------------------------------------------------------------------------------
  105. '
  106. ' Subroutine: DoApply
  107. '
  108. ' Synopsis: Set the DS object to the new control values.
  109. '
  110. '------------------------------------------------------------------------------
  111. sub DoApply
  112. on error resume next
  113. DsObj.Put "userFullName", (document.forms(0).fullname.value)
  114. if err.number <> 0 then
  115. alert("Put fullname failed with error " & hex(err.number) & " " &_
  116. err.description)
  117. err.clear
  118. end if
  119. DsObj.Put "givenName", (document.forms(0).firstname.value)
  120. if err.number <> 0 then
  121. alert("Put firstname failed with error " & hex(err.number) & " " &_
  122. err.description)
  123. err.clear
  124. end if
  125. DsObj.Put "sn", (document.forms(0).lastname.value)
  126. if err.number <> 0 then
  127. alert("Put lastname failed with error " & hex(err.number) & " " &_
  128. err.description)
  129. err.clear
  130. end if
  131. DsObj.Put "personalTitle", (document.forms(0).prefix.value)
  132. if err.number <> 0 then
  133. alert("Put prefix failed with error " & hex(err.number) & " " &_
  134. err.description)
  135. err.clear
  136. end if
  137. DsObj.Put "generationQualifier", (document.forms(0).suffix.value)
  138. if err.number <> 0 then
  139. alert("Put suffix failed with error " & hex(err.number) & " " &_
  140. err.description)
  141. err.clear
  142. end if
  143. '
  144. ' Email addresses: loop through the list.
  145. '
  146. DsObj.Put "description", (document.forms(0).description.value)
  147. if err.number <> 0 then
  148. alert("Put description failed with error " & hex(err.number) & " " &_
  149. err.description)
  150. err.clear
  151. end if
  152. DsObj.SetInfo
  153. if err.number <> 0 then
  154. errstr = "SetInfo failed with error " & hex(err.number) & " " &_
  155. err.description
  156. if err.number = &h800704B8 then
  157. errstr = errstr & ". Extended error: " & ActiveDir.DSGetLastError
  158. end if
  159. alert(errstr)
  160. err.clear
  161. end if
  162. end sub
  163. </SCRIPT>
  164. <form>
  165. <font face=Arial size=2>
  166. <div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
  167. <div style="position:absolute; top:0.3em; left:0em;">Full Name:</div>
  168. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=fullname>
  169. </div>
  170. <div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
  171. <div style="position:absolute; top:0.3em; left:0em;">First Name:</div>
  172. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=firstname>
  173. </div>
  174. <div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
  175. <div style="position:absolute; top:0.3em; left:0em;">Last Name:</div>
  176. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=lastname>
  177. </div>
  178. <div style="position:absolute; top:7.3em; left:0.3em; height:2em; width:29em;">
  179. <div style="position:absolute; top:0.3em; left:0em;">Name Prefix:</div>
  180. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=prefix>
  181. </div>
  182. <div style="position:absolute; top:9.6em; left:0.3em; height:2em; width:29em;">
  183. <div style="position:absolute; top:0.3em; left:0em;">Name Suffix:</div>
  184. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=suffix>
  185. </div>
  186. <div style="position:absolute; top:11.9em; left:0.3em; height:2em; width:29em;">
  187. <div style="position:absolute; top:0.3em; left:0em;">Email Addresses*:</div>
  188. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=emailname>
  189. </div>
  190. <div style="position:absolute; top:14.2em; left:0.3em; height:2em; width:29em;">
  191. <div style="position:absolute; top:0.3em; left:0em;">Description:</div>
  192. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=description>
  193. </div>
  194. <div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
  195. </div>
  196. <div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
  197. </div>
  198. </font>
  199. </form>
  200. </BODY>
  201. </HTML>