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.

307 lines
7.2 KiB

  1. <HTML>
  2. <HEAD>
  3. #include "header.inc"
  4. #include "constants.inc"
  5. #include "debug_js.inc"
  6. #include "constants.inc"
  7. <TITLE>REMOTE_ASSISTANCE</TITLE>
  8. <BGSOUND id="idbgsound" SRC="ding.wav">
  9. <meta http-equiv="MSThemeCompatible" content="Yes">
  10. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  11. <OBJECT ID="pchealth" classid="CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"></OBJECT>
  12. <script id="Script1" name="Script1" LANGUAGE="Javascript" SRC="Common/Common.js"> </script>
  13. <script id="Script2" name="Script2" Language="JavaScript">
  14. var oRCSession = null;
  15. var sSalemID = "";
  16. var oDeskMgr = null;
  17. var gHelper = null;
  18. var gHelperName = null;
  19. var gHelperIP = null;
  20. var gFrom = null;
  21. var gIsIM = false;
  22. var gIsFile = false;
  23. var gIsURA = false;
  24. var gBVT = false;
  25. var gIsPerf = false;
  26. var gConnectTimer = null;
  27. var gDisconnected = false;
  28. var L_RCCTL_Text = "Remote Assistance failed. Please try again. ";
  29. var L_EXPIREDBEFORESTARTED_Text = "The Remote Assistance invitation you sent was accepted but has since expired. Please resend the invitation to your assistant.";
  30. var L_DEFAULTUSER_Text = "Expert ";
  31. /*
  32. Function :OnLoad1()
  33. Description :
  34. */
  35. function OnLoad1()
  36. {
  37. var obj = null;
  38. var expertHelpBlob = null;
  39. try
  40. {
  41. InitTrace();
  42. TraceFunctEnter("OnLoad1");
  43. obj = new ActiveXObject( szProgIDSetting );
  44. }
  45. catch (error)
  46. {
  47. FatalError(L_RCCTL_Text, error);
  48. return;
  49. }
  50. try
  51. {
  52. oDeskMgr = pchealth.CreateObject_RemoteDesktopManager();
  53. sSalemID = oDeskMgr.RCTicket;
  54. expertHelpBlob = oDeskMgr.expertHelpBlob;
  55. userHelpBlob = oDeskMgr.userHelpBlob;
  56. var sIsIM = obj.GetPropertyInBlob(userHelpBlob, "IM");
  57. if(sIsIM == "1")
  58. {
  59. gIsIM = true;
  60. }
  61. if (expertHelpBlob != null && (gHelperName == null || gHelperName == ""))
  62. {
  63. gHelperName = EscapedName( obj.GetPropertyInBlob(expertHelpBlob, "NAME") );
  64. }
  65. else
  66. {
  67. gHelperName = L_DEFAULTUSER_Text;
  68. }
  69. //alert("gHelperName: " + gHelperName);
  70. gHelper = gHelperName; // it was point to BUDDY, change it to use NAME as gHelperName
  71. //alert("gIsIM: " + gIsIM + " sIsIM: " + sIsIM.length);
  72. if (userHelpBlob != null && (gFrom == null || gFrom == ""))
  73. {
  74. var szTmp = EscapedName( obj.GetPropertyInBlob(userHelpBlob, "FROM") );
  75. if( szTmp.length < 20 )
  76. {
  77. gFrom = szTmp;
  78. }
  79. else
  80. {
  81. gFrom = szTmp.slice(0, 20) + "...";
  82. }
  83. }
  84. else
  85. {
  86. gFrom = L_DEFAULTUSER_Text;
  87. }
  88. //alert("gFrom: " + gFrom);
  89. #if 0
  90. var sIsFile = obj.GetPropertyInBlob(expertHelpBlob, "FILE");
  91. try
  92. {
  93. if( (null == sIsFile) || ( "0" == sIsFile ) || ( 0 == sIsFile.length))
  94. {
  95. gIsFile = false;
  96. }
  97. else
  98. {
  99. gIsFile = true;
  100. }
  101. }
  102. catch(error)
  103. {
  104. gIsFile = false;
  105. }
  106. //alert("gIsFile: " + gIsFile);
  107. #endif
  108. var sIsURA = obj.GetPropertyInBlob(userHelpBlob, "UNSOLICITED");
  109. try
  110. {
  111. if( ( "0" == sIsURA ) || (null == sIsURA) || ( 0 == sIsURA.length ))
  112. {
  113. gIsURA = false;
  114. }
  115. else
  116. {
  117. gIsURA = true;
  118. gHelperName = EscapedName( obj.GetPropertyInBlob(userHelpBlob, "ID") );
  119. gHelper = gHelperName;
  120. #ifdef _BVT
  121. if ( gHelperName == c_szBVTTESTER )
  122. {
  123. gHelperName = c_szBVTUSER;
  124. gHelper = gHelperName;
  125. gBVT = true;
  126. frames.idSrc.LoadVariables();
  127. // No need to ask.
  128. Accepted();
  129. }
  130. #endif
  131. }
  132. }
  133. catch(error)
  134. {
  135. gIsURA = false;
  136. }
  137. //alert("gIsURA: " + gIsURA);
  138. }
  139. catch (error)
  140. {
  141. FatalError(L_RCCTL_Text ,error);
  142. return;
  143. }
  144. #if 0
  145. if (true == gIsIM)
  146. {
  147. frames.idSrc.LoadVariables();
  148. // No need to ask.
  149. Accepted();
  150. }
  151. #endif
  152. try
  153. {
  154. frames.idSrc.LoadVariables();
  155. #if 0
  156. var g_oShell = new ActiveXObject("WScript.Shell");
  157. g_oShell.SendKeys("%c");
  158. #endif
  159. }
  160. catch(error)
  161. {
  162. FatalError(L_RCCTL_Text,error);
  163. }
  164. TraceFunctLeave();
  165. return;
  166. }
  167. function ConnectTimeout()
  168. {
  169. TraceFunctEnter("ConnectTimeout");
  170. try
  171. {
  172. frames.idUI.DisplayDisconnectStatus();
  173. }
  174. catch(error)
  175. {
  176. FatalError(L_RCCTL_Text,error);
  177. }
  178. TraceFunctLeave();
  179. return;
  180. }
  181. /*
  182. Function : Accepted()
  183. Description:
  184. */
  185. function Accepted()
  186. {
  187. TraceFunctEnter("Accepted");
  188. //
  189. // Try to take the AcceptLock
  190. //
  191. try
  192. {
  193. oDeskMgr.ReserveAcceptedLock();
  194. }
  195. catch(error)
  196. {
  197. FatalError(error.description,error);
  198. pchealth.Close();
  199. return;
  200. }
  201. try
  202. {
  203. if (oRCSession == null)
  204. {
  205. oRCSession = pchealth.CreateObject_RemoteDesktopSession(
  206. 0,
  207. sSalemID,
  208. "");
  209. }
  210. frameset0.rows="0%,*";
  211. frames.idUI.ResizeUI();
  212. //frames.idUI.frames.idFrameTools.btnAbortConnection.disabled = false;
  213. oRCSession.onConnected = function( salemID, userSID, sessionID)
  214. {
  215. clearTimeout( gConnectTimer );
  216. if( false == gDisconnected )
  217. {
  218. frames.idUI.InitiateRCSession();
  219. frames.idUI.frames.idFrameChatTop.InitChatServer();
  220. }
  221. else
  222. {
  223. frames.idUI.Helpee_OnClientDisconnectedEventHandler();
  224. }
  225. }
  226. gConnectTimer = setTimeout("ConnectTimeout()", c_iCONNECTION_TIMEOUT);
  227. oDeskMgr.Accepted();
  228. }
  229. catch (error)
  230. {
  231. if (error.number == -2147024894)
  232. {
  233. FatalError(L_EXPIREDBEFORESTARTED_Text, error);
  234. }
  235. else
  236. FatalError(L_RCCTL_Text,error);
  237. pchealth.Close();
  238. }
  239. TraceFunctLeave();
  240. }
  241. /*
  242. Function : Rejected()
  243. Description:
  244. */
  245. function Rejected()
  246. {
  247. TraceFunctEnter("Rejected");
  248. try
  249. {
  250. oDeskMgr.Rejected();
  251. }
  252. catch (error)
  253. {
  254. FatalError(L_RCCTL_Text,error);
  255. pchealth.Close();
  256. }
  257. TraceFunctLeave();
  258. }
  259. </script>
  260. </HEAD>
  261. <frameset framespacing=0 frameborder=0 id="frameset0" rows="*,0%" onload="OnLoad1()">
  262. <frame id="idSrc" name="idSrc" src="HelpeeAccept.htm">
  263. <frame id="idUI" name="idUI" src="Interaction/Server/RAServer.htm">
  264. </frameset>
  265. </HTML>