317 lines
9.2 KiB
HTML
317 lines
9.2 KiB
HTML
|
<!--
|
||
|
'------------------------------------------------------------------------------
|
||
|
'
|
||
|
' Directory Service Administration Property Pages
|
||
|
'
|
||
|
' Microsoft Windows
|
||
|
' Copyright (C) Microsoft Corporation, 1992 - 1997.
|
||
|
'
|
||
|
' File: usrcon.htm
|
||
|
'
|
||
|
' Contents: User Contact property page.
|
||
|
'
|
||
|
' History: 2-21-97 ericb created.
|
||
|
'
|
||
|
'------------------------------------------------------------------------------
|
||
|
-->
|
||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<META http-equiv=Content-Type content="text/html; charset=ANSI_X3.4-1968">
|
||
|
</HEAD>
|
||
|
|
||
|
<BODY bgcolor=silver onload="DoOnLoad()">
|
||
|
|
||
|
<OBJECT ID=ActiveDir CLASSID="Clsid:0998BB05-DFFD-11CF-927F-00AA00688A38">
|
||
|
</OBJECT>
|
||
|
|
||
|
<SCRIPT language=vbscript>
|
||
|
dim DsObj
|
||
|
|
||
|
'------------------------------------------------------------------------------
|
||
|
'
|
||
|
' Subroutine: DoOnLoad
|
||
|
'
|
||
|
' Synopsis: Bind to the DS object and set the initial control values.
|
||
|
'
|
||
|
'------------------------------------------------------------------------------
|
||
|
sub DoOnLoad
|
||
|
on error resume next
|
||
|
|
||
|
'
|
||
|
' Extract the object path from the URL params. This assumes that
|
||
|
' path= immediatly follows the ?
|
||
|
'
|
||
|
strUrl = document.URL
|
||
|
|
||
|
URLlen = len(strUrl)
|
||
|
i = InStr(strUrl, "?")
|
||
|
i = InStr(i, strUrl, "=")
|
||
|
EncodedPath = right(strUrl, URLlen - i)
|
||
|
|
||
|
err.clear
|
||
|
|
||
|
path = ActiveDir.DecodeURL((EncodedPath))
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("ActiveDir.DecodeURL failed with error " & hex(err.number) &_
|
||
|
" " & err.description)
|
||
|
exit sub
|
||
|
end if
|
||
|
|
||
|
'
|
||
|
' Activate the object.
|
||
|
'
|
||
|
set DsObj = ActiveDir.DSGetObject((path))
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("ActiveDir.DSGetObject failed with error " & hex(err.number) &_
|
||
|
" " & err.description)
|
||
|
exit sub
|
||
|
end if
|
||
|
|
||
|
'
|
||
|
' Get the object attributes for this page.
|
||
|
'
|
||
|
document.forms(0).workphones.value = DsObj.Get("telephoneNumber")
|
||
|
|
||
|
if (err.number <> 0) and (err.number <> &h8000500D) then
|
||
|
alert("Get workphones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
document.forms(0).fax.value = DsObj.Get("facsimileTelephoneNumber")
|
||
|
|
||
|
if (err.number <> 0) and (err.number <> &h8000500D) then
|
||
|
alert("Get fax failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
document.forms(0).homephones.value = DsObj.Get("homePhone")
|
||
|
|
||
|
if (err.number <> 0) and (err.number <> &h8000500D) then
|
||
|
alert("Get homephones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
document.forms(0).homepage.value = DsObj.Get("url")
|
||
|
|
||
|
if (err.number <> 0) and (err.number <> &h8000500D) then
|
||
|
alert("Get homepage failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
document.forms(0).comment.value = DsObj.Get("comment")
|
||
|
|
||
|
if (err.number <> 0) and (err.number <> &h8000500D) then
|
||
|
alert("Get comment failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
end sub
|
||
|
|
||
|
'------------------------------------------------------------------------------
|
||
|
'
|
||
|
' Subroutine: DoApply
|
||
|
'
|
||
|
' Synopsis: Set the DS object to the new control values.
|
||
|
'
|
||
|
'------------------------------------------------------------------------------
|
||
|
sub DoApply
|
||
|
on error resume next
|
||
|
|
||
|
' Multi-valued
|
||
|
'DsObj.Put "telephoneNumber", (document.forms(0).workphones.value)
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put workphones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
' Multi-valued
|
||
|
'DsObj.Put "facsimileTelephoneNumber", (document.forms(0).fax.value)
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put fax failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
' Multi-valued
|
||
|
'DsObj.Put "homePhone", (document.forms(0).homephones.value)
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homephones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
' Multi-valued
|
||
|
'DsObj.Put "url", (document.forms(0).homepage.value)
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homepage failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
DsObj.Put "comment", (document.forms(0).comment.value)
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put comment failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
err.clear
|
||
|
end if
|
||
|
|
||
|
DsObj.SetInfo
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
errstr = "SetInfo failed with error " & hex(err.number) & " " &_
|
||
|
err.description
|
||
|
if err.number = &h800704B8 then
|
||
|
errstr = errstr & ". Extended error: " & ActiveDir.DSGetLastError
|
||
|
end if
|
||
|
alert(errstr)
|
||
|
err.clear
|
||
|
end if
|
||
|
end sub
|
||
|
</SCRIPT>
|
||
|
|
||
|
<form>
|
||
|
<font face=Arial size=2>
|
||
|
|
||
|
<div style="position:absolute; top:0.4em; left:0.3em; height:2em; width:29em;">
|
||
|
<div style="position:absolute; top:0.3em; left:0em;">Work Phones*:</div>
|
||
|
<INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=workphones>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:2.7em; left:0.3em; height:2em; width:29em;">
|
||
|
<div style="position:absolute; top:0.3em; left:0em;">FAX*:</div>
|
||
|
<INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=fax>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:5em; left:0.3em; height:2em; width:29em;">
|
||
|
<div style="position:absolute; top:0.3em; left:0em;">Home Phones*:</div>
|
||
|
<INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=homephones>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:7.3em; left:0.3em; height:2em; width:29em;">
|
||
|
<div style="position:absolute; top:0.3em; left:0em;">WWW Home Page*:</div>
|
||
|
<INPUT TYPE=text class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:1.6em; width:15em;" name=homepage>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:9.6em; left:0.3em; height:2em; width:29em;">
|
||
|
<INPUT TYPE=button value="Go To Home Page" style="position:absolute; top:0.2em; left:11.3em; height:1.8em; width:10em;" name=gotopage>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:11.9em; left:0.3em; height:7em; width:29em;">
|
||
|
<div style="position:absolute; top:0.3em; left:0em;">Comment:</div>
|
||
|
<INPUT TYPE=textarea class=PageInput value="" style="position:absolute; top:0.2em; left:9em; height:6em; width:15em;" name=comment>
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:16.5em; left:0.3em; height:2em; width:29em;">
|
||
|
</div>
|
||
|
|
||
|
<div style="position:absolute; top:19.5em; left:0.3em; height:2em; width:29em;">
|
||
|
</div>
|
||
|
|
||
|
</font>
|
||
|
</form>
|
||
|
|
||
|
<SCRIPT language=vbscript>
|
||
|
'------------------------------------------------------------------------------
|
||
|
'
|
||
|
' Subroutine: gotopage_OnClick
|
||
|
'
|
||
|
' Synopsis: Launch a browser instance on the user's web page.
|
||
|
'
|
||
|
'------------------------------------------------------------------------------
|
||
|
sub gotopage_OnClick
|
||
|
alert "gotopage_OnClick: " & document.forms(0).homepage.value
|
||
|
'
|
||
|
' This doesn't work yet. The Trident folks say it will work by beta 2.
|
||
|
'
|
||
|
window.open document.forms(0).homepage.value
|
||
|
end sub
|
||
|
|
||
|
'------------------------------------------------------------------------------
|
||
|
'
|
||
|
' Subroutine: Filler
|
||
|
'
|
||
|
' Synopsis: This is here only as a work around for the display bug in the
|
||
|
' layout engine.
|
||
|
'
|
||
|
'------------------------------------------------------------------------------
|
||
|
sub Filler
|
||
|
on error resume next
|
||
|
|
||
|
DsObj.Put "facsimileTelephoneNumber", document.forms(0).fax.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put fax failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.Put "sn", document.forms(0).homephones.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homephones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.Put "url", document.forms(0).homepage.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homepage failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.SetInfo
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("SetInfo failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
end sub
|
||
|
sub Filler1
|
||
|
on error resume next
|
||
|
|
||
|
DsObj.Put "", document.forms(0).fax.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put fax failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.Put "sn", document.forms(0).homephones.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homephones failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.Put "url", document.forms(0).homepage.value
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("Put homepage failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
|
||
|
DsObj.SetInfo
|
||
|
|
||
|
if err.number <> 0 then
|
||
|
alert("SetInfo failed with error " & hex(err.number) & " " &_
|
||
|
err.description)
|
||
|
end if
|
||
|
end sub
|
||
|
|
||
|
</SCRIPT>
|
||
|
|
||
|
</BODY>
|
||
|
</HTML>
|