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.

316 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: usrcon.htm
  10. '
  11. ' Contents: User Contact property page.
  12. '
  13. ' History: 2-21-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).workphones.value = DsObj.Get("telephoneNumber")
  65. if (err.number <> 0) and (err.number <> &h8000500D) then
  66. alert("Get workphones failed with error " & hex(err.number) & " " &_
  67. err.description)
  68. err.clear
  69. end if
  70. document.forms(0).fax.value = DsObj.Get("facsimileTelephoneNumber")
  71. if (err.number <> 0) and (err.number <> &h8000500D) then
  72. alert("Get fax failed with error " & hex(err.number) & " " &_
  73. err.description)
  74. err.clear
  75. end if
  76. document.forms(0).homephones.value = DsObj.Get("homePhone")
  77. if (err.number <> 0) and (err.number <> &h8000500D) then
  78. alert("Get homephones failed with error " & hex(err.number) & " " &_
  79. err.description)
  80. err.clear
  81. end if
  82. document.forms(0).homepage.value = DsObj.Get("url")
  83. if (err.number <> 0) and (err.number <> &h8000500D) then
  84. alert("Get homepage failed with error " & hex(err.number) & " " &_
  85. err.description)
  86. err.clear
  87. end if
  88. document.forms(0).comment.value = DsObj.Get("comment")
  89. if (err.number <> 0) and (err.number <> &h8000500D) then
  90. alert("Get comment failed with error " & hex(err.number) & " " &_
  91. err.description)
  92. err.clear
  93. end if
  94. end sub
  95. '------------------------------------------------------------------------------
  96. '
  97. ' Subroutine: DoApply
  98. '
  99. ' Synopsis: Set the DS object to the new control values.
  100. '
  101. '------------------------------------------------------------------------------
  102. sub DoApply
  103. on error resume next
  104. ' Multi-valued
  105. 'DsObj.Put "telephoneNumber", (document.forms(0).workphones.value)
  106. if err.number <> 0 then
  107. alert("Put workphones failed with error " & hex(err.number) & " " &_
  108. err.description)
  109. err.clear
  110. end if
  111. ' Multi-valued
  112. 'DsObj.Put "facsimileTelephoneNumber", (document.forms(0).fax.value)
  113. if err.number <> 0 then
  114. alert("Put fax failed with error " & hex(err.number) & " " &_
  115. err.description)
  116. err.clear
  117. end if
  118. ' Multi-valued
  119. 'DsObj.Put "homePhone", (document.forms(0).homephones.value)
  120. if err.number <> 0 then
  121. alert("Put homephones failed with error " & hex(err.number) & " " &_
  122. err.description)
  123. err.clear
  124. end if
  125. ' Multi-valued
  126. 'DsObj.Put "url", (document.forms(0).homepage.value)
  127. if err.number <> 0 then
  128. alert("Put homepage failed with error " & hex(err.number) & " " &_
  129. err.description)
  130. err.clear
  131. end if
  132. DsObj.Put "comment", (document.forms(0).comment.value)
  133. if err.number <> 0 then
  134. alert("Put comment failed with error " & hex(err.number) & " " &_
  135. err.description)
  136. err.clear
  137. end if
  138. DsObj.SetInfo
  139. if err.number <> 0 then
  140. errstr = "SetInfo failed with error " & hex(err.number) & " " &_
  141. err.description
  142. if err.number = &h800704B8 then
  143. errstr = errstr & ". Extended error: " & ActiveDir.DSGetLastError
  144. end if
  145. alert(errstr)
  146. err.clear
  147. end if
  148. end sub
  149. </SCRIPT>
  150. <form>
  151. <font face=Arial size=2>
  152. <div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
  153. <div style="position:absolute; top:0.3em; left:0em;">Work Phones*:</div>
  154. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=workphones>
  155. </div>
  156. <div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
  157. <div style="position:absolute; top:0.3em; left:0em;">FAX*:</div>
  158. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=fax>
  159. </div>
  160. <div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
  161. <div style="position:absolute; top:0.3em; left:0em;">Home Phones*:</div>
  162. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=homephones>
  163. </div>
  164. <div style="position:absolute; top:7.3em; left:0.3em; height:2em; width:29em;">
  165. <div style="position:absolute; top:0.3em; left:0em;">WWW Home Page*:</div>
  166. <INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=homepage>
  167. </div>
  168. <div style="position:absolute; top:9.6em; left:0.3em; height:2em; width:29em;">
  169. <INPUT TYPE=button value="Go To Home Page" style="position:absolute; top:0.2em; left:11.3em; height:1.8em; width:10em;" name=gotopage>
  170. </div>
  171. <div style="position:absolute; top:11.9em; left:0.3em; height:7em; width:29em;">
  172. <div style="position:absolute; top:0.3em; left:0em;">Comment:</div>
  173. <INPUT TYPE=textarea class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:6em; width:15em;" name=comment>
  174. </div>
  175. <div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
  176. </div>
  177. <div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
  178. </div>
  179. </font>
  180. </form>
  181. <SCRIPT language=vbscript>
  182. '------------------------------------------------------------------------------
  183. '
  184. ' Subroutine: gotopage_OnClick
  185. '
  186. ' Synopsis: Launch a browser instance on the user's web page.
  187. '
  188. '------------------------------------------------------------------------------
  189. sub gotopage_OnClick
  190. alert "gotopage_OnClick: " & document.forms(0).homepage.value
  191. '
  192. ' This doesn't work yet. The Trident folks say it will work by beta 2.
  193. '
  194. window.open document.forms(0).homepage.value
  195. end sub
  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 "facsimileTelephoneNumber", document.forms(0).fax.value
  207. if err.number <> 0 then
  208. alert("Put fax failed with error " & hex(err.number) & " " &_
  209. err.description)
  210. end if
  211. DsObj.Put "sn", document.forms(0).homephones.value
  212. if err.number <> 0 then
  213. alert("Put homephones failed with error " & hex(err.number) & " " &_
  214. err.description)
  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.description)
  220. end if
  221. DsObj.SetInfo
  222. if err.number <> 0 then
  223. alert("SetInfo failed with error " & hex(err.number) & " " &_
  224. err.description)
  225. end if
  226. end sub
  227. sub Filler1
  228. on error resume next
  229. DsObj.Put "", document.forms(0).fax.value
  230. if err.number <> 0 then
  231. alert("Put fax failed with error " & hex(err.number) & " " &_
  232. err.description)
  233. end if
  234. DsObj.Put "sn", document.forms(0).homephones.value
  235. if err.number <> 0 then
  236. alert("Put homephones failed with error " & hex(err.number) & " " &_
  237. err.description)
  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.description)
  243. end if
  244. DsObj.SetInfo
  245. if err.number <> 0 then
  246. alert("SetInfo failed with error " & hex(err.number) & " " &_
  247. err.description)
  248. end if
  249. end sub
  250. </SCRIPT>
  251. </BODY>
  252. </HTML>