Subversion Repositories DevTools

Rev

Rev 3866 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                ADMIN Page                         |
'|               Build Service                       |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->

<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parTest
Dim LocalPath
Dim remExecRv
Dim rvEmail
Dim rvEmail1
Dim active

'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parTest = QStrPar("test")
remExecRv = ""
rvEmail = ""
rvEmail1 = ""
active = objAccessControl.IsActive("ConfigureBuildService")
if NOT active Then parTest = ""

'----------------------------------------------

function testFromRegistry (strRegistryKey )
    Dim WSHShell, value

    On Error Resume Next
    Set WSHShell = CreateObject("WScript.Shell")
    value = WSHShell.RegRead( strRegistryKey )

    testFromRegistry = NOT (err.number <> 0)

    set WSHShell = nothing
end function

Function makeButton( text, test, result )
    If result <> "" Then result = "&nbsp;" & result
    If active Then
        makeButton = "&nbsp;&nbsp;<a class=""form_btn"" href=""admin_build_test_page.asp?test="&test&""" title=""" &text& """>"&text&"</a>" & result
    Else
        makeButton = "&nbsp;&nbsp;<a class=""form_btn_disabled"" title=""" &text& """>"&text&"</a>" & result
    End If
End Function

'-------------------------------------------
' Perform tests on request
'
If parTest = "email" Then
    Call Send_Email ( "Release Manager Notification", adminEmail, objAccessControl.UserEmail, "Test Email", "This is a Test Email generated by the Release Manager Test.", Null )
    rvEmail = "Sent"

ElseIf parTest = "email1" Then
    LocalPath = Server.MapPath("images\img_reports_admin.jpg")
    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 )
    rvEmail1 = "Sent"

ElseIf parTest = "remExec" Then
    Set objWSH = Server.CreateObject("WScript.Shell")
    rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Tools.wsf //job:onTestArchiveAccess", 0, TRUE)
    Set objWSH = Nothing
    If rv = 0 Then
        remExecRv = "OK"
    Else
        remExecRv = "Error ("&rv&")"
    End IF
End If

%>

<html>
<head>

<title>Admin Test Page</title>

<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- MENU LAYERS -------------------------------------->
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
</div>
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!-- HEADER -->
<!--#include file="_header.asp"-->

   <%
   '-- FROM START ---------------------------------------------------------------------------------------------------------
   %>
   <tr>
      <td background="images/bg_login.gif">
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td><%=ProgressBar%></td>
               <td align="right">&nbsp;          </td>
            </tr>
         </table>
      </td>
   </tr>
   <tr>
      <td>
         <table style="margin-left:auto; margin-right:auto; width:50%"  border="0" cellpadding="0" cellspacing="2" bgcolor="#FFCC00">
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap class="body_col">Test</td>
               <td valign="top" nowrap class="body_col">Result</td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">User ID</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=objAccessControl.UserId%></td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=objAccessControl.UserName%></td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">User Email</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=objAccessControl.UserEmail%></td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">DataBase Name</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=OraDatabase.DatabaseName%></td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Archive Server</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=archive_server%></td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Archive Access - Map File System</td>
            <%

            Dim objWSH,rv,result
            Set objWSH = Server.CreateObject("WScript.Shell")
            rv = objWSH.Run ("cmd.exe /c cscript.exe //B //NoLogo " & rootPath & SCRIPTS_FOLDER & "\Admin_Tools.wsf //job:onTestMapArchive", 0, TRUE)
            Set objWSH = Nothing
            If rv = 0 Then
                result = "OK"
            Else
                result = "Error ("&rv&")"
            End IF

            %>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=result%></td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
            <%
                Dim sKey1, sKey2, sValue1, sValue2, kFragment
                kFragment = "rsa2@22:" & archive_server
                sKey1 = "HKEY_USERS\S-1-5-20\Software\SimonTatham\PuTTY\SshHostKeys\" & kFragment
                sKey2 = "HKEY_USERS\.DEFAULT\Software\SimonTatham\PuTTY\SshHostKeys\" & kFragment
                sValue1 = testFromRegistry(sKey1)
                sValue2 = testFromRegistry(sKey2)
            %>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Plink Key [<%=sKey1%>]</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=sValue1%></td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Plink Key [<%=sKey2%>]</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=sValue2%></td>
            </tr>
            
            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Archive Access - Remote cmd execution</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">
                    <%=makeButton("Test", "remExec",remExecRv)%>
                </td>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Email Server</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=MAIL_SERVER%></td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Admin Email</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col"><%=adminEmail%></td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Send Email</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">
                    <%=makeButton("eMail", "email",rvEmail)%>
              </td>
            </tr>
            <tr>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Send Email With attachment</td>
               <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">
                    <%=makeButton("eMail", "email1",rvEmail1)%>
            </tr>

            <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
            <tr>
               <td valign="top" nowrap class="body_col">End of Tests</td>
               <td><a class="form_btn" href="admin_build_test_page.asp" title="Refresh Page">Refresh</a></td>
            </tr>
            
         </table>
      </td>
  </tr>
  <input type="hidden" name="action" value="true">
  <p>
</body>
</html>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
<%
Call Destroy_All_Objects
%>