| 3610 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'| |
|
|
|
5 |
'| ADMIN Page |
|
|
|
6 |
'| Build Service |
|
|
|
7 |
'| |
|
|
|
8 |
'=====================================================
|
|
|
9 |
%>
|
|
|
10 |
<%
|
|
|
11 |
Option explicit
|
|
|
12 |
' Good idea to set when using redirect
|
|
|
13 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
14 |
%>
|
|
|
15 |
<!--#include file="common/conf.asp"-->
|
|
|
16 |
<!--#include file="common/globals.asp"-->
|
|
|
17 |
<!--#include file="common/qstr.asp"-->
|
|
|
18 |
<!--#include file="common/common_subs.asp"-->
|
|
|
19 |
|
|
|
20 |
<%
|
|
|
21 |
'------------ ACCESS CONTROL ------------------
|
|
|
22 |
%>
|
|
|
23 |
<!--#include file="_access_control_general.asp"-->
|
|
|
24 |
<%
|
|
|
25 |
'------------ Variable Definition -------------
|
| 4028 |
dpurdie |
26 |
Dim parTest
|
|
|
27 |
Dim LocalPath
|
| 4246 |
dpurdie |
28 |
Dim rvRemExec
|
| 4028 |
dpurdie |
29 |
Dim rvEmail
|
|
|
30 |
Dim rvEmail1
|
| 4246 |
dpurdie |
31 |
Dim rvEmail2
|
|
|
32 |
Dim rvEvent
|
| 4028 |
dpurdie |
33 |
Dim active
|
|
|
34 |
|
| 3610 |
dpurdie |
35 |
'------------ Constants Declaration -----------
|
|
|
36 |
'------------ Variable Init -------------------
|
| 4028 |
dpurdie |
37 |
parTest = QStrPar("test")
|
| 4246 |
dpurdie |
38 |
rvRemExec = ""
|
| 4028 |
dpurdie |
39 |
rvEmail = ""
|
|
|
40 |
rvEmail1 = ""
|
| 4246 |
dpurdie |
41 |
rvEmail2 = ""
|
|
|
42 |
rvEvent = ""
|
| 4028 |
dpurdie |
43 |
active = objAccessControl.IsActive("ConfigureBuildService")
|
|
|
44 |
if NOT active Then parTest = ""
|
|
|
45 |
|
| 3610 |
dpurdie |
46 |
'----------------------------------------------
|
| 3959 |
dpurdie |
47 |
|
|
|
48 |
function testFromRegistry (strRegistryKey )
|
|
|
49 |
Dim WSHShell, value
|
|
|
50 |
|
|
|
51 |
On Error Resume Next
|
|
|
52 |
Set WSHShell = CreateObject("WScript.Shell")
|
|
|
53 |
value = WSHShell.RegRead( strRegistryKey )
|
|
|
54 |
|
|
|
55 |
testFromRegistry = NOT (err.number <> 0)
|
|
|
56 |
|
|
|
57 |
set WSHShell = nothing
|
| 4028 |
dpurdie |
58 |
end function
|
|
|
59 |
|
|
|
60 |
Function makeButton( text, test, result )
|
|
|
61 |
If result <> "" Then result = " " & result
|
|
|
62 |
If active Then
|
|
|
63 |
makeButton = " <a class=""form_btn"" href=""admin_build_test_page.asp?test="&test&""" title=""" &text& """>"&text&"</a>" & result
|
|
|
64 |
Else
|
|
|
65 |
makeButton = " <a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
|
|
|
66 |
End If
|
|
|
67 |
End Function
|
|
|
68 |
|
| 4240 |
dpurdie |
69 |
Function makeAjaxButton( text, script )
|
|
|
70 |
If active Then
|
| 4246 |
dpurdie |
71 |
makeAjaxButton = " <a id="""&script &""" href="""" class=""form_btn"" title=""" &text& """ onclick="""&script&"();return false;"">"&text&"</a>"
|
| 4240 |
dpurdie |
72 |
Else
|
| 4246 |
dpurdie |
73 |
makeAjaxButton = " <a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>"
|
| 4240 |
dpurdie |
74 |
End If
|
|
|
75 |
End Function
|
|
|
76 |
|
| 4028 |
dpurdie |
77 |
'-------------------------------------------
|
|
|
78 |
' Perform tests on request
|
|
|
79 |
'
|
|
|
80 |
If parTest = "email" Then
|
|
|
81 |
Call Send_Email ( "Release Manager Notification", adminEmail, objAccessControl.UserEmail, "Test Email", "This is a Test Email generated by the Release Manager Test.", Null )
|
|
|
82 |
rvEmail = "Sent"
|
|
|
83 |
|
|
|
84 |
ElseIf parTest = "email1" Then
|
|
|
85 |
LocalPath = Server.MapPath("images\img_reports_admin.jpg")
|
|
|
86 |
Call Send_Email ( "Release Manager Notification", adminEmail, objAccessControl.UserEmail, "Test Email", "This is a Test Email generated by the Release Manager Test. This email has an attachment", LocalPath )
|
|
|
87 |
rvEmail1 = "Sent"
|
|
|
88 |
|
| 4246 |
dpurdie |
89 |
ElseIf parTest = "email2" Then
|
|
|
90 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
91 |
rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onTestMail", 0, TRUE)
|
|
|
92 |
Set objWSH = Nothing
|
|
|
93 |
If rv = 0 Then
|
|
|
94 |
rvEmail2 = "OK"
|
|
|
95 |
Else
|
|
|
96 |
rvEmail2 = "Error ("&rv&")"
|
|
|
97 |
End IF
|
|
|
98 |
|
|
|
99 |
ElseIf parTest = "event" Then
|
|
|
100 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
101 |
rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onRaiseEvent", 0, TRUE)
|
|
|
102 |
Set objWSH = Nothing
|
|
|
103 |
If rv = 0 Then
|
|
|
104 |
rvEvent = "OK"
|
|
|
105 |
Else
|
|
|
106 |
rvEvent = "Error ("&rv&")"
|
|
|
107 |
End IF
|
|
|
108 |
|
| 4028 |
dpurdie |
109 |
ElseIf parTest = "remExec" Then
|
|
|
110 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
| 4246 |
dpurdie |
111 |
rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onTestArchiveAccess", 0, TRUE)
|
| 4028 |
dpurdie |
112 |
Set objWSH = Nothing
|
|
|
113 |
If rv = 0 Then
|
| 4246 |
dpurdie |
114 |
rvRemExec = "OK"
|
| 4028 |
dpurdie |
115 |
Else
|
| 4246 |
dpurdie |
116 |
rvRemExec = "Error ("&rv&")"
|
| 4028 |
dpurdie |
117 |
End IF
|
|
|
118 |
End If
|
|
|
119 |
|
| 3610 |
dpurdie |
120 |
%>
|
| 4240 |
dpurdie |
121 |
<script type="text/javascript" src="scripts/json2.js"></script>
|
|
|
122 |
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
|
|
|
123 |
<script type="text/javascript" charset="utf-8">
|
|
|
124 |
///////////////////////////////////////////////
|
|
|
125 |
// Function: ajaxOpr
|
|
|
126 |
// Description: Perform an ajax operation
|
| 4477 |
dpurdie |
127 |
// Args : prog - Progam to invoke
|
|
|
128 |
// args - Part of URL to pass to script
|
| 4240 |
dpurdie |
129 |
// callback - Callback on success
|
|
|
130 |
// ecall - Callback on error
|
|
|
131 |
//
|
| 4477 |
dpurdie |
132 |
function ajaxOpr(prog, args, callback, ecall)
|
| 4240 |
dpurdie |
133 |
{
|
|
|
134 |
xmlHttp=GetXmlHttpObject(function(){ ajaxOprCallback(callback, ecall);});
|
|
|
135 |
if (xmlHttp==null)
|
|
|
136 |
{
|
|
|
137 |
alert ("Your browser does not support AJAX!");
|
|
|
138 |
return;
|
|
|
139 |
}
|
| 3610 |
dpurdie |
140 |
|
| 4477 |
dpurdie |
141 |
var url = prog + "?" + args;
|
| 4240 |
dpurdie |
142 |
|
|
|
143 |
// Use async request, otherwise the spinner will not work
|
|
|
144 |
xmlHttp.open("GET",url,true); // `false` makes the request synchronous
|
|
|
145 |
xmlHttp.send(null);
|
|
|
146 |
}
|
|
|
147 |
///////////////////////////////////////////////
|
|
|
148 |
// Function: ajaxOprCallback
|
|
|
149 |
// Description: Perform an Ajax operation generic error handling
|
|
|
150 |
// Args : callback - Function to process json results
|
|
|
151 |
// Json has been decoded and is a javascript object
|
|
|
152 |
// Handle errors for the user
|
|
|
153 |
//
|
|
|
154 |
function ajaxOprCallback(callback, ecall)
|
|
|
155 |
{
|
|
|
156 |
//readyState of 4 or 'complete' represents that data has been returned
|
|
|
157 |
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
|
|
|
158 |
{
|
|
|
159 |
// alert("Got to getAllProjectKeysDone"+ xmlHttp.responseText);
|
|
|
160 |
if (xmlHttp.status !== 200) {
|
|
|
161 |
ecall('Bad Status');
|
|
|
162 |
alert("Internal AJAX error: " + xmlHttp.status);
|
|
|
163 |
}
|
|
|
164 |
else
|
|
|
165 |
{
|
|
|
166 |
// Gather the results from the callback
|
|
|
167 |
var str = xmlHttp.responseText;
|
|
|
168 |
try {
|
|
|
169 |
var myJson = JSON.parse(str);
|
|
|
170 |
//alert("ajaxOprCallback:" + str);
|
|
|
171 |
if (myJson.result != 0) {
|
|
|
172 |
ecall('Error');
|
|
|
173 |
alert("AJAX request error: " + myJson.emsgSummary);
|
|
|
174 |
}
|
|
|
175 |
else {
|
|
|
176 |
callback(myJson);
|
|
|
177 |
}
|
|
|
178 |
}
|
|
|
179 |
catch(e) {
|
| 4477 |
dpurdie |
180 |
ecall('Error');
|
|
|
181 |
alert("JSON Parse Error: " + e);
|
| 4240 |
dpurdie |
182 |
}
|
|
|
183 |
}
|
|
|
184 |
}
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
///////////////////////////////////////////////
|
|
|
188 |
// Function: jiraTest
|
|
|
189 |
// Description: Get the list of projects from the Jira Server
|
|
|
190 |
//
|
|
|
191 |
function jiraTest()
|
|
|
192 |
{
|
|
|
193 |
// Show that testing has started
|
|
|
194 |
var el = document.getElementById("jiraTest");
|
| 4399 |
dpurdie |
195 |
el.innerHTML = 'Testing';
|
| 4240 |
dpurdie |
196 |
|
| 4477 |
dpurdie |
197 |
ajaxOpr('_json_jiraIssues.asp',
|
|
|
198 |
'Opr=getAllKeys',
|
| 4399 |
dpurdie |
199 |
function(myJson){ el.innerHTML = 'Test OK'; },
|
|
|
200 |
function(txt){ el.innerHTML = "Test Failed:" + txt}
|
| 4240 |
dpurdie |
201 |
);
|
|
|
202 |
}
|
| 4477 |
dpurdie |
203 |
|
|
|
204 |
///////////////////////////////////////////////
|
|
|
205 |
// Function: zipTest
|
|
|
206 |
// Description: Test that the server can ZIP a file
|
|
|
207 |
//
|
|
|
208 |
function zipTest()
|
|
|
209 |
{
|
|
|
210 |
// Show that testing has started
|
|
|
211 |
var el = document.getElementById("zipTest");
|
|
|
212 |
el.innerHTML = 'Testing';
|
|
|
213 |
|
|
|
214 |
ajaxOpr('_json_RmTests.asp',
|
|
|
215 |
'Opr=zipTest',
|
|
|
216 |
function(myJson){ el.innerHTML = 'Test OK'; },
|
|
|
217 |
function(txt){ el.innerHTML = "Test Failed:" + txt}
|
|
|
218 |
);
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
|
| 4240 |
dpurdie |
222 |
</script>
|
| 3610 |
dpurdie |
223 |
<html>
|
|
|
224 |
<head>
|
|
|
225 |
|
|
|
226 |
<title>Admin Test Page</title>
|
|
|
227 |
|
|
|
228 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
229 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
230 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
231 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
232 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
233 |
<!-- DROPDOWN MENUS -->
|
|
|
234 |
<!--#include file="_menu_def.asp"-->
|
|
|
235 |
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
|
| 4399 |
dpurdie |
236 |
<!-- StyleSheet Extensions -->
|
|
|
237 |
<style>
|
|
|
238 |
.pagebody {margin-left:auto; margin-right:auto; width:50%;border-width: 0px;border-spacing: 2px; background-color: rgb(255, 204, 0)}
|
|
|
239 |
.pagebody td{white-space:nowrap;vertical-align: top;text-align: left;padding-left: 3px;padding-right: 3px; background: #f2f0e4}
|
|
|
240 |
.tablehdr td{background-color: rgb(255, 204, 0)}
|
|
|
241 |
</style>
|
| 3610 |
dpurdie |
242 |
</head>
|
|
|
243 |
|
|
|
244 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
|
|
|
245 |
<!-- MENU LAYERS -------------------------------------->
|
|
|
246 |
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
|
|
|
247 |
</div>
|
|
|
248 |
<!-- TIPS LAYERS -------------------------------------->
|
|
|
249 |
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div>
|
|
|
250 |
<!-- HEADER -->
|
|
|
251 |
<!--#include file="_header.asp"-->
|
| 4399 |
dpurdie |
252 |
<p>
|
|
|
253 |
<!-- Body of the page -->
|
|
|
254 |
<table class="pagebody">
|
|
|
255 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
256 |
<tr class="body_col tablehdr">
|
|
|
257 |
<td>Test</td>
|
|
|
258 |
<td>Result</td>
|
|
|
259 |
</tr>
|
| 3610 |
dpurdie |
260 |
|
| 4399 |
dpurdie |
261 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
262 |
<tr class="body_row">
|
|
|
263 |
<td>User ID</td>
|
|
|
264 |
<td><%=objAccessControl.UserId%></td>
|
| 3610 |
dpurdie |
265 |
</tr>
|
| 4399 |
dpurdie |
266 |
<tr class="body_row">
|
|
|
267 |
<td>User Name</td>
|
|
|
268 |
<td><%=objAccessControl.UserName%></td>
|
|
|
269 |
</tr>
|
|
|
270 |
<tr class="body_row">
|
|
|
271 |
<td>User Email</td>
|
|
|
272 |
<td><%=objAccessControl.UserEmail%></td>
|
|
|
273 |
</tr>
|
| 3610 |
dpurdie |
274 |
|
| 4399 |
dpurdie |
275 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
276 |
<tr class="body_row">
|
|
|
277 |
<td>DataBase Name</td>
|
|
|
278 |
<td><%=OraDatabase.DatabaseName%></td>
|
|
|
279 |
</tr>
|
| 4028 |
dpurdie |
280 |
|
| 4399 |
dpurdie |
281 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
282 |
<tr class="body_row">
|
|
|
283 |
<td>Archive Server</td>
|
|
|
284 |
<td><%=archive_server%></td>
|
|
|
285 |
</tr>
|
| 3611 |
dpurdie |
286 |
|
| 4399 |
dpurdie |
287 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
288 |
<tr class="body_row">
|
|
|
289 |
<td>Package Archive Access - Map File System</td>
|
|
|
290 |
<%
|
| 3611 |
dpurdie |
291 |
|
| 4399 |
dpurdie |
292 |
Dim objWSH,rv,result
|
|
|
293 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
294 |
rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onTestMapArchive", 0, TRUE)
|
|
|
295 |
Set objWSH = Nothing
|
|
|
296 |
If rv = 0 Then
|
|
|
297 |
result = "OK"
|
|
|
298 |
Else
|
|
|
299 |
result = "Error ("&rv&")"
|
|
|
300 |
End IF
|
| 3610 |
dpurdie |
301 |
|
| 4399 |
dpurdie |
302 |
%>
|
|
|
303 |
<td><%=result%></td>
|
|
|
304 |
</tr>
|
| 3610 |
dpurdie |
305 |
|
| 4399 |
dpurdie |
306 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
307 |
<tr class="body_row">
|
|
|
308 |
<td>Package Archive Access - Remote cmd execution</td>
|
|
|
309 |
<td><%=makeButton("Test", "remExec",rvRemExec)%></td>
|
|
|
310 |
</tr>
|
| 3959 |
dpurdie |
311 |
|
| 4399 |
dpurdie |
312 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
313 |
<tr class="body_row">
|
|
|
314 |
<%
|
|
|
315 |
Dim sKey1, sKey2, sValue1, sValue2, kFragment
|
|
|
316 |
kFragment = "rsa2@22:" & archive_server
|
|
|
317 |
sKey1 = "HKEY_USERS\S-1-5-20\Software\SimonTatham\PuTTY\SshHostKeys\" & kFragment
|
|
|
318 |
sKey2 = "HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys\" & kFragment
|
|
|
319 |
sValue1 = testFromRegistry(sKey1)
|
|
|
320 |
sValue2 = testFromRegistry(sKey2)
|
|
|
321 |
%>
|
|
|
322 |
<td>Plink Key [<%=sKey1%>]</td>
|
|
|
323 |
<td><%=sValue1%></td>
|
|
|
324 |
</tr>
|
|
|
325 |
<tr class="body_row">
|
|
|
326 |
<td>Plink Key [<%=sKey2%>]</td>
|
|
|
327 |
<td><%=sValue2%></td>
|
|
|
328 |
</tr>
|
|
|
329 |
|
|
|
330 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
331 |
<tr class="body_row">
|
| 4477 |
dpurdie |
332 |
<td>Zip File</td>
|
|
|
333 |
<td><%=makeAjaxButton("Test", "zipTest")%></td>
|
|
|
334 |
</tr>
|
|
|
335 |
|
|
|
336 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
337 |
<tr class="body_row">
|
| 4399 |
dpurdie |
338 |
<td>Email Server</td>
|
|
|
339 |
<td><%=MAIL_SERVER%></td>
|
|
|
340 |
</tr>
|
|
|
341 |
<tr class="body_row">
|
|
|
342 |
<td>Admin Email</td>
|
|
|
343 |
<td><%=adminEmail%></td>
|
|
|
344 |
</tr>
|
|
|
345 |
<tr class="body_row">
|
|
|
346 |
<td>Send Email</td>
|
|
|
347 |
<td><%=makeButton("eMail", "email",rvEmail)%></td>
|
|
|
348 |
</tr>
|
|
|
349 |
<tr class="body_row">
|
|
|
350 |
<td>Send Email With attachment</td>
|
|
|
351 |
<td><%=makeButton("eMail", "email1",rvEmail1)%></td>
|
|
|
352 |
</tr>
|
|
|
353 |
<tr class="body_row">
|
|
|
354 |
<td>Send Email from WSH script</td>
|
|
|
355 |
<td><%=makeButton("eMail", "email2",rvEmail2)%></td>
|
|
|
356 |
</tr>
|
| 4246 |
dpurdie |
357 |
|
| 4399 |
dpurdie |
358 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
359 |
<tr class="body_row">
|
|
|
360 |
<td>Generate error event</td>
|
|
|
361 |
<td><%=makeButton("event", "event",rvEvent)%></td>
|
|
|
362 |
</tr>
|
| 3611 |
dpurdie |
363 |
|
| 4246 |
dpurdie |
364 |
|
| 4399 |
dpurdie |
365 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
366 |
<tr class="body_row">
|
|
|
367 |
<td>Jira Server</td>
|
|
|
368 |
<td><%=JIRA_URL%></td>
|
|
|
369 |
</tr>
|
|
|
370 |
<tr class="body_row">
|
|
|
371 |
<td>Jira Test</td>
|
|
|
372 |
<td><%=makeAjaxButton("Test", "jiraTest")%></td>
|
|
|
373 |
</tr>
|
| 4246 |
dpurdie |
374 |
|
| 4399 |
dpurdie |
375 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
376 |
<tr class="body_col tablehdr">
|
|
|
377 |
<td>End of Tests</td>
|
|
|
378 |
<td><a class="form_btn" href="admin_build_test_page.asp" title="Refresh Page">Refresh</a></td>
|
|
|
379 |
</tr>
|
|
|
380 |
|
|
|
381 |
</table>
|
|
|
382 |
<input type="hidden" name="action" value="true">
|
|
|
383 |
<p>
|
| 3610 |
dpurdie |
384 |
</body>
|
|
|
385 |
</html>
|
|
|
386 |
<!-- FOOTER -->
|
|
|
387 |
<!--#include file="_footer.asp"-->
|
|
|
388 |
<%
|
|
|
389 |
Call Destroy_All_Objects
|
|
|
390 |
%>
|