-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.asp
153 lines (143 loc) · 5.36 KB
/
index.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!-- #include file="common.asp" -->
<%
Dim dom
Dim ou
Dim cmp
dim strCell(4)
if len(request("container")) < 1 then
strContainer = strDomainRoot
else
strContainer = request("container")
end if
aryContainer = split(strContainer, ",")
strTemp = split(aryContainer(0), "=")
strOUName = strTemp(1)
%>
<TABLE WIDTH="800px" STYLE="border: 1px solid gray;" CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD WIDTH="200px" ALIGN="center" STYLE="background: #74AAD7;" VALIGN="top"><IMG SRC="iconOU.gif"></TD>
<TD WIDTH="600px" ROWSPAN=4 VALIGN="top">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" STYLE="width: 100%" COLS=1 ROWS=2>
<TR>
<TD WIDTH="100%" STYLE="background: #74AAD7; padding: 10px; width: 100%" VALIGN="top">
<SPAN STYLE="font-size: 14pt;"><%= strOUName %></SPAN><BR>
<SPAN STYLE="font-size: 10pt;">Organisational Unit</SPAN>
</TD>
</TR>
<TR>
<TD STYLE="padding-top: 5px; padding-bottom: 5px;" VALIGN="top">
<TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=0>
<%
Set dom = GetObject("LDAP://" & ldapEncode(strContainer))
For Each obj In dom
strName = mid(obj.name, instr(obj.name, "=") + 1)
strClass = obj.class
strDescription = trimDesc(obj.Description)
response.write "<TR>" & vbcrlf
select case strClass
case "organizationalUnit", "container", "builtinDomain", "lostAndFound"
strCell(0) = "<A HREF=""index.asp?container=" & MakeURL(obj.name) & "," & strContainer & """>" & strName & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case else
select case strClass
case "user"
strCell(0) = "<A HREF=""userdetails.asp?user=" & MakeURL(obj.name) & "," & strContainer & """>" & strName & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case "computer"
strCell(0) = "<A HREF=""computerdetails.asp?computer=" & MakeURL(obj.name) & "," & strContainer & """>" & strName & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case "group"
strCell(0) = "<A HREF=""groupdetails.asp?group=" & MakeURL(obj.name) & "," & strContainer & """>" & strName & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case "contact"
strCell(0) = "<A HREF=""contactdetails.asp?contact=" & MakeURL(obj.name) & "," & strContainer & """>" & strName & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case "printQueue"
aryTemp = split(strName, "-")
strTemp = ""
for count = (lbound(aryTemp) + 1) to ubound(aryTemp)
strTemp = strTemp & aryTemp(count)
if count < ubound(aryTemp) then strTemp = strTemp & "-"
next
strCell(0) = "<A HREF=""printerdetails.asp?printer=" & MakeURL(obj.Name & "," & strContainer) & """>" & strTemp & " on " & aryTemp(0) & "</A>"
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
case else
strCell(0) = strName
strCell(1) = ResolveObjectName(strClass)
strCell(2) = strDescription
end select
end select
select case strClass
case "builtinDomain","computer","container","dnsNode","group", _
"infrastructureUpdate","lostAndFound","organizationalUnit", _
"user", "printQueue", "contact"
response.write "<TD WIDTH=16 VALIGN=""top"" CLASS=""data"">" & _
"<IMG SRC=""" & strClass & ".gif"" BORDER=0></TD>"
case else
response.write "<TD WIDTH=16 VALIGN=""top"" CLASS=""data"">" & _
"<IMG SRC=""default.gif"" BORDER=0></TD>"
end select
for count = lbound(strCell) to ubound(strCell)
if len(strCell(count)) = 0 then strCell(count) = " "
if count = 0 then
response.write "<TD CLASS=""dataHead"" VALIGN=""top"">" & strCell(count) & "</TD>" & vbCrLf
else
response.write "<TD CLASS=""data"" VALIGN=""top"">" & strCell(count) & "</TD>" & vbCrLf
end if
next
response.write "</TR>" & vbcrlf
Next
Set dom = Nothing
Set obj = Nothing
Set cmp = Nothing
%>
</TABLE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD VALIGN="top" WIDTH="200px" STYLE="padding: 10px; background: #74AAD7;">
<DIV STYLE="font-size: 10pt; font-weight: bold; padding-bottom: 5px;">Tasks</DIV>
<A HREF="newUser.asp?container=<%=MakeURL(strContainer)%>">New User</A>
</TD>
</TR>
<TR>
<TD WIDTH="200px" STYLE="padding: 10px; background: #74AAD7;" VALIGN="top">
<DIV STYLE="font-size: 10pt; font-weight: bold; padding-bottom: 5px;">Parent Containers</DIV>
<A HREF="index.asp">Domain Root</A><BR>
<%
intRootComponents = ubound(split(strDomainRoot, ",")) + 1
intContainerComponents = ubound(aryContainer)
intIndent = 3
for count = intRootComponents to (intContainerComponents - 1)
aryContainerName = split(aryContainer(intContainerComponents - count), "=")
strContainerURL = ""
for count2 = (intContainerComponents - count) to intContainerComponents
strContainerURL = strContainerURL & aryContainer(count2)
if count2 < intContainerComponents then strContainerURL = strContainerURL & ","
next
for count2 = 1 to intIndent
response.write " "
next
response.write "- <A HREF=""index.asp?container=" & strContainerURL & _
""">" & aryContainerName(1) & "</A><BR>" & vbCrLf
intIndent = intIndent + 3
next
%>
</TD>
</TR>
<TR>
<TD VALIGN="top" WIDTH="200px" STYLE="padding: 10px; background: #74AAD7;">
<%WriteSearch%>
</TD>
</TR>
</TABLE>
</BODY>