Subversion Repositories DevTools

Rev

Rev 4481 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4481 Rev 4482
Line 21... Line 21...
21
'------------ ACCESS CONTROL ------------------
21
'------------ ACCESS CONTROL ------------------
22
%>
22
%>
23
<!--#include file="_access_control_general.asp"-->
23
<!--#include file="_access_control_general.asp"-->
24
<%
24
<%
25
'------------ Variable Definition -------------
25
'------------ Variable Definition -------------
26
Dim parTest
-
 
27
Dim LocalPath
-
 
28
Dim rvRemExec
-
 
29
Dim rvEmail
-
 
30
Dim rvEmail1
-
 
31
Dim rvEmail2
-
 
32
Dim rvEvent
-
 
33
Dim active
26
Dim active
34
 
27
 
35
'------------ Constants Declaration -----------
28
'------------ Constants Declaration -----------
36
'------------ Variable Init -------------------
29
'------------ Variable Init -------------------
37
parTest = QStrPar("test")
-
 
38
rvRemExec = ""
-
 
39
rvEmail = ""
-
 
40
rvEmail1 = ""
-
 
41
rvEmail2 = ""
-
 
42
rvEvent = ""
-
 
43
active = objAccessControl.IsActive("ConfigureBuildService")
30
active = objAccessControl.IsActive("ConfigureBuildService")
44
if NOT active Then parTest = ""
-
 
45
 
31
 
46
'----------------------------------------------
32
'----------------------------------------------
47
 
33
 
48
function testFromRegistry (strRegistryKey )
34
function testFromRegistry (strRegistryKey )
49
    Dim WSHShell, value
35
    Dim WSHShell, value
Line 55... Line 41...
55
    testFromRegistry = NOT (err.number <> 0)
41
    testFromRegistry = NOT (err.number <> 0)
56
 
42
 
57
    set WSHShell = nothing
43
    set WSHShell = nothing
58
end function
44
end function
59
 
45
 
60
Function makeButton( text, test, result )
-
 
61
    If result <> "" Then result = "&nbsp;" & result
-
 
62
    If active Then
-
 
63
        makeButton = "&nbsp;&nbsp;<a class=""form_btn"" href=""admin_build_test_page.asp?test="&test&""" title=""" &text& """>"&text&"</a>" & result
-
 
64
    Else
-
 
65
        makeButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
-
 
66
    End If
-
 
67
End Function
-
 
68
 
-
 
69
Function makeAjaxButton( text, script )
46
Function makeAjaxButton( text, script )
70
    If active Then
47
    If active Then
71
        makeAjaxButton = "&nbsp;&nbsp;<a id="""&script &""" href="""" class=""form_btn"" title=""" &text& """ onclick="""&script&"();return false;"">"&text&"</a>"
48
        makeAjaxButton = "&nbsp;&nbsp;<a id="""&script &""" href="""" class=""form_btn"" title=""" &text& """ onclick="""&script&"();return false;"">"&text&"</a>"
72
    Else
49
    Else
73
        makeAjaxButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>"
50
        makeAjaxButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>"
74
    End If
51
    End If
75
End Function
52
End Function
76
 
53
 
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
 
-
 
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
 
-
 
109
ElseIf parTest = "remExec" Then
-
 
110
    rvRemExec = "Testing"
-
 
111
    Set objWSH = Server.CreateObject("WScript.Shell")
-
 
112
    rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onTestArchiveAccess", 0, TRUE)
-
 
113
    Set objWSH = Nothing
-
 
114
    If rv = 0 Then
-
 
115
        rvRemExec = "OK"
-
 
116
    Else
-
 
117
        rvRemExec = "Error ("&rv&")"
-
 
118
    End IF
-
 
119
End If
-
 
120
 
-
 
121
%>
54
%>
122
<script type="text/javascript" src="scripts/json2.js"></script>
55
<script type="text/javascript" src="scripts/json2.js"></script>
123
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
56
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
124
<script type="text/javascript" charset="utf-8">
57
<script type="text/javascript" charset="utf-8">
125
///////////////////////////////////////////////
58
///////////////////////////////////////////////
Line 130... Line 63...
130
//                  callback    - Callback on success
63
//                  callback    - Callback on success
131
//                  ecall       - Callback on error            
64
//                  ecall       - Callback on error            
132
//
65
//
133
function ajaxOpr(prog, args, callback, ecall)
66
function ajaxOpr(prog, args, callback, ecall)
134
{
67
{
-
 
68
    var xmlHttp 
135
    xmlHttp=GetXmlHttpObject(function(){ ajaxOprCallback(callback, ecall);});
69
    xmlHttp=GetXmlHttpObject(function(){ ajaxOprCallback(xmlHttp,callback, ecall);});
136
    if (xmlHttp==null)
70
    if (xmlHttp==null)
137
    {
71
    {
138
      alert ("Your browser does not support AJAX!");
72
      alert ("Your browser does not support AJAX!");
139
      return;
73
      return;
140
    }
74
    }
Line 146... Line 80...
146
    xmlHttp.send(null);
80
    xmlHttp.send(null);
147
}
81
}
148
///////////////////////////////////////////////
82
///////////////////////////////////////////////
149
//  Function:    ajaxOprCallback
83
//  Function:    ajaxOprCallback
150
//  Description: Perform an Ajax operation generic error handling
84
//  Description: Perform an Ajax operation generic error handling
-
 
85
//  Args       :    xmlHttp  - Ajax Object
151
//  Args       : callback - Function to process json results
86
//                  callback - Function to process json results
152
//                          Json has been decoded and is a javascript object
87
//                             Json has been decoded and is a javascript object
153
//                          Handle errors for the user
88
//                             Handle errors for the user
-
 
89
//                  ecall    - Function called on error. 
-
 
90
//                             User should indicate failure
-
 
91
//                             This function will issue an alert for the caller
154
//
92
//
155
function ajaxOprCallback(callback, ecall)
93
function ajaxOprCallback(xmlHttp,callback, ecall)
156
{
94
{
157
    //readyState of 4 or 'complete' represents that data has been returned
95
    //readyState of 4 or 'complete' represents that data has been returned
158
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
96
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
159
    {
97
    {
160
        // alert("Got to getAllProjectKeysDone"+ xmlHttp.responseText);
98
        // alert("Got to getAllProjectKeysDone"+ xmlHttp.responseText);
Line 217... Line 155...
217
            function(myJson){ el.innerHTML = 'Test OK'; },
155
            function(myJson){ el.innerHTML = 'Test OK'; },
218
            function(txt){ el.innerHTML = "Test Failed:" + txt}
156
            function(txt){ el.innerHTML = "Test Failed:" + txt}
219
           );
157
           );
220
}
158
}
221
 
159
 
-
 
160
///////////////////////////////////////////////
-
 
161
//  Function:       eventTest   
-
 
162
//  Description:    Test that the server can send an Event
-
 
163
//
-
 
164
function eventTest()
-
 
165
{
-
 
166
    //  Show that testing has started
-
 
167
    var el = document.getElementById("eventTest");
-
 
168
    el.innerHTML = 'Sending';
-
 
169
 
-
 
170
    ajaxOpr('_json_RmTests.asp',
-
 
171
            'Opr=eventTest', 
-
 
172
            function(myJson){ el.innerHTML = 'Sent OK'; },
-
 
173
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
174
           );
-
 
175
}
-
 
176
 
-
 
177
///////////////////////////////////////////////
-
 
178
//  Function:       emailTest   
-
 
179
//  Description:    Test that the server can send an email
-
 
180
//
-
 
181
function emailTest()
-
 
182
{
-
 
183
    //  Show that testing has started
-
 
184
    var el = document.getElementById("emailTest");
-
 
185
    el.innerHTML = 'Sending';
-
 
186
 
-
 
187
    ajaxOpr('_json_RmTests.asp',
-
 
188
            'Opr=emailTest', 
-
 
189
            function(myJson){ el.innerHTML = 'Sent OK'; },
-
 
190
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
191
           );
-
 
192
}
-
 
193
///////////////////////////////////////////////
-
 
194
//  Function:       emailTest1   
-
 
195
//  Description:    Test that the server can send an email with an attachment
-
 
196
//
-
 
197
function emailTest1()
-
 
198
{
-
 
199
    //  Show that testing has started
-
 
200
    var el = document.getElementById("emailTest1");
-
 
201
    el.innerHTML = 'Sending';
-
 
202
 
-
 
203
    ajaxOpr('_json_RmTests.asp',
-
 
204
            'Opr=emailTest&Mode=Attach', 
-
 
205
            function(myJson){ el.innerHTML = 'Sent OK'; },
-
 
206
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
207
           );
-
 
208
}
-
 
209
 
-
 
210
///////////////////////////////////////////////
-
 
211
//  Function:       emailTest2
-
 
212
//  Description:    Test that the server can send an email from a WSH script
-
 
213
//
-
 
214
function emailTest2()
-
 
215
{
-
 
216
    //  Show that testing has started
-
 
217
    var el = document.getElementById("emailTest2");
-
 
218
    el.innerHTML = 'Sending';
-
 
219
 
-
 
220
    ajaxOpr('_json_RmTests.asp',
-
 
221
            'Opr=emailWshTest', 
-
 
222
            function(myJson){ el.innerHTML = 'Sent OK'; },
-
 
223
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
224
           );
-
 
225
}
-
 
226
 
-
 
227
///////////////////////////////////////////////
-
 
228
//  Function:       remExec
-
 
229
//  Description:    Test Remote Execution (Wsh)
-
 
230
//
-
 
231
function remExec()
-
 
232
{
-
 
233
    //  Show that testing has started
-
 
234
    var el = document.getElementById("remExec");
-
 
235
    el.innerHTML = 'Testing';
-
 
236
 
-
 
237
    ajaxOpr('_json_RmTests.asp',
-
 
238
            'Opr=remExecTest', 
-
 
239
            function(myJson){ el.innerHTML = 'Test OK'; },
-
 
240
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
241
           );
-
 
242
}
-
 
243
 
-
 
244
///////////////////////////////////////////////
-
 
245
//  Function:       pkgAccess
-
 
246
//  Description:    Test Remote Execution (Wsh)
-
 
247
//
-
 
248
function pkgAccess()
-
 
249
{
-
 
250
    //  Show that testing has started
-
 
251
    var el = document.getElementById("pkgAccess");
-
 
252
    el.innerHTML = 'Testing';
-
 
253
 
-
 
254
    ajaxOpr('_json_RmTests.asp',
-
 
255
            'Opr=pkgAccessTest', 
-
 
256
            function(myJson){ el.innerHTML = 'Test OK'; },
-
 
257
            function(txt){ el.innerHTML = "Test Failed:" + txt}
-
 
258
           );
-
 
259
}
222
 
260
 
223
</script>
261
</script>
224
<html>
262
<html>
225
<head>
263
<head>
226
 
264
 
Line 286... Line 324...
286
   </tr>
324
   </tr>
287
 
325
 
288
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
326
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
289
   <tr class="body_row">
327
   <tr class="body_row">
290
      <td>Package Archive Access - Map File System</td>
328
      <td>Package Archive Access - Map File System</td>
291
   <%
-
 
292
 
-
 
293
   Dim objWSH,rv,result
-
 
294
   Set objWSH = Server.CreateObject("WScript.Shell")
-
 
295
   rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Test.wsf //job:onTestMapArchive", 0, TRUE)
-
 
296
   Set objWSH = Nothing
-
 
297
   If rv = 0 Then
-
 
298
       result = "OK"
-
 
299
   Else
-
 
300
       result = "Error ("&rv&")"
-
 
301
   End IF
-
 
302
 
-
 
303
   %>
-
 
304
      <td><%=result%></td>
329
      <td><%=makeAjaxButton("Test", "pkgAccess")%></td>
305
   </tr>
330
   </tr>
306
 
331
 
307
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
332
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
308
   <tr class="body_row">
333
   <tr class="body_row">
309
      <td>Package Archive Access - Remote cmd execution</td>
334
      <td>Package Archive Access - Remote cmd execution</td>
310
      <td><%=makeButton("Test", "remExec",rvRemExec)%></td>
335
      <td><%=makeAjaxButton("Test", "remExec")%></td>
311
   </tr>
336
   </tr>
312
 
337
 
313
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
338
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
314
   <tr class="body_row">
339
   <tr class="body_row">
315
   <%
340
   <%
Line 343... Line 368...
343
      <td>Admin Email</td>
368
      <td>Admin Email</td>
344
      <td><%=adminEmail%></td>
369
      <td><%=adminEmail%></td>
345
   </tr>
370
   </tr>
346
   <tr class="body_row">
371
   <tr class="body_row">
347
      <td>Send Email</td>
372
      <td>Send Email</td>
348
      <td><%=makeButton("eMail", "email",rvEmail)%></td>
373
      <td><%=makeAjaxButton("eMail", "emailTest")%></td>
349
   </tr>
374
   </tr>
350
   <tr class="body_row">
375
   <tr class="body_row">
351
      <td>Send Email With attachment</td>
376
      <td>Send Email With attachment</td>
352
      <td><%=makeButton("eMail", "email1",rvEmail1)%></td>
377
      <td><%=makeAjaxButton("eMail", "emailTest1")%></td>
353
   </tr>
378
   </tr>
354
   <tr class="body_row">
379
   <tr class="body_row">
355
     <td>Send Email from WSH script</td>
380
     <td>Send Email from WSH script</td>
356
     <td><%=makeButton("eMail", "email2",rvEmail2)%></td>
381
     <td><%=makeAjaxButton("eMail", "emailTest2")%></td>
357
   </tr>
382
   </tr>
358
 
383
 
359
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
384
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
360
   <tr class="body_row">
385
   <tr class="body_row">
361
    <td>Generate error event</td>
386
    <td>Generate error event</td>
362
    <td><%=makeButton("event", "event",rvEvent)%></td>
387
    <td><%=makeAjaxButton("Event", "eventTest")%></td>
363
   </tr>
388
   </tr>
364
 
389
 
365
 
-
 
366
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
390
   <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
367
   <tr class="body_row">
391
   <tr class="body_row">
368
      <td>Jira Server</td>
392
      <td>Jira Server</td>
369
      <td><%=JIRA_URL%></td>
393
      <td><%=JIRA_URL%></td>
370
   </tr>
394
   </tr>