640 lines
16 KiB
HTML
640 lines
16 KiB
HTML
<html>
|
|
<head>
|
|
<!--
|
|
Copyright (c) 2000 Microsoft Corporation
|
|
-->
|
|
<TITLE>Remote Assistance</TITLE>
|
|
<meta http-equiv="MSThemeCompatible" content="Yes">
|
|
<LINK REL="STYLESHEET" HREF="../../Css/rcBuddy.css" TYPE="text/css">
|
|
</head>
|
|
|
|
<body id='idBody' onload="WinLoad();">
|
|
<TABLE Class="MaxLayout" border="0" cellspacing="0" cellpadding="0">
|
|
<TR>
|
|
<TD colspan=2>
|
|
<font class="cssHeader">Remote Assistance - Send an Invitation</font>
|
|
<BR>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD colspan=2>
|
|
<font class="cssTitle"><STRONG>Step 2 of 2: Set invitation security</STRONG></font>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD colspan=2 class="VAlignTop">
|
|
<Font class="cssBody" >
|
|
Limit the time in which your recipient may accept the invitation. You can also set a password that the recipient must use to connect to your computer. <A href="" class="cursor" Onclick="parent.LaunchHelp(2);return false;" tabindex=4>Learn about Remote Assistance security...</A>
|
|
</font>
|
|
</TD>
|
|
</TR>
|
|
<TR style="height:15%">
|
|
<TD colspan=2>
|
|
<TABLE cellspacing="0" cellpadding="0" border=0 class="MaxLayout">
|
|
<TR class="cssTblTitleLight">
|
|
<TD nowrap colspan=2>
|
|
<font class="cssBody"> Set the invitation to expire</font>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD style="WIDTH: 5%" >
|
|
<SELECT id="idSelect" name="idSelect" tabindex=5>
|
|
|
|
</SELECT>
|
|
|
|
</TD>
|
|
<TD style="WIDTH: 70%">
|
|
<SELECT id="idSelect2" name="idSelect2" onChange="UpdateCombo();" tabindex=6>
|
|
<option value=1>minutes</option>
|
|
<option value=2 selected>hours</option>
|
|
<option value=3>Days</option>
|
|
</SELECT>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
</TR>
|
|
<TR style="height:20%">
|
|
<TD colspan=2>
|
|
<TABLE cellspacing="0" cellpadding="0" border=0 class="MaxLayout">
|
|
<TR class="cssTblTitleLight">
|
|
<TD colspan=2 nowrap>
|
|
<input tabIndex=1 type="checkbox" checked id="idPassChk" name="idPassChk" onclick="DoPasswd()">
|
|
<LABEL for="idPassChk"><font class="cssBody"> Set Password</font></LABEL>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD style="WIDTH: 40%" nowrap>
|
|
<font class="cssBody">Password:</font><BR>
|
|
<input tabIndex=2 type=password id="idPass1" name="Password1" style="WIDTH: 95%;" class="Border">
|
|
</TD>
|
|
<TD style="WIDTH: 60%" nowrap>
|
|
<font class="cssBody">Confirm Password:</font><BR>
|
|
<input tabIndex=3 type=password id="idPass2" name="Password2" style="WIDTH: 70%;" class="Border">
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
</TR>
|
|
<TR style="height:5%">
|
|
<TD style="Width:5%">
|
|
<Img src="../../Common/icon_warning_32x.gif"></IMG>
|
|
</TD>
|
|
<TD>
|
|
<font class="cssTitle">
|
|
Important:
|
|
</font>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD colspan=2 Class="VAlignTop">
|
|
<font class="cssBody">
|
|
Setting a password is strongly recommended. Do not include the password in the invitation message. Do not use your network or Windows logon password.
|
|
</font>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD colspan=2 class="ValignBottom">
|
|
<hr>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD colspan=2 align="right">
|
|
<input tabIndex=7 class=styButton style="WIDTH: 30%" type="button" name="btnSend" id="btnSend" value ="Send Invitation" onClick="DoSend()">
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
</body>
|
|
<Script Language=JavaScript>
|
|
var oChannel = null;
|
|
var oRCSession = null;
|
|
|
|
/*
|
|
Function: WinLoad()
|
|
Description : Function that gets called on the OnLoad event of the page .
|
|
Populates the left dropdown combo for time.
|
|
Sets the focus to the Password textbox.
|
|
*/
|
|
function WinLoad()
|
|
{
|
|
var L_ERRACCESSDENIED_MSG = "Directly launching this page is not allowed. ";
|
|
|
|
if( null == parent.TraceFunctEnter )
|
|
{
|
|
idBody.style.visibility = "hidden";
|
|
alert( L_ERRACCESSDENIED_MSG );
|
|
return;
|
|
}
|
|
|
|
parent.TraceFunctEnter("WinLoad");
|
|
|
|
try
|
|
{
|
|
//Loading the dropdown combo .....
|
|
var col=new Enumerator(document.all("idSelect").tags("Option"));
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
idSelect.options.remove(x.index);
|
|
}
|
|
for (i=1;i<=23;i++)
|
|
{
|
|
var oOption = document.createElement("OPTION");
|
|
oOption.text=i;
|
|
oOption.value=i*60;
|
|
idSelect.options.add(oOption);
|
|
}
|
|
|
|
//set focus to the Password textbox
|
|
//idPass1.focus();
|
|
//idPass1.select();
|
|
idPassChk.focus();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function: UpdateCombo()
|
|
Description : This function gets called everytime a new choice is made between(Hours,Minutes,Days)
|
|
Depending upon the choice made the left dropdown combo gets populated
|
|
*/
|
|
function UpdateCombo()
|
|
{
|
|
parent.TraceFunctEnter("UpdateCombo");
|
|
|
|
try
|
|
{
|
|
//if the hour option is choosen
|
|
if (idSelect2.item(idSelect2.selectedIndex).value==2)
|
|
{
|
|
var col=new Enumerator(document.all("idSelect").tags("Option"));
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
idSelect.options.remove(x.index);
|
|
}
|
|
for (i=1;i<=23;i++)
|
|
{
|
|
var oOption = document.createElement("OPTION");
|
|
oOption.text=i;
|
|
oOption.value=i*60;
|
|
idSelect.options.add(oOption);
|
|
}
|
|
}
|
|
//if the minute option is choosen
|
|
else if (idSelect2.item(idSelect2.selectedIndex).value==1)
|
|
{
|
|
var col=new Enumerator(document.all("idSelect").tags("Option"));
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
idSelect.options.remove(x.index);
|
|
}
|
|
for (i=1;i<=59;i++)
|
|
{
|
|
var oOption = document.createElement("OPTION");
|
|
oOption.text=i;
|
|
oOption.value=i;
|
|
idSelect.options.add(oOption);
|
|
}
|
|
}
|
|
//if the days option is choosen
|
|
else
|
|
{
|
|
var col=new Enumerator(document.all("idSelect").tags("Option"));
|
|
for (;!col.atEnd();col.moveNext())
|
|
{
|
|
x=col.item();
|
|
idSelect.options.remove(x.index);
|
|
}
|
|
for (i=1;i<=99;i++)
|
|
{
|
|
var oOption = document.createElement("OPTION");
|
|
oOption.text=i;
|
|
oOption.value=i*24*60;
|
|
idSelect.options.add(oOption);
|
|
}
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function: DoSend()
|
|
Description : This function creates the incident object and attaches
|
|
it to an email and sends it to the recipient.
|
|
*/
|
|
function DoSend()
|
|
{
|
|
parent.TraceFunctEnter("DoSend");
|
|
var sPass = "";
|
|
var sPassStub = "";
|
|
var oSetting = null;
|
|
|
|
// Check password.
|
|
if (idPassChk.checked && (idPass1.value.length ==0 && idPass2.value.length ==0))
|
|
{
|
|
alert(parent.L_NOPASSWD_MSG);
|
|
return;
|
|
}
|
|
if (idPassChk.checked && (idPass1.value != idPass2.value))
|
|
{
|
|
alert(parent.L_INVALIDPASS_MSG);
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
oSetting = new ActiveXObject("RcBdyCtl.Setting");
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError(parent.L_RCCTL_MSG,error);
|
|
return;
|
|
}
|
|
|
|
//Encryption of the password
|
|
if ((idPassChk.checked) &&(idPass1.value.length > 0) )
|
|
{
|
|
try
|
|
{
|
|
var oEnc = parent.pchealth.CreateObject_Encryption();
|
|
sPassStub = oSetting.CreatePassword;
|
|
sPass = oEnc.EncryptString(idPass1.value, sPassStub);
|
|
sPass = (5+sPass.length) + ";PASS=" + sPass;
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError(parent.L_ENCRYPT_MSG,error);
|
|
}
|
|
}
|
|
|
|
var iExpiry = idSelect.options[idSelect.selectedIndex].value;
|
|
|
|
if (parent.Init( iExpiry * 60, sPass ) == false)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var oRCSession = parent.oRCSession;
|
|
var oChannel = parent.oChannel;
|
|
var RcXMLTempFile = null;
|
|
var ip = null;
|
|
var sExpiry = "";
|
|
|
|
try
|
|
{
|
|
RcXMLTempFile = oSetting.GetUserTempFileName;
|
|
ip = oSetting.GetIPAddress;
|
|
if (ip.length == 0)
|
|
{
|
|
alert(parent.L_NOIP_MSG);
|
|
return;
|
|
}
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError(parent.L_RCCTL_MSG,error);
|
|
return;
|
|
}
|
|
|
|
//creating the incident object
|
|
|
|
try
|
|
{
|
|
|
|
sSalemID = oRCSession.ConnectParms;
|
|
|
|
oRCSession.OnConnected = parent.onCallBackConnect;
|
|
|
|
var IncidentFile = oChannel.VendorDirectory + "\\rcBuddy.MsRcIncident";
|
|
oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.UserName = parent.sFrom;
|
|
oInc.ProblemDescription = parent.sMsg;
|
|
oInc.UploadType = 1;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
oInc.RcTicket = sSalemID;
|
|
if (sPass != "")
|
|
{
|
|
oInc.RCTicketEncrypted = true;
|
|
}
|
|
|
|
var oDict = oInc.Misc;
|
|
try
|
|
{
|
|
var d = new Date();
|
|
var iNow = Math.round(Date.parse(d)/1000);
|
|
oDict.add("DtStart", iNow);
|
|
oDict.add("DtLength", iExpiry);
|
|
oDict.add("IP", ip);
|
|
oDict.add("Status", "Active");
|
|
if (sPass != "")
|
|
oDict.add("PassStub", sPassStub);
|
|
|
|
d = new Date((iNow + iExpiry * 60) * 1000);
|
|
sExpiry = d.toLocaleString();
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
oInc.StartPage = "Remote%20Assistance/RcBuddy.htm";
|
|
|
|
try
|
|
{
|
|
// Save incident OFF to an XML file
|
|
oInc.GetXML(IncidentFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
var lRet = parent.oSmapi.Logon();
|
|
if (lRet == 1)
|
|
{
|
|
parent.oSmapi.Subject = parent.L_SUBJECT_MSG + parent.sFrom;
|
|
parent.oSmapi.Body = parent.L_LINE1_MSG + parent.L_SENDER_MSG + parent.sFrom + ":\n\n" +
|
|
parent.L_EXPIRY_MSG + sExpiry + "\n\n" +
|
|
parent.L_DESCIPTION_MSG + parent.sMsg + "\n\n" +
|
|
parent.L_NOTE_MSG ;
|
|
|
|
parent.oSmapi.AttachedXMLFile = IncidentFile;
|
|
lRet = parent.oSmapi.SendMail();
|
|
if (lRet == 1)
|
|
{
|
|
try
|
|
{
|
|
// Mail sent, save incident record.
|
|
oInc.GetXML(RcXMLTempFile);
|
|
// save ticket locally
|
|
oChannel.RecordIncident(parent.sTo, sSalemID, "", RcXMLTempFile);
|
|
PopupThanks();
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
var bSave = confirm(parent.L_SENDFAIL2_MSG);
|
|
if (!bSave)
|
|
{
|
|
try
|
|
{
|
|
// Close Session
|
|
oRCSession.CloseRemoteDesktopSession();
|
|
parent.oRCSession=null;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
else
|
|
DoSave();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
var bSave = confirm(parent.L_MAPIFAIL2_MSG);
|
|
if (!bSave)
|
|
{
|
|
try
|
|
{
|
|
// Close Session
|
|
oRCSession.CloseRemoteDesktopSession();
|
|
parent.oRCSession=null;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
else
|
|
DoSave();
|
|
|
|
}
|
|
parent.TraceFunctLeave();
|
|
}
|
|
|
|
/*
|
|
Function : PopupThanks()
|
|
Description :This function navigates to the confirmation page once the incident object
|
|
is successfully created,attached to an email and sent to the recipient.
|
|
*/
|
|
function PopupThanks()
|
|
{
|
|
navigate("rcScreen7.htm");
|
|
}
|
|
|
|
/*
|
|
Function : DoPasswd()
|
|
Description :This function attaches different styles to the Password textboxes
|
|
depending upon if the checkbox is checked or not.
|
|
*/
|
|
function DoPasswd()
|
|
{
|
|
if (idPassChk.checked)
|
|
{
|
|
idPass1.disabled = false;
|
|
idPass1.style.backgroundColor="";
|
|
idPass2.disabled = false;
|
|
idPass2.style.backgroundColor="";
|
|
}
|
|
else
|
|
{
|
|
idPass1.disabled = true;
|
|
idPass1.style.backgroundColor="#efefef";
|
|
idPass2.disabled = true;
|
|
idPass2.style.backgroundColor="#efefef";
|
|
}
|
|
}
|
|
|
|
/*
|
|
Function: DoSave()
|
|
Description : This function saves the invitation as a local file.
|
|
*/
|
|
function DoSave()
|
|
{
|
|
parent.TraceFunctEnter("DoSave");
|
|
var sPass = "";
|
|
var sPassStub = "";
|
|
var oSetting = null;
|
|
var bRet = false;
|
|
|
|
try
|
|
{
|
|
oSetting = new ActiveXObject("RcBdyCtl.Setting");
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError(parent.L_RCCTL_MSG,error);
|
|
return;
|
|
}
|
|
|
|
//Encryption of the password
|
|
if ((idPassChk.checked) &&(idPass1.value.length > 0) )
|
|
{
|
|
try
|
|
{
|
|
var oEnc = parent.pchealth.CreateObject_Encryption();
|
|
sPassStub = oSetting.CreatePassword;
|
|
sPass = oEnc.EncryptString(idPass1.value, sPassStub);
|
|
sPass = (5+sPass.length) + ";PASS=" + sPass;
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError(parent.L_ENCRYPT_MSG,error);
|
|
}
|
|
}
|
|
|
|
var iExpiry = idSelect.options[idSelect.selectedIndex].value;
|
|
|
|
if (parent.Init( iExpiry * 60, sPass ) == false)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var oRCSession = parent.oRCSession;
|
|
var oChannel = parent.oChannel;
|
|
var RcXMLTempFile = null;
|
|
var ip = null;
|
|
var sExpiry = "";
|
|
|
|
try
|
|
{
|
|
RcXMLTempFile = oSetting.GetUserTempFileName;
|
|
ip = oSetting.GetIPAddress;
|
|
if (ip.length == 0)
|
|
{
|
|
alert(parent.L_NOIP_MSG);
|
|
return;
|
|
}
|
|
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError(parent.L_RCCTL_MSG,error);
|
|
return;
|
|
}
|
|
|
|
//creating the incident object
|
|
try
|
|
{
|
|
sSalemID = oRCSession.ConnectParms;
|
|
|
|
oRCSession.OnConnected = parent.onCallBackConnect;
|
|
|
|
var IncidentFile = oChannel.VendorDirectory + "\\rcBuddy.MsRcIncident";
|
|
oInc = parent.pchealth.CreateObject_Incident();
|
|
oInc.UserName = parent.sFrom;
|
|
oInc.ProblemDescription = parent.sMsg;
|
|
oInc.UploadType = 1;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
oInc.RcTicket = sSalemID;
|
|
if (sPass != "")
|
|
{
|
|
oInc.RCTicketEncrypted = true;
|
|
}
|
|
|
|
var oDict = oInc.Misc;
|
|
try
|
|
{
|
|
var d = new Date();
|
|
var iNow = Math.round(Date.parse(d)/1000);
|
|
oDict.add("DtStart", iNow);
|
|
oDict.add("DtLength", iExpiry);
|
|
oDict.add("IP", ip);
|
|
oDict.add("Status", "Active");
|
|
if (sPass != "")
|
|
oDict.add("PassStub", sPassStub);
|
|
|
|
d = new Date((iNow + iExpiry * 60) * 1000);
|
|
sExpiry = d.toLocaleString();
|
|
}
|
|
catch (error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
oInc.StartPage = "Remote%20Assistance/RcBuddy.htm";
|
|
|
|
try
|
|
{
|
|
// Save incident OFF to an XML file
|
|
oInc.GetXML(IncidentFile);
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
|
|
/* Start to save this invitation file */
|
|
{
|
|
var sHTML = "";
|
|
sHTML = "From: <B>" + parent.sFrom + "</B><br>";
|
|
sHTML += parent.L_EXPIRY_MSG + "<B>" + sExpiry + "</B><br>" +
|
|
parent.L_DESCIPTION_MSG + "<PRE>" + parent.sMsg + "</PRE><P><P>" +
|
|
parent.L_HTML_MSG;
|
|
|
|
// Get file name
|
|
var o = new ActiveXObject("SAFRCFileDlg.FileSave");
|
|
o.FileName = "rahelp.msrcincident";
|
|
o.FileType ="MsRcIncident Files(*.msrcincident)\0*.msrcincident\0";
|
|
if (o.OpenFileSaveDlg())
|
|
{
|
|
var tFileName = o.FileName;
|
|
var temp = tFileName.toLowerCase();
|
|
var i = temp.lastIndexOf(".msrcincident");
|
|
if (i == -1 || i < temp.length - 13) // wrong extension
|
|
tFileName += ".msrcincident";
|
|
|
|
try
|
|
{
|
|
// Save file
|
|
o = new ActiveXObject("Scripting.FileSystemObject");
|
|
o.CopyFile(IncidentFile, tFileName, true);
|
|
oInc.Misc.add("Method", "File");
|
|
oInc.GetXML(RcXMLTempFile);
|
|
// save ticket locally
|
|
oChannel.RecordIncident(tFileName, sSalemID, "", RcXMLTempFile);
|
|
PopupThanks();
|
|
bRet = true;
|
|
}
|
|
catch(error)
|
|
{
|
|
parent.FatalError("",error);
|
|
}
|
|
}
|
|
}
|
|
parent.TraceFunctLeave();
|
|
|
|
return bRet;
|
|
}
|
|
|
|
</Script>
|
|
</html>
|