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.

252 lines
10 KiB

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