Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
7.8 KiB

  1. <%@ Language=VBScript %>
  2. <% '==================================================
  3. ' Microsoft Server Appliance
  4. '
  5. ' Alert Viewer for Async Task Failure
  6. ' Alert Log: svrapp
  7. ' Alert ID:
  8. '
  9. ' Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved.
  10. '================================================== %>
  11. <% Option Explicit %>
  12. <!-- #include file="../sh_page.asp" -->
  13. <!-- #include file="../tabbar.asp" -->
  14. <%
  15. Dim strCookie
  16. Dim rc
  17. Dim mstrLinkURL
  18. Dim mstrMethod
  19. Dim mstrReturnURL
  20. On Error Resume Next
  21. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  22. strSourceName = "sakitmsg.dll"
  23. if Err.number <> 0 then
  24. Response.Write "Error in localizing the web content "
  25. Response.End
  26. end if
  27. '-----------------------------------------------------
  28. 'START of localization content
  29. Dim L_ALERTLBL_TEXT
  30. Dim L_CLEARALERT_TEXT
  31. Dim L_CLEARDESC_TEXT
  32. L_ALERTLBL_TEXT = objLocMgr.GetString(strSourceName, "&H40010029",varReplacementStrings)
  33. L_CLEARALERT_TEXT = objLocMgr.GetString(strSourceName, "&H4001002A",varReplacementStrings)
  34. L_CLEARDESC_TEXT = objLocMgr.GetString(strSourceName, "&H4001002B",varReplacementStrings)
  35. 'End of localization content
  36. '-----------------------------------------------------
  37. mstrMethod = Request.Form("Method") 'framework variable
  38. mstrReturnURL = Request("ReturnURL") 'framework variable, used in Redirect()
  39. mstrLinkURL = Request.Form("LinkURL")
  40. strCookie = Request("Cookie")
  41. If strCookie = "" Then ServeClose
  42. Select Case mstrMethod
  43. Case "CLEAR"
  44. rc = ClearAlert(strCookie)
  45. response.Redirect mstrReturnURL
  46. Case "LAUNCH"
  47. rc = ClearAlert(strCookie)
  48. response.Redirect mstrLinkURL
  49. Case "CLOSE"
  50. response.Redirect mstrReturnURL
  51. Case Else
  52. ServePage(strCookie)
  53. End Select
  54. '----------------------------------------------------------------------------
  55. '
  56. ' Function : ServePage
  57. '
  58. ' Synopsis : Serves alert information for async tasks
  59. '
  60. ' Arguments: Cookie - the alert cookie
  61. '
  62. ' Returns : Nothing
  63. '
  64. '+----------------------------------------------------------------------------
  65. Sub ServePage(Cookie)
  66. Dim objAlert
  67. Dim objElementCol
  68. Dim objElement
  69. Dim objLocMgr
  70. Dim strAlertSrc
  71. Dim intAlertID
  72. Dim intAlertType
  73. Dim intCaptionID
  74. Dim intDescriptionID
  75. Dim strCaption
  76. Dim strDescription
  77. Dim strElementID
  78. Dim varReplacementStrings
  79. Dim varReplacementStringsNone
  80. Dim strFailedTaskName
  81. Dim strFailedTaskURL
  82. Dim objElements
  83. Dim objItem
  84. Dim arrTitle
  85. Dim arrURL
  86. Dim arrHelpText
  87. Dim blnEnabled
  88. Dim i
  89. On Error Resume Next
  90. Set objAlert = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Alert.Cookie=" & Cookie )
  91. strAlertSrc = objAlert.AlertLog
  92. intAlertID = objAlert.AlertID
  93. intAlertType = objAlert.AlertType
  94. strElementID = strAlertSrc & Hex(intAlertID)
  95. Set objElementCol = GetElements("AlertDefinitions")
  96. Set objElement = objElementCol.Item(strElementID)
  97. If Err.Number <> 0 Then
  98. response.Redirect mstrReturnURL
  99. End If
  100. intCaptionID = "&H" & objElement.GetProperty("CaptionRID")
  101. intDescriptionID = "&H" & objElement.GetProperty("DescriptionRID")
  102. varReplacementStrings = objAlert.ReplacementStrings
  103. ' extract values and clear the second element to eliminate problems with LocMgr
  104. strFailedTaskName = varReplacementStrings(0)
  105. strFailedTaskURL = varReplacementStrings(1)
  106. varReplacementStrings(1) = ""
  107. mstrLinkURL = m_VirtualRoot & strFailedTaskURL & "?Cookie=" & strCookie & "&ReturnURL=/" & GetFirstTabURL()
  108. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  109. strCaption = objLocMgr.GetString(strAlertSrc, intCaptionID, varReplacementStrings)
  110. strDescription = objLocMgr.GetString(strAlertSrc, intDescriptionID, varReplacementStrings)
  111. Set objLocMgr = Nothing
  112. Set objAlert = Nothing
  113. Set objElementCol = Nothing
  114. Set objElement = Nothing
  115. %>
  116. <html>
  117. <!-- Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved-->
  118. <head>
  119. <meta http-equiv="Content-Type" content="text/html; charset=<%=GetCharSet()%>">
  120. <title>Alert viewer</title>
  121. <link rel="STYLESHEET" type="text/css" href="../sh_page.css">
  122. <script language=JavaScript src="../sh_page.js"></script>
  123. <script language="JavaScript">
  124. function ClickClose() {
  125. window.location = document.frmPage.ReturnURL.value + "?R=" + Math.random();
  126. }
  127. function ClickClear() {
  128. document.frmPage.Method.value="CLEAR";
  129. document.frmPage.submit();
  130. }
  131. function ClickLink() {
  132. document.frmPage.Method.value="LAUNCH";
  133. document.frmPage.submit();
  134. }
  135. </script>
  136. </head>
  137. <body marginWidth="0" marginHeight ="0" onDragDrop="return false;" oncontextmenu="return false;" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" class="AREAPAGEBODY">
  138. <%ServePageWaterMarkNavIE%>
  139. <%ServeTabBar%>
  140. <%ServHelpMenu%>
  141. <form name="frmPage" action="<% =GetScriptFileName() %>" method="POST">
  142. <INPUT type=hidden name="ReturnURL" value="<% =mstrReturnURL %>">
  143. <INPUT type=hidden name="Method" value="<% =mstrMethod %>">
  144. <INPUT type=hidden name="Cookie" value="<% =Cookie %>">
  145. <INPUT type=hidden name="LinkURL" value="<% =mstrLinkURL %>">
  146. <%
  147. ServeAreaLabelBar(L_ALERTLBL_TEXT)
  148. %>
  149. <table border="0" width="386" ffheight="85%" cellspacing="0" cellpadding=2>
  150. <tr>
  151. <td width="30">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  152. <td width="100%" colspan=3> <span class="AreaText">
  153. <P><strong><% =strCaption %></strong></P>
  154. <P><% =strDescription %></P>
  155. </span>
  156. <!-- ' User Action -->
  157. <table border=0 width=386 cellspacing=0>
  158. <tr>
  159. <td width="30" height="28" valign="middle"></td>
  160. <td width=314 height=28 valign=middle>
  161. <a class="NAVLINK" href="JavaScript:ClickLink();"
  162. title="<% =arrHelpText %>"
  163. onMouseOver="window.status='<% =EscapeQuotes(arrHelpText) %>';return true;">
  164. <% =strFailedTaskName %>
  165. </a>
  166. </td></tr>
  167. </table>
  168. </td>
  169. </tr>
  170. <tr><td>&nbsp;</td></tr>
  171. <tr>
  172. <td width=30>&nbsp;&nbsp;&nbsp;&nbsp;</td>
  173. <td width="100%" colspan=3>
  174. <% Response.Write "<P>" & L_CLEARDESC_TEXT & "</P>" %>
  175. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  176. <a class="NAVLINK" href="JavaScript:ClickClear();"
  177. title="<% =L_CLEARALERT_TEXT %>"
  178. onMouseOver="window.status='<% =EscapeQuotes(L_CLEARALERT_TEXT) %>';return true;">
  179. <% =L_CLEARALERT_TEXT %>
  180. </a>
  181. </td>
  182. </tr>
  183. </table>
  184. <%
  185. Select Case intAlertType
  186. Case 0
  187. call ServePageWaterMarkEndNavIE(m_VirtualRoot & "util/images/alert_water.gif", m_VirtualRoot & "images/oem_logo.gif", true)
  188. Case 1
  189. call ServePageWaterMarkEndNavIE(m_VirtualRoot & "util/images/critical_water.gif", m_VirtualRoot & "images/oem_logo.gif", true)
  190. Case 2
  191. call ServePageWaterMarkEndNavIE(m_VirtualRoot & "util/images/info_water.gif", m_VirtualRoot & "images/oem_logo.gif", true)
  192. Case Else
  193. call ServePageWaterMarkEndNavIE(m_VirtualRoot & "util/images/alert_water.gif", m_VirtualRoot & "images/oem_logo.gif", true)
  194. End Select
  195. %>
  196. </form>
  197. </body>
  198. </html>
  199. <%
  200. End Sub
  201. %>