2025-04-27 07:49:33 -04:00

455 lines
12 KiB
HTML

<html>
<head>
<!--
Copyright (c) 2000 Microsoft Corporation
-->
<title>Send Invitation through Email</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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 - Save 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 helper may accept the invitation. You can also set a password that the helper must use to connect to your computer. <A href="" tabindex=4 class="cursor" Onclick="parent.LaunchHelp(2);return false;">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">&nbsp;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">&nbsp;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 ="Save" onClick="DoSave()">
</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);
}
if (parent.iSelect2 != null)
{
idSelect2.selectedIndex = parent.iSelect2;
UpdateCombo();
}
idSelect.selectedIndex = parent.iSelect;
//set focus to the Password textbox
if (parent.sPass1 != null)
idPass1.value = parent.sPass1;
if (parent.sPass2 != null)
idPass2.value = parent.sPass2;
//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: DoSave()
Description : This function saves the invitation as a local file.
*/
function DoSave()
{
parent.TraceFunctEnter("DoSave");
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);
}
/* 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();
}
catch(error)
{
parent.FatalError("",error);
}
}
}
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";
}
}
</Script>
</html>