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.

323 lines
9.2 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-11-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 then
  66. alert("Get fullname failed with error " & hex(err.number) & " " &_
  67. err.desctiption)
  68. err.clear
  69. end if
  70. document.forms(0).firstname.value = DsObj.Get("givenName")
  71. if err.number <> 0 then
  72. alert("Get firstname failed with error " & hex(err.number) & " " &_
  73. err.desctiption)
  74. err.clear
  75. end if
  76. document.forms(0).lastname.value = DsObj.Get("sn")
  77. if err.number <> 0 then
  78. alert("Get lastname failed with error " & hex(err.number) & " " &_
  79. err.desctiption)
  80. err.clear
  81. end if
  82. document.forms(0).prefix.value = DsObj.Get("personalTitle")
  83. if err.number <> 0 then
  84. alert("Get prefix failed with error " & hex(err.number) & " " &_
  85. err.desctiption)
  86. err.clear
  87. end if
  88. document.forms(0).suffix.value = DsObj.Get("generationQualifier")
  89. if err.number <> 0 then
  90. alert("Get suffix failed with error " & hex(err.number) & " " &_
  91. err.desctiption)
  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 then
  99. alert("Get description failed with error " & hex(err.number) & " " &_
  100. err.desctiption)
  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.desctiption)
  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.desctiption)
  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.desctiption)
  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.desctiption)
  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.desctiption)
  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.desctiption)
  150. err.clear
  151. end if
  152. DsObj.SetInfo
  153. if err.number <> 0 then
  154. alert("SetInfo failed with error " & hex(err.number) & " " &_
  155. err.desctiption)
  156. end if
  157. end sub
  158. </SCRIPT>
  159. <form>
  160. <font face=Arial size=2>
  161. <div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
  162. <div style="position:absolute; top:0.3em; left:0em;">Full Name:</div>
  163. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=fullname>
  164. </div>
  165. <div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
  166. <div style="position:absolute; top:0.3em; left:0em;">First Name:</div>
  167. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=firstname>
  168. </div>
  169. <div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
  170. <div style="position:absolute; top:0.3em; left:0em;">Last Name:</div>
  171. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=lastname>
  172. </div>
  173. <div style="position:absolute; top:7.3em; left:0.3em; height:2em; width:29em;">
  174. <div style="position:absolute; top:0.3em; left:0em;">Name Prefix:</div>
  175. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=prefix>
  176. </div>
  177. <div style="position:absolute; top:9.6em; left:0.3em; height:2em; width:29em;">
  178. <div style="position:absolute; top:0.3em; left:0em;">Name Suffix:</div>
  179. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=suffix>
  180. </div>
  181. <div style="position:absolute; top:11.9em; left:0.3em; height:2em; width:29em;">
  182. <div style="position:absolute; top:0.3em; left:0em;">Email Addresses*:</div>
  183. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=emailname>
  184. </div>
  185. <div style="position:absolute; top:14.2em; left:0.3em; height:2em; width:29em;">
  186. <div style="position:absolute; top:0.3em; left:0em;">Description:</div>
  187. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=description>
  188. </div>
  189. <div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
  190. </div>
  191. <div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
  192. </div>
  193. </font>
  194. </form>
  195. <SCRIPT language=vbscript>
  196. '------------------------------------------------------------------------------
  197. '
  198. ' Subroutine: Filler
  199. '
  200. ' Synopsis: This is here only as a work around for the display bug in the
  201. ' layout engine.
  202. '
  203. '------------------------------------------------------------------------------
  204. sub Filler
  205. on error resume next
  206. DsObj.Put "givenName", document.forms(0).firstname.value
  207. if err.number <> 0 then
  208. alert("Put firstname failed with error " & hex(err.number) & " " &_
  209. err.desctiption)
  210. end if
  211. DsObj.Put "sn", document.forms(0).lastname.value
  212. if err.number <> 0 then
  213. alert("Put lastname failed with error " & hex(err.number) & " " &_
  214. err.desctiption)
  215. end if
  216. DsObj.Put "url", document.forms(0).homepage.value
  217. if err.number <> 0 then
  218. alert("Put homepage failed with error " & hex(err.number) & " " &_
  219. err.desctiption)
  220. end if
  221. DsObj.SetInfo
  222. if err.number <> 0 then
  223. alert("SetInfo failed with error " & hex(err.number) & " " &_
  224. err.desctiption)
  225. end if
  226. end sub
  227. sub Filler1
  228. on error resume next
  229. DsObj.Put "givenName", document.forms(0).firstname.value
  230. if err.number <> 0 then
  231. alert("Put firstname failed with error " & hex(err.number) & " " &_
  232. err.desctiption)
  233. end if
  234. DsObj.Put "sn", document.forms(0).lastname.value
  235. if err.number <> 0 then
  236. alert("Put lastname failed with error " & hex(err.number) & " " &_
  237. err.desctiption)
  238. end if
  239. DsObj.Put "url", document.forms(0).homepage.value
  240. if err.number <> 0 then
  241. alert("Put homepage failed with error " & hex(err.number) & " " &_
  242. err.desctiption)
  243. end if
  244. DsObj.SetInfo
  245. if err.number <> 0 then
  246. alert("SetInfo failed with error " & hex(err.number) & " " &_
  247. err.desctiption)
  248. end if
  249. end sub
  250. </SCRIPT>
  251. </BODY>
  252. </HTML>