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.

163 lines
4.6 KiB

  1. <%@ LANGUAGE="VBSCRIPT"%>
  2. <%Response.Expires = 0%>
  3. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HEAD>
  4. <META HTTP-EQUIV="Content-Type"
  5. CONTENT="text/html; CHARSET=iso-8859-1">
  6. <META NAME="GENERATOR"
  7. CONTENT="Microsoft Frontpage 2.0">
  8. <HEAD>
  9. <TITLE>Set Shutdown Page</TITLE>
  10. <%
  11. Err.Clear
  12. On Error Resume Next
  13. Dim objTaskContext
  14. Dim objAS
  15. Dim rc
  16. Dim strStatus
  17. Dim objLocMgr
  18. Dim varReplacementStrings
  19. Dim strShutdownErrorText
  20. Dim strShuttingDownText
  21. Const SHUTDOWN_ERROR_TEXT = "&H40020010"
  22. Const SHUTTINGDOWN_TEXT = "&H40020011"
  23. On Error Resume Next
  24. Err.Clear
  25. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  26. If Err.number = 0 Then
  27. strShutdownErrorText = objLocMgr.GetString("salocaluimsg.dll",SHUTDOWN_ERROR_TEXT,varReplacementStrings)
  28. strShuttingDownText = objLocMgr.GetString("salocaluimsg.dll",SHUTTINGDOWN_TEXT,varReplacementStrings)
  29. Set objLocMgr = Nothing
  30. End If
  31. If strShutdownErrorText = "" Then
  32. strShutdownErrorText = "Encountered problem in shutting down. The change has been canceled."
  33. End If
  34. Err.Clear
  35. Const strMethodName = "ShutdownAppliance"
  36. Set objTaskContext = CreateObject("Taskctx.TaskContext")
  37. If Err.Number <> 0 Then
  38. strStatus = strShutdownErrorText
  39. else
  40. Set objAS = CreateObject("Appsrvcs.ApplianceServices")
  41. If Err.Number <> 0 Then
  42. strStatus = strShutdownErrorText
  43. Set objTaskContext = Nothing
  44. else
  45. objTaskContext.SetParameter "Method Name", strMethodName
  46. objTaskContext.SetParameter "SleepDuration", 1000
  47. objTaskContext.SetParameter "PowerOff", "1"
  48. If Err.Number <> 0 Then
  49. strStatus = strShutdownErrorText
  50. Set objAS = Nothing
  51. Set objTaskContext = Nothing
  52. else
  53. objAS.Initialize()
  54. If Err.Number <> 0 Then
  55. strStatus = strShutdownErrorText
  56. Set objAS = Nothing
  57. Set objTaskContext = Nothing
  58. else
  59. rc = objAS.ExecuteTaskAsync("ApplianceShutdownTask", objTaskContext)
  60. If Err.Number <> 0 Then
  61. strStatus = strShutdownErrorText
  62. else
  63. strStatus = "Success"
  64. End If
  65. Set objAS = Nothing
  66. Set objTaskContext = Nothing
  67. End If
  68. End If
  69. End If
  70. End If
  71. %>
  72. <SCRIPT LANGUAGE="VBScript">
  73. <!--
  74. Option Explicit
  75. public iIdleTimeOut
  76. public bIdle
  77. Sub window_onload()
  78. Dim objKeypad
  79. Set objKeypad = CreateObject("Ldm.SAKeypadController")
  80. objKeypad.Setkey 0,0,FALSE
  81. objKeypad.Setkey 1,0,FALSE
  82. objKeypad.Setkey 2,0,FALSE
  83. objKeypad.Setkey 3,0,FALSE
  84. objKeypad.Setkey 4,27,FALSE
  85. objKeypad.Setkey 5,13,FALSE
  86. Set objKeypad = Nothing
  87. If "<%=strStatus%>" <> "Success" Then
  88. stateText.style.display = "none"
  89. logo.style.display = "none"
  90. state.style.display = "none"
  91. errorText.style.display =""
  92. iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
  93. End If
  94. End Sub
  95. Sub keydown()
  96. If "<%=strStatus%>" <> "Success" Then
  97. If window.event.keycode = 13 or window.event.keycode = 27 Then
  98. window.navigate "localui_tasks.asp"
  99. End If
  100. window.clearTimeOut(iIdleTimeOut)
  101. iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
  102. End If
  103. End Sub
  104. Sub IdleHandler()
  105. window.navigate "localui_main.asp"
  106. End Sub
  107. -->
  108. </SCRIPT>
  109. </HEAD>
  110. <body RIGHTMARGIN=0 LEFTMARGIN=0 OnKeyDown="keydown()">
  111. <A id="errorText" STYLE="position:absolute; top:0; left:0; font-size:10; font-family=arial; display=none;"
  112. OnKeyDown="keydown()">
  113. <%=strStatus%>
  114. </A>
  115. <A id="stateText" STYLE="position:absolute; top:36; left:0; font-size:10; font-family=arial;">
  116. <%=strShuttingDownText%>
  117. </A>
  118. <IMG id="logo" STYLE="position:absolute; top:0; left=0;" SRC="localui_salogo.bmp"
  119. BORDER=0>
  120. <IMG id="state" STYLE="position:absolute; top:48; left=0;"
  121. SRC="localui_shutting_down.bmp" BORDER=0>
  122. </body>
  123. </html>