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.

257 lines
9.0 KiB

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="../sh_page.asp" -->
  4. <!-- #include file="../tabbar.asp" -->
  5. <% '==================================================
  6. ' Microsoft Server Appliance
  7. '
  8. ' Alert Viewer for Client Configuration
  9. ' Alert Log: svrapp
  10. ' Alert ID:
  11. '
  12. ' Author: a-pkreem
  13. ' History: 7/23/99 created
  14. '
  15. ' Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved.
  16. '==================================================
  17. Dim strCookie
  18. Dim rc
  19. Dim mstrMethod
  20. Dim mstrReturnURL
  21. On Error Resume Next
  22. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  23. strSourceName = "sakitmsg.dll"
  24. if Err.number <> 0 then
  25. Response.Write "Error in localizing the web content "
  26. Response.End
  27. end if
  28. '-----------------------------------------------------
  29. 'START of localization content
  30. Dim L_ALERTLBL_TEXT
  31. Dim L_CLEARALERT_TEXT
  32. Dim L_WIZARDLINK_TEXT
  33. Dim L_ACTIONDESC_TEXT
  34. Dim L_CLEARDESC_TEXT
  35. Dim L_SETUPCHANGE_TEXT
  36. Dim L_SETUP_TEXT
  37. Dim L_SETUP_PROC_TEXT
  38. Dim L_FOLLOWINST_TEXT
  39. Dim L_CLEAR_MESSAGE_TEXT
  40. Dim L_CONFIRMATION_TEXT
  41. L_ALERTLBL_TEXT = objLocMgr.GetString(strSourceName, "&H4001003C",varReplacementStrings)
  42. L_CLEARALERT_TEXT = objLocMgr.GetString(strSourceName, "&H4001003D",varReplacementStrings)
  43. L_WIZARDLINK_TEXT = objLocMgr.GetString(strSourceName, "&H4001003E",varReplacementStrings)
  44. L_ACTIONDESC_TEXT = objLocMgr.GetString(strSourceName, "&H4001003F",varReplacementStrings)
  45. L_CLEARDESC_TEXT = objLocMgr.GetString(strSourceName, "&H40010040",varReplacementStrings)
  46. L_SETUPCHANGE_TEXT = objLocMgr.GetString(strSourceName, "&H40010041",varReplacementStrings)
  47. L_SETUP_TEXT = objLocMgr.GetString(strSourceName, "&H40010042",varReplacementStrings)
  48. L_SETUP_PROC_TEXT = objLocMgr.GetString(strSourceName, "&H40010043",varReplacementStrings)
  49. L_FOLLOWINST_TEXT = objLocMgr.GetString(strSourceName, "&H40010044",varReplacementStrings)
  50. L_CLEAR_MESSAGE_TEXT = objLocMgr.GetString(strSourceName, "&H40010045",varReplacementStrings)
  51. L_CONFIRMATION_TEXT = objLocMgr.GetString(strSourceName, "&H40010046",varReplacementStrings)
  52. 'End of localization content
  53. '-----------------------------------------------------
  54. mstrMethod = Request.Form("Method") 'framework variable
  55. mstrReturnURL = Request("ReturnURL") 'framework variable, used in Redirect()
  56. strCookie = Request("Cookie")
  57. If strCookie = "" Then ServeClose
  58. Select Case mstrMethod
  59. Case "CLEAR"
  60. rc = ClearAlert(strCookie)
  61. response.Redirect mstrReturnURL
  62. Case "CLOSE"
  63. response.Redirect mstrReturnURL
  64. Case Else
  65. ServePage(strCookie)
  66. End Select
  67. '======================================================
  68. Sub ServePage(Cookie)
  69. Dim objAlert
  70. Dim objElementCol
  71. Dim objElement
  72. Dim objLocMgr
  73. Dim strAlertSrc
  74. Dim intAlertID
  75. Dim intAlertType
  76. Dim intCaptionID
  77. Dim intDescriptionID
  78. Dim strCaption
  79. Dim strDescription
  80. Dim strElementID
  81. Dim varReplacementStrings
  82. Dim varReplacementStringsNone
  83. Dim strFailedTaskName
  84. Dim strFailedTaskURL
  85. Dim objElements
  86. Dim objItem
  87. Dim arrTitle
  88. Dim arrURL
  89. Dim arrHelpText
  90. Dim blnEnabled
  91. Dim i
  92. On Error Resume Next
  93. Set objAlert = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Alert.Cookie=" & Cookie )
  94. strAlertSrc = objAlert.AlertLog
  95. intAlertID = objAlert.AlertID
  96. intAlertType = objAlert.AlertType
  97. strElementID = strAlertSrc & Hex(intAlertID)
  98. Set objElementCol = GetElements("AlertDefinitions")
  99. Set objElement = objElementCol.Item(strElementID)
  100. If Err.Number <> 0 Then
  101. response.Redirect mstrReturnURL
  102. End If
  103. intCaptionID = "&H" & objElement.GetProperty("CaptionRID")
  104. intDescriptionID = "&H" & objElement.GetProperty("DescriptionRID")
  105. varReplacementStrings = objAlert.ReplacementStrings
  106. ' extract values and clear the second element to eliminate problems with LocMgr
  107. strFailedTaskName = varReplacementStrings(0)
  108. strFailedTaskURL = varReplacementStrings(1)
  109. varReplacementStrings(1) = ""
  110. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  111. strCaption = objLocMgr.GetString(strAlertSrc, intCaptionID, varReplacementStrings)
  112. strDescription = objLocMgr.GetString(strAlertSrc, intDescriptionID, varReplacementStrings)
  113. Set objLocMgr = Nothing
  114. Set objAlert = Nothing
  115. Set objElementCol = Nothing
  116. Set objElement = Nothing
  117. %>
  118. <html>
  119. <!-- Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved-->
  120. <head>
  121. <meta http-equiv="Content-Type" content="text/html; charset=<%=GetCharSet()%>">
  122. <title ID=TID_1>Alert viewer</title>
  123. <link rel="STYLESHEET" type="text/css" href="../sh_page.css">
  124. <script language=JavaScript src="../sh_page.js"></script>
  125. <script language="JavaScript">
  126. function ClickClose() {
  127. window.location = document.frmPage.ReturnURL.value + "?R=" + Math.random();
  128. }
  129. function ClickClear() {
  130. var L_CONFIRMCLEAR_TEXT ="<%=L_CONFIRMATION_TEXT%>" ;
  131. if (confirm(L_CONFIRMCLEAR_TEXT)) {
  132. document.frmPage.Method.value="CLEAR";
  133. document.frmPage.submit();
  134. }
  135. }
  136. function OpenClientWizard() {
  137. var strpagestart = "<HTML><HEAD></HEAD><BODY><OBJECT CLASSID=" +
  138. "'CLSID:81620412-412C-11d3-851E-0080C7227EA1' CODEBASE='";
  139. var strpageend = "'></OBJECT></BODY></HTML>";
  140. var filename = "../sasetup.cab";
  141. runnerwin.document.open();
  142. runnerwin.document.write(strpagestart + filename + strpageend);
  143. return false; // stop hyperlink and stay on this page
  144. }
  145. </script>
  146. </head>
  147. <body marginWidth="0" marginHeight ="0" onDragDrop="return false;" oncontextmenu="return false;" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" class="AREAPAGEBODY">
  148. <%ServeTabBar%>
  149. <%ServHelpMenu%>
  150. <form name="frmPage" action="<% =GetScriptFileName() %>" method="POST">
  151. <INPUT type=hidden name="ReturnURL" value="<% =mstrReturnURL %>">
  152. <INPUT type=hidden name="Method" value="<% =mstrMethod %>">
  153. <INPUT type=hidden name="Cookie" value="<% =Cookie %>">
  154. <% Select Case intAlertType
  155. Case 0
  156. ServePageWaterMark "images/alert_water.gif"
  157. Case 1
  158. ServePageWaterMark "images/critical_water.gif"
  159. Case 2
  160. ServePageWaterMark "images/info_water.gif"
  161. Case Else
  162. ServePageWaterMark "images/alert_water.gif"
  163. End Select
  164. ServeAreaLabelBar(L_ALERTLBL_TEXT)
  165. %>
  166. <table border="0" width="518" cellspacing="0" cellpadding=2 class="AreaText">
  167. <tr>
  168. <td width="30">&nbsp;&nbsp;</td>
  169. <td>
  170. <table width=100% class="AreaText">
  171. <tr>
  172. <td colspan=3 width=100% ><span class="AreaText">
  173. <P><strong><% =strCaption %></strong></P>
  174. <P ID=PID_1><%L_SETUPCHANGE_TEXT%></P>
  175. <ID ID=PID_2><%L_SETUP_TEXT%></ID>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td valign=top>1.</td>
  180. <td colspan=2 ID=PID_3><%=L_SETUP_PROC_TEXT%></td>
  181. </tr>
  182. <tr>
  183. <td valign=top>2.</td>
  184. <td colspan=2 ID=PID_4><%=L_FOLLOWINST_TEXT%></td>
  185. </tr>
  186. <% If IsNT5 Or IsWin98 Then %>
  187. <tr>
  188. <td colspan=3>
  189. <BR>
  190. <P ID=PID_5><%=L_ACTIONDESC_TEXT%></P>
  191. </span>
  192. &nbsp;&nbsp;&nbsp;&nbsp;
  193. <a class="NAVLINK" href="#" onClick="OpenClientWizard();"
  194. title="<% =L_WIZARDLINK_TEXT %>"
  195. onMouseOver="window.status='<% =EscapeQuotes(L_WIZARDLINK_TEXT) %>';return true;">
  196. <% =L_WIZARDLINK_TEXT %>
  197. </a>
  198. <BR><BR>
  199. </td>
  200. </tr>
  201. <% Else
  202. Response.Write "<tr><td colspan=3>&nbsp;</td></tr>"
  203. End If %>
  204. <tr>
  205. <td align=left colspan=3>
  206. <BR><ID ID=PID_6><%=L_CLEAR_MESSAGE_TEXT%></ID>
  207. <% Response.Write L_CLEARDESC_TEXT %>
  208. <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;
  209. <a class="NAVLINK" href="JavaScript:ClickClear();"
  210. title="<% =L_CLEARALERT_TEXT %>"
  211. onMouseOver="window.status='<% =EscapeQuotes(L_CLEARALERT_TEXT) %>';return true;">
  212. <% =L_CLEARALERT_TEXT %>
  213. </a>
  214. </td>
  215. </tr>
  216. </table>
  217. </td></tr>
  218. </table>
  219. <% ServeBackButton() %>
  220. </form>
  221. <IFRAME ID=runnerwin WIDTH=0 HEIGHT=0 SRC="about:blank"></IFRAME><BR/>
  222. </body>
  223. </html>
  224. <%
  225. End Sub
  226. %>