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.

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