windows-nt/Source/XPSP1/NT/admin/snapin/dsadmin/prophtml/general.htm

279 lines
6.5 KiB
HTML
Raw Normal View History

2020-09-26 03:20:57 -05:00
<!--
'------------------------------------------------------------------------------
'
' Directory Service Administration Property Pages
'
' Microsoft Windows
' Copyright (C) Microsoft Corporation, 1992 - 1997.
'
' File: general.htm
'
' Contents: General property page.
'
' History: 2-25-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>
<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.
'
'
' Object name
'
DsName = DsObj.Get("name")
if err.number <> 0 then
alert("Get name failed with error " & hex(err.number) & " " &_
err.desctiption)
err.clear
end if
set Element = document.all.item("objname", 0)
if err.number <> 0 then
alert("item(objname) failed with error " & hex(err.number) & " " &_
err.desctiption)
err.clear
end if
set NameRange = document.rangeFromElement(Element)
NameRange.pasteHTML(DsName)
set Element = nothing
set NameRange = nothing
'
' Class
'
ObjClassList = DsObj.Get("objectClass")
if err.number <> 0 then
alert("Get class failed with error " & hex(err.number) & " " &_
err.desctiption)
err.clear
end if
Const vbString = 8
if VarType(ObjClassList) = vbString then
DsClass = TrimPath(ObjClassList)
else
i = 0
for each obj in ObjClassList
DsClass = obj
if i = 0 then
if obj <> "top" then
exit for
end if
i = i + 1
end if
next
end if
set Element = document.all.item("objclass", 0)
if err.number <> 0 then
alert("item(objclass) failed with error " & hex(err.number) & " " &_
err.desctiption)
err.clear
end if
set ClassRange = document.rangeFromElement(Element)
ClassRange.pasteHTML(DsClass)
end sub
'------------------------------------------------------------------------------
'
' Subroutine: DoApply
'
' Synopsis: Set the DS object to the new control values.
'
'------------------------------------------------------------------------------
sub DoApply
end sub
</SCRIPT>
<BODY bgcolor=silver onload="DoOnLoad()">
<font face=Arial size=2>
<table rows=1 cols=2 borders=0 cellpadding=5>
<tr>
<td>
<img src=images\user.gif>
</td>
<td valign=center>
<font face=Arial size=2><span id=objname></span></font>
</td>
</tr>
</table>
<hr>
<table rows=4 cols=2 borders=0 cellpadding=0 width=100%>
<tr>
<td align=left>
<font face=Arial size=2>Type:</font>
</td>
<td align=left>
<font face=Arial size=2><span id=objclass></span></font>
</td>
</tr>
<tr>
<td align=left colspan=2>
<hr>
</td>
</tr>
<tr>
<td align=left>
<font face=Arial size=2>Creation Time:</font>
</td>
<td align=left>
<font face=Arial size=2><span id=createtime>1/1/80 12:00AM</span></font>
</td>
</tr>
<tr>
<td align=left>
<font face=Arial size=2>Last Modified:</font>
</td>
<td align=left>
<font face=Arial size=2><span id=modtime>1/1/80 12:00AM</span></font>
</td>
</tr>
</table>
</font>
<SCRIPT language=vbscript>
'------------------------------------------------------------------------------
'
' 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 "givenName", document.forms(0).firstname.value
if err.number <> 0 then
alert("Put firstname failed with error " & hex(err.number) & " " &_
err.desctiption)
end if
DsObj.Put "sn", document.forms(0).lastname.value
if err.number <> 0 then
alert("Put lastname failed with error " & hex(err.number) & " " &_
err.desctiption)
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.desctiption)
end if
DsObj.SetInfo
if err.number <> 0 then
alert("SetInfo failed with error " & hex(err.number) & " " &_
err.desctiption)
end if
end sub
sub Filler1
on error resume next
DsObj.Put "givenName", document.forms(0).firstname.value
if err.number <> 0 then
alert("Put firstname failed with error " & hex(err.number) & " " &_
err.desctiption)
end if
DsObj.Put "sn", document.forms(0).lastname.value
if err.number <> 0 then
alert("Put lastname failed with error " & hex(err.number) & " " &_
err.desctiption)
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.desctiption)
end if
DsObj.SetInfo
if err.number <> 0 then
alert("SetInfo failed with error " & hex(err.number) & " " &_
err.desctiption)
end if
end sub
</SCRIPT>
</BODY>
</HTML>