HTML PHP
HTML PHP
HTML PHP
01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="noindex,nofollow" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script type="text/javascript">
//Create a dynamic element to allow sending of the document mode
of IE.
//This way we can notify PHP that it can display modern content
instead of classic, despite the browser's reporting of being IE7.
var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = "/UserCheck/css/UserCheckCSS" +
(document.documentMode !== undefined ? "?documentMode=" + document.documentMode :
"");
headID.appendChild(cssNode);
/*
===================================================================================
=====================================
PORTAL IS - ESSENTIALS INCLUSION - START
___________________________________________________________________________________
_____________________________________
*/
// Set global PORTAL_IS namespace.
window.PORTAL_IS = {};
// Set namespace.
PORTAL_IS.CONF = {};
PORTAL_IS.CONF.AJAX_REQ_TIMEOUT = 15000;
// Debug configurations
PORTAL_IS.CONF.MAX_STACK_SIZE = 1000;
PORTAL_IS.CONF.QUIET_MODE = "on".toLowerCase() == "on";
PORTAL_IS.CONF.DEBUG_LEVEL = 0;
// Set namespace.
window.PORTAL_IS.L10N = {}
// Localization object.
//=================================================================================
============
function __L10N()
{
this.strings = new Array();
this.browserLangs = new Array();
this.init = function()
{
var obj = {"UC_TITLE":"Check Point
UserCheck","UC_TITLE_MOBILE_DLP":"Check Point UserCheck Mobile
DLP","BUTTON.OK":"OK","BUTTON.CANCEL":"Cancel","BUTTON.SEND":"Send","BUTTON.DISCARD
":"Discard","BUTTON.APPROVE":"Approve","BUTTON.CONFIRM":"Confirm","BUTTON.CLOSE":"C
lose","WRONG_ID":"This notification page has expired. You can safely close the
page. ","TIMEOUT":"This notification page has expired. You can safely close the
page. ","RETRY":"Reload the original page.","REPORT_SUCCESS":"Report was sent
successfully.","REPORT_ERROR":"An error occured while sending the
report.","REQUIRED_FIELDS":"Required fields","ENTER_TEXT":"Enter
text","TEXT_TOO_LONG":"Your text is too long!","RETURN_TO_SITE":"Return to
site","UC.BLOCKED_IFRAME":"Learn more...","UC.INFO_IFRAME":"Click to
resolve...","PLEASE_WAIT":"Please wait . . .","NO_SCRIPT":"This portal requires a
browser which supports JavaScript.<br>Please make sure that you are using an
updated browser and that JavaScript is
enabled.","MSGBOX_TITLE_CONFIRMATION":"Confirmation","MSGBOX_TITLE_JUSTIFICATION":"
Justification","MSGBOX_TITLE_APPROVER":"Approver","MSGBOX_TITLE_WARNING":"Warning",
"MSGBOX_TITLE_ATTENTION":"Attention","MSGBOX_TITLE_ERROR":"Error","MSGBOX_TITLE_REP
ORT_ERROR":"Report an error","MSGBOX_TITLE_EXTEND_EXPIRATION":"Extend expiration
date","DEFAULT_GENERIC_CLIENT_ERROR":"An unexpected error has occurred.\nYou may
still be able to continue working normally.\nPlease retry accessing the web page in
a short while.\n\n","DEFAULT_GENERIC_TIMEOUT_CLIENT_ERROR":"You may not access this
page, or this page has expired.\nPlease sign in.","LOG_REFERENCE_ID":"Log reference
id: ","ERROR.LINK.SEND_ERROR_REPORT":"Send error
report","ERROR.LINK.IM_HAVING_PROBLEMS":"I am having problems with this
Portal.","CHECKPOINT_COPY_RIGHTS":"©2018 Check Point Software Technologies
Ltd.","EMAIL_SENT":"The email has been sent","EMAIL_DISCARDED":"The email has been
discarded","EMAIL_ALREADY_SENT":"The email has already been
sent","EMAIL_ALREADY_DISCARDED":"The email has already been
discarded","UNKOWN_INCIDENT_STATUS":"An unexpected error has occurred.\nThe
incident status is unknown","REVIEW_TEXT":"Review issue in
portal","MAIL.ITEM.ATTACHMENTS":"Attachments","HTTP_LEARNING":"To complete the
operation, <b>please return to site and resend the information<\/b>,
thanks.","HTTP_LEARNING_ERROR_MSG":"Sending the message cannot be approved,<\/br>
please contact your system administrator.","HTTP_LEARNING_ERROR_TOOLTIP":"Sending
the message cannot be approved, please contact your system
administrator.","IE6_MESSAGE1":"Please update your browser in order to use
UserCheck","IE6_MESSAGE2":"This browser is not supported. <br\/>This site requires
Internet Explorer 8+, Chrome, Firefox or Opera.","CP_SCRUB_WAIT_MESSAGE":"Please
wait while loading files...","CP_SCRUB_RESULT_SUCCESS":"Threat Prevention didn't
detect cleanable parts","CP_SCRUB_RESULT_FAILURE":"File structure may be
corrupted","CP_SCRUB_RESULT_TIMEOUT":"","CP_SCRUB_RESULT_UNSUPPORTED_FILE":"File
contents do not match the
extension","CP_SCRUB_RESULT_NOT_SCRUBBED":"","CP_SCRUB_RESULT_INTERNAL_ERROR":"","C
P_SCRUB_RESULT_NO_VALID_CONTRACT":"","CP_SCRUB_RESULT_SKIPPED_BY_TE_CONFIDENCE":"",
"CP_SCRUB_RESULT_OUT_OF_MEMORY":"","CP_SCRUB_RESULT_DOCSEC_FILE":"File encrypted
using Checkpoint's Document Security","CP_SCRUB_RESULT_ENCRYPTED_FILE":"contains
encrypted
data","CP_SCRUB_RESULT_SKIPPED_BY_SCRIPT":"","CP_SCRUB_RESULT_DISK_LIMIT_REACHED":"
","CP_SCRUB_RESULT_BYPASS_SCRUB":"","CP_SCRUB_RESULT_WATERMARK_FAILED":"","CP_SCRUB
_INVALID_EMAIL":"Invalid Email Address","CP_SCRUB_SEND_MAIL_STRING":"Send the
original mail to
me:","CP_SCRUB_SEND_EMAIL_EXAMPLE":"[email protected]","CP_SCRUB_SEND_EMAIL_SUCCESS":
"Mail was sent successfully, please check your
inbox","CP_SCRUB_SEND_EMAIL_ERROR":"Could not send mail to the recipient, please
verify your address","CTNT_EMAIL_CONFIRM":"Thank you for your input. To complete
the operation, <b>please resend the email<\/b>.\n <br\/>It is safe to close this
page.","CP_SCRUB_FILE_STATUS_WAITING_FOR_TE_DESC":"scanning...","CP_SCRUB_FILE_STAT
US_WAITING_FOR_TE":"Please wait while file is being
scanned","CP_SCRUB_FILE_STATUS_BLOCKED_BY_TE_DESC":"blocked - file is
malicious","CP_SCRUB_FILE_STATUS_BLOCKED_BY_TE":"File is malicious - blocked for
download","CP_SCRUB_FILE_STATUS_BLOCKED_BY_POLICY_DESC":"blocked according to
company policy","CP_SCRUB_FILE_STATUS_BLOCKED_BY_POLICY":"File is blocked for
download according to company policy"};
for(val in obj)
this.strings[val] = obj[val];
obj = ["en"];
for(val in obj)
{
this.browserLangs[val] = obj[val].split(';')[0];
}
}
this.getStr = function(stringId)
{
return this.strings[stringId];
}
this.selectLanguage = function(languageArray)
{
for(lang in this.browserLangs)
{
if(languageArray[this.browserLangs[lang]] === true)
return this.browserLangs[lang];
requestData.lang = lang;
requestData.fallbackLang = fallbackLang;
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.asyncReloadLangHandler,
this,
[callback]);
}
for(val in obj)
this.strings[val] = obj[val];
callback();
}
}
//=================================================================================
============
//Localization object.
L10N_Obj = new __L10N();
L10N_Obj.init();
PORTAL_IS.L10N.L10N_Obj = L10N_Obj;
/*
___________________________________________________________________________________
_____________________________________
// Create namespace
window.UserCheck = {};
window.UserCheck.tools = {};
//
===================================================================================
====
function parseSender(value)
{
return value.address;
}
//
===================================================================================
====
//
===================================================================================
====
// Render recipient list from and array.
// String[] recipientsArr - Array of recipients.
// [int ellipsisLimit] - A string beyond this length will be cut and added
ellipsis. Optional, default is 0 - no ellipsis.
// [bool useLinebreakes] - Should a line break be added after each recipient.
Optional, default is true.
function recipientsArr2StrInTable(recipientsArr, ellipsisLimit, useLinebreakes)
{
if (ellipsisLimit == undefined)
{
ellipsisLimit = 0;
}
if (useLinebreakes == undefined)
{
useEllipsis = true;
}
if (ellipsisLimit > 0)
{
//recipientsList = Ext.util.Format.ellipsis(recipientsList,
ellipsisLimit);
recipientsList = recipientsList;
}
return recipientsList;
}
//
===================================================================================
====
//
===================================================================================
====
// Render recipient list from and array.
// Sender sender - The sender data.
// [int ellipsisLimit] - A string beyond this length will be cut and added
ellipsis. Optional, default is 0 - no ellipsis.
// [bool useLinebreakes] - Should a line break be added after each recipient.
Optional, default is true.
function getSenderName(sender, ellipsisLimit)
{
var output = "";
if (ellipsisLimit == undefined)
{
ellipsisLimit = 0;
}
if (sender.name.empty())
{
output = sender.address;
}
else
{
output = sender.name;
}
// if (ellipsisLimit > 0)
// {
// output = Ext.util.Format.ellipsis(output, ellipsisLimit);
// }
return output;
}
//
===================================================================================
====
//
===================================================================================
====
// Render recipient list from and array.
// String sender - The subject string.
// [int ellipsisLimit] - A string beyond this length will be cut and added
ellipsis. Optional, default is 0 - no ellipsis.
// [bool useLinebreakes] - Should a line break be added after each recipient.
Optional, default is true.
function getSubject(subject, ellipsisLimit)
{
var output = subject;
if (ellipsisLimit == undefined)
{
ellipsisLimit = 0;
}
// if (ellipsisLimit > 0)
// {
// output = Ext.util.Format.ellipsis(output, ellipsisLimit);
// }
return output;
}
//
===================================================================================
====
//
===================================================================================
====
// tranform recipients array to string
function recipientsArr2Str(recipientsArr,type)
{
var recipientsList = "";
var address = "";
var commaNeeded = false;
for (var i=0; i<recipientsArr.length; i++)
{
if (type == recipientsArr[i].recipientType)
{
if (!commaNeeded)
commaNeeded = true;
else
recipientsList += ", ";
address = HTMLEncode(recipientsArr[i].address);
if (recipientsArr[i].isExternal)
{
address = '<span ' + GetDomainColor(recipientsArr[i].address)+' >'
+ address + '</span>'
}
recipientsList += address;
}
}
return recipientsList;
}
//
===================================================================================
====
function arr2Str(arr)
{
var str = "";
var commaNeeded = false;
for (var i=0; i<arr.length; i++)
{
if (!commaNeeded)
{
commaNeeded = true;
}
else
{
str += ", ";
}
str += arr[i];
}
return str;
}
function GetDomainColor(str)
{
// var highlightColors = new
Array("FFFF00","00FF00","00FFFF","FF00FF","FF0000","FFFF99","99FF99","CCFFFF","FFCC
FF", "FF9999")
var highlightColors = new
Array("FFFF00","FF00FF","FF0000","FFBB00","FF9999");
domainName = GetDomainName(str);
if (domainName==null) return null;
hash=0;
for (i=0; i<domainName.length; i++)
{
hash += domainName.charCodeAt(i);
}
hash = hash % (highlightColors.length);
return 'style="background-color: #' + highlightColors[hash] + '; text-
decoration: underline;"';
}
/*
//
===================================================================================
====
UserCheck.tools.clearContainer = function(containerId)
{
DEBUG.out("Clear container: "+containerId);
var container = Ext.getCmp(containerId);
if ((container) && (container.items))
{
container.items.each(
function(item)
{
container.remove(item, true);
}
);
}
}
//
===================================================================================
====
*/
genericPostErrorHandler(event);
//=================================================================================
============
window.genericErrorHandler = function(portalException, callback)
{
DEBUG.out("UserCheck::genericErrorHandler.");
if ((portalException == undefined) || (portalException == null))
{
portalException = new PortalException();
}
if (isNothingness(callback))
{
callback = new Callback();
}
//=================================================================================
============
window.genericPostErrorHandler = function(event)
{
DEBUG.out("UserCheck::genericPostErrorHandler.");
// Just hide the error.
hidePortalErrorMessage();
}
//=================================================================================
============
//=================================================================================
============
UserCheck.tools.sendErrorReport = function(userDesc, callback)
{
DEBUG.out("UserCheck.tools.sendErrorReport in.");
//=================================================================================
============
UserCheck.tools.handleErrorReportResponse = function(xhrStatus, xhrResponse,
callback)
{
DEBUG.out("UserCheck.tools.handleErrorReportResponse in.");
// Set error flag.
PORTAL_IS.TOOLS.errorMsgShown = false;
if (isNothingness(callback))
{
callback = new Callback();
}
if (xhrStatus != 200)
{
// TODO: Handle error.
DEBUG.out('Submitting error report failed. ('+xhrStatus+')',
DEBUG.ERROR);
callback.call();
showPortalMessage("Sending of error report failed.");
return;
}
callback.call();
//=================================================================================
============
UserCheck.tools.showErrorReport = function(callback)
{
DEBUG.out("UserCheck.tools.showErrorReport in.");
// Create new callback with send report and store previous callback in it.
submitCallback = new Callback();
submitCallback.methodReference = DEBUG.sendErrorReport;
submitCallback.args = [callback];
//=================================================================================
============
//=================================================================================
============
DEBUG.showErrorReport = UserCheck.tools.showErrorReport;
DEBUG.sendErrorReport = UserCheck.tools.sendErrorReport;
UserCheck.tools.oTimeoutManager =
{
timerID: -1,
startTimeoutTimer: function(duration, callback)
{
var milisecs = duration * 1000;
if (milisecs > 2147483646)
{
milisecs = 2147483646;
}
DEBUG.out("UserCheck.tools.TimeoutManager: Starting timer for " +
duration + " seconds.");
window.TimeoutManagerCallback = callback;
this.timerID = setTimeout("this.TimeoutManagerCallback();", milisecs);
},
stopTimeoutTimer: function()
{
clearTimeout(timerID);
timerID = -1;
}
};
UserCheck.DataObj = {};
// TODO: This should be defined as an "interface" class and other view managers
should implement it.
if (isNothingness(view))
{
view = "UserAction";
}
return view;
}
// Queries the server for next desired view and than call for rendering it.
// Will call upon callback when done rendering the view.
//===========================================================================
==================
this.gotoNextView = function(requestedView, callback)
{
DEBUG.out("UCViewManager::gotoNextView");
if (isNothingness(callback))
{
callback = new Callback();
}
// Check what is the next view.
var sAbsoluteURL = PORTAL_IS.TOOLS.getURL("GetNextView");
var parameters = (isNothingness(requestedView)) ? ("") :
("requestedView=" + encodeURIComponent(requestedView));
PORTAL_IS.AJAX_MGR.sendAsyncReq(sAbsoluteURL, parameters,
gotoNextViewCallback);
}
//===========================================================================
==================
if (isNothingness(callback))
{
callback = new Callback();
}
if (xhrStatus != 200)
{
DEBUG.out('Retreiving next view failed. ('+xhrStatus+')',
DEBUG.ERROR);
callback.call();
return;
}
// Extract the data (request params) from hash and relay it onto next
hash.
// As hash changing handler will be passed back to this method we set
the Ignore flag to TRUE
// and call for the gotoView method.
viewManager.changeHash(nextView, viewManager.parseHash().data, true);
viewManager.gotoView(nextView, callback);
}
//===========================================================================
==================
if (callback == undefined)
{
callback = new Callback();
}
sendAsynchronousRequest(PORTAL_IS.TOOLS.getURL("viewManager/GetViewData"),
parameters,
this.handleNewView,
this,
[callback]);
}
//===========================================================================
==================
if (xhrStatus != 200)
{
// TODO: Handle error.
DEBUG.out('Retreiving view failed. ('+xhrStatus+')',
DEBUG.ERROR);
callback.call();
return;
}
switch (newView)
{
default: // View will be rendered into main page view.
useDefaultContainerId = true;
requiredContainerId = this.defaultContainer;
break;
}
if (container != undefined)
{
// Render CSS. - Not needed, all CSS loads from one blob file.
//evaluateCSS(newViewJSONObj.css, "");
}
else if (requiredContainerId == this.defaultContainer)
{
}
else // The container is not present and needs to be rendered first.
{
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("JSONViewData/GetViewCustomContent");
sendAsynchronousRequest(sAbsoluteURL,
"view="+view,
this.renderCustomContent,
this,
[]);
}
//===========================================================================
==================
if (xhrStatus != 200)
{
// TODO: Handle error.
DEBUG.out('Retreiving custom content failed. ('+xhrStatus+')',
DEBUG.ERROR);
callback.call();
return;
}
// Override view.
switch (view)
{
case "ICS": // No brake, group these views.
case "Authentication":
case "ISW":
case "MultiChallenge":
case "IswEntry":
var usedView = "LoginSequencePage";
break;
default:
var usedView = view;
break;
}
//=================================================================================
============
//=================================================================================
============
this.renderDefaultView = function()
{}
//===========================================================================
=======================================
//===========================================================================
=======================================
this.logoutButtonHandler = function()
{}
//=================================================================================
=================================
// DEPRECATED METHODS
//
___________________________________________________________________________________
______________________________
</script>
<div id='portalErrorMessage'
class="portalErrorMessageDivHide">
<tr id="portalErrorMessage_title_container_row"
class="portalMessage_title show" width="100%">
<td
id="portalErrorMessage_title_container" height="10px" valign="middle" align="left"
colspan="2"> </td>
</tr>
<tr>
<td id="portalErrorMessage_container"
align="left" style="padding: 10px;" colspan="2"> </td>
</tr>
<tr>
<td>
<table cellpadding="0px"
cellspacing="0px" width="100%"style=" padding: 10px;">
<tr>
<td
id="portalMessage_error_report_container" align="left" valign="buttom"
class="hide">
<span
id="portalMessage_error_report_link" onclick="DEBUG.showErrorReport();"
class="portal_link" style="left: 10px;">
Send error
report </span>
</td>
<td
id="portalMessage_error_button_container" align="right" height="10px;"
valign="buttom">
<button
id="portalErrorMessage_button" class="portalErrorMessage_button"
onclick="hidePortalErrorMessage();">
OK
</button>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<tr id="portalMessage_title_container_row"
class="portalMessage_title show">
<td id="portalMessage_title_container"
class="portalMessage_title_td" valign="middle" align="left">
</td>
</tr>
<tr>
<td id="portalMessage_container"
align="left" style="padding: 10px;">
</td>
</tr>
<tr id="portalMessage_textarea_container_row"
class="hide">
<td id="portalMessage_textarea_container"
align="left" style="padding: 10px;">
</td>
</tr>
<tr
id="portalMessage_validation_message_container_row" class="show">
<td
id="portalMessage_validation_message_container" align="left"
class="portalMessage_validation_submessage" style="padding: 10px;">
</td>
</tr>
<tr id="portalMessage_submessage_container_row"
class="hide">
<td
id="portalMessage_submessage_container" align="left"
class="portalMessage_submessage" style="padding: 10px;">
</td>
</tr>
<tr>
<td align="center" height="10px;"
valign="buttom" style="padding: 10px;" colspan="2">
<div
id="portalMessage_ok_button_container" class="show" style="text-align: right;">
<button
id="portalMessage_button" class="portalMessage_button"
onclick="hidePortalMessage();">
OK
</button>
</div>
<div
id="portalMessage_bool_button_container" class="hide">
<button
id="portalMessage_yes_button" class="portalMessage_button"
onclick="hidePortalMessage();">
BUTTON.YES
</button>
<button
id="portalMessage_no_button" class="portalMessage_button"
onclick="hidePortalMessage();">
BUTTON.NO
</button>
</div>
<div
id="portalMessage_submit_button_container" class="hide">
<button
id="portalMessage_submit_button" class="portalMessage_button"
onclick="hidePortalMessage();">
BUTTON.SUBMIT
</button>
<button
id="portalMessage_cancel_button" class="portalMessage_button"
onclick="hidePortalMessage();">
Cancel
</button>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id='portalGeneralContainer' class="portalMessageDivHide">
<tr
id="portalGeneralContainer_title_container_row" class="portalMessage_title show"
width="100%">
<td
id="portalGeneralContainer_title_container" height="10px" valign="middle"
align="left">
</td>
</tr>
<tr>
<td id="portalGeneralContainer_container"
align="left" style="padding: 10px;">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
UserCheck.DataObj.IID = "6D58A228-1B54-7532-F743-E0D65F409612";
UserCheck.DataObj.frame = 0;
/*this is a common object for PortalMain and PortalMainDlp. functions here
should be empty */
window.UserActionCommon = function()
{
this.DlpHttpLearning = function(adminMessage,HttpLearningEnabled)
{
}
this.DlpHideCancelBtn = function(action)
{
}
}
//Toggles the button's state from enabled to disabled and vice versa.
setButtonMode = function(buttonState, buttonID)
{
var button = document.getElementById(buttonID);
if(button == null)
return;
window.UserAction = function()
{
this.incidentObject = {};
this.textAreaText = "";
this.getCorrectClass = function()
{
var correctClass = "class";
//Choose the correct class attribute name (in IE6-7 we need "className"
instead of "class") according to IE version - but check for compatibility first!
if(window.browserDetails.browserType == window.BrowserType.IE &&
window.browserDetails.browserVersion <= 7 && document.documentMode === undefined)
{
correctClass = "className";
}
return correctClass;
}
// Initialize.
//===========================================================================
==================
this.init = function(cancelPage)
{
if(window.browserDetails.browserType == window.BrowserType.IE &&
window.browserDetails.browserVersion <= 7 && document.documentMode === undefined)
{
document.getElementById('usercheck_main_div').innerHTML = "<h3>"
+ PORTAL_IS.L10N.L10N_Obj.getStr("IE6_MESSAGE1") + "</h3><p>"+
PORTAL_IS.L10N.L10N_Obj.getStr("IE6_MESSAGE2") + "</p>";
return;
}
if (typeof cancelPage == 'undefined')
{
cancelPage = false;
}
var requestData = {
IID: "-1",
UserID: "",
IsThinPortal: false,
UserLang: "",
GetCancelPage: cancelPage
};
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("data/GetUserCheckIncidentData");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleUserCheckIncidentData,
this,
[new Callback()]);
}
//Changes the button CSS class (support for IE6-8). buttonCLS is for
additional classes to be added to the button.
this.setButtonState = function(state, buttonID, buttonCLS)
{
if (!buttonID)
{
buttonID = 'UserCheck_OK_Button';
buttonCLS = '';
}
if(button.getAttribute(correctClass).indexOf("Disabled") == -1)
{
//The button is not disabled.
button.setAttribute(correctClass, "button button" + state + " " +
buttonCLS);
}
}
//Changes the button CSS class (support for IE6-8). buttonCLS is for additional
classes to be added to the button.
this.setSendButtonState = function(state, buttonID, buttonCLS)
{
if (!buttonID)
{
buttonID = 'UserCheck_OK_Button';
buttonCLS = '';
}
if(button.getAttribute(correctClass).indexOf("Disabled") == -1)
{
//The button is not disabled.
button.setAttribute(correctClass, buttonCLS);
}
}
if (callback == undefined)
{
callback = new Callback();
}
if (xhrStatus != 200)
{
DEBUG.out('Retreiving UserCheck Incident Data failed.
('+xhrStatus+')', DEBUG.ERROR);
callback.call();
return;
}
this.incidentObject = JSON.parse(xhrResponse);
var Languages = this.incidentObject.Languages;
var UserCheckLogoID = this.incidentObject.UserCheckLogoID;
var RedirectToAddr = this.incidentObject.RedirectToAddr;
var AutoRedirect = this.incidentObject.AutoRedirect;
var ExternalSystemURL = this.incidentObject.ExternalSystemURL;
var Action = this.incidentObject.Action;
var Variables = this.incidentObject.Variables;
this.incidentObject.HasBeenCancelled = false;
window.location = RedirectToAddr;
}
else
window.location = "about:blank"; //No reason to redirect
in the Thin Portal
}
}
else
{
if (Action == "SCRUB-SUCCESS")
{
// in scrub success page, if not mobile or thin, give more
space for the list of original files names and info
if(window.browserDetails.isMobile() === false &&
window.isThinPortal === undefined)
{
var content_table =
document.getElementById("usercheck_content_table");
if (content_table != null)
{
content_table.style.tableLayout="auto";
}
var message_div =
document.getElementById("usercheck_main_div");
if (message_div != null)
{
message_div.style.minWidth="auto";
message_div.style.maxWidth="1000px";
message_div.style.wordWrap="normal";
message_div.style.overflow="auto";
}
}
var requestData = {
IID: "-1"
};
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("data/GetScrubFiles");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleScrubbingFiles,
this,
[new Callback()]);
}
}
if(ExternalSystemURL != "")
//We have an external system address so redirect to that URL.
// window.location = ExternalSystemURL +
(this.incidentObject.ForwardParams == true ? "?IncidentID=" + UserCheck.DataObj.IID
+ "&UserID=" + this.incidentObject.UserID : "");
if (this.incidentObject.ForwardParams == true)
{
window.location = ExternalSystemURL + "?
IncidentID=" + UserCheck.DataObj.IID + "&UserID=" + this.incidentObject.UserID;
}
else
{
window.location = ExternalSystemURL;
}
this.prepareLanguageSelection();
document.body.innerHTML = url;
document.body.style.backgroundImage = 'none';
document.body.style.textAlign = 'center';
document.body.style.verticalAlign = 'text-bottom';
}
thin_table.setAttribute(correctClass,
"usercheck_main_mobile_background_class with_logo");
}
}
else
{
var logo_footer = document.getElementById('footer_table_logo');
if(logo_footer != null && Action != 'BLOCK' && Action != 'LIMIT')
{
var correctClass = window.oUserAction.getCorrectClass();
logo_footer.setAttribute(correctClass,
"usercheck_footer_table_class footer_logo");
}
}
if(Action == 'BLOCK'){
document.getElementById("usercheck_title_div").style.color =
"#ed5552";
document.getElementById("usercheck_logo_img_div").style.display =
"none";
}else{
document.getElementById("usercheck_title_div").style.color =
"#0d87cd";
}
g_userID = this.incidentObject.UserID;
if (Action == "SCRUB-SUCCESS")
{
Action = "INFORM";
}
//Draw incident image according to the incident type
if(document.getElementById('usercheck_img_div') !== null){
document.getElementById('usercheck_img_div').innerHTML =
draw_img_tag(getURL("img/" + Action.toLowerCase() + ".png"));
if(this.incidentObject.IsLogoConfigured)
{
//The page has a logo defined in the GUI - load it.
//Desktop header.
var header_right_logo =
document.getElementById('usercheck_header_right_logo');
if(header_right_logo != null)
if(window.browserDetails.browserType ==
window.BrowserType.IE && window.browserDetails.browserVersion <= 7)
header_right_logo.style.display = "block";
else
header_right_logo.style.display = "table-cell";
var header_right_empty =
document.getElementById('usercheck_header_right_empty');
if(header_right_empty != null)
header_right_empty.style.display = "none";
//Mobile header.
var mobile_header = document.getElementById('header_mobile_div');
if(mobile_header != null)
{
mobile_header.style.display = "block";
}
//Company logo.
var company_logo =
document.getElementById('usercheck_company_logo');
if(company_logo != null)
company_logo.src = getURL("images/interactions/" +
UserCheckLogoID + ".png");
}
else
{
//If there is no logo defined, hide it as it will cause an error
on IE
//additionally, according to preview design the agent should not
have logo in this case too
var company_logo =
document.getElementById('usercheck_company_logo');
if(company_logo != null)
company_logo.style.display = "none";
}
//Start the timeout manager. Do not start this for TeX as its timeout
is huge and will fail verification in the daemon
if (Variables['product'] != 'Threat Extraction')
UserCheck.tools.oTimeoutManager.startTimeoutTimer(this.incidentObject.Expiration -
15, this.handleTimeout);
callback.call();
}
this.submitOK = function()
{
//This function determines if it is OK to proceed with sending a
response if all validation criteria are met.
if(document.getElementById('UserCheck_Textual_Input') != null)
//Verify we have the real textarea!
if(document.getElementById('UserCheck_Textual_Input').value !==
undefined)
//Unfocus the text-area.
document.getElementById('UserCheck_Textual_Input').blur();
if(!window.oUserAction.highlightInput())
//There was some user input missing - don't continue.
return;
requestData.IID = "-1";
requestData.UserOption = "OK";
requestData.UserID = cookie;
requestData.IsReasonExist = true;
if(document.getElementById('UserCheck_Textual_Input') != null)
{
var reason =
document.getElementById('UserCheck_Textual_Input').value;
requestData.Reason = reason;
}
else
{
requestData.IsReasonExist = false;
}
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("data/GetUserCheckUserChoiceData");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleUserCheckChoiceData,
this,
[new Callback()]);
}
this.submitCancel = function()
{
if(window.oUserAction.incidentObject.CancelURL !== undefined &&
window.oUserAction.incidentObject.CancelURL !== "")
{
window.location = window.oUserAction.incidentObject.CancelURL;
return;
}
else
{
if (window.isThinPortal == true)
{
window.location = "about:blank";
return;
}
this.init(true);
}
}
DEBUG.out("UserAction::handleUserCheckChoiceData");
if (callback == undefined)
{
callback = new Callback();
}
if (xhrStatus != 200)
{
DEBUG.out('Retreiving UserCheck Incident Data failed.
('+xhrStatus+')', DEBUG.ERROR);
callback.call();
return;
}
frame = UserCheck.DataObj.frame;
//handle case of Ok on an email message approval of a content
awareness violation. In this case we dont want to redirect, but show a message that
tells to resend
if
(window.oUserAction.incidentObject.Variables['violation_protocol'] === 'Email
message' && window.oUserAction.incidentObject.Variables['product'] === 'apcl'){
var usercheck_main_div =
document.getElementById('usercheck_main_div');
if (usercheck_main_div != null)
usercheck_main_div.innerHTML = "<p>"
+PORTAL_IS.L10N.L10N_Obj.getStr("CTNT_EMAIL_CONFIRM")+"</p>";
var okbtnDiv = document.getElementById('usercheck_ok_div');
var cancelbtnDiv =
document.getElementById('usercheck_cancel_div');
if (okbtnDiv != null && cancelbtnDiv != null){
if (window.isThinPortal === undefined){
okbtnDiv.style.display = "none";
cancelbtnDiv.style.display = "none";
}
else {
//handle client case - need to show a cancel
button so the client window can be closed
okbtnDiv.style.display = "none";
cancelbtnDiv.style.marginLeft = "auto";
cancelbtnDiv.style.marginRight = "auto";
var span =
document.getElementById('UserCheck_Cancel_Button_span');
if(span != null)
span.innerHTML =
PORTAL_IS.L10N.L10N_Obj.getStr('BUTTON.CLOSE');
}
}
return;
}
window.opener.location = RedirectToAddr;
}
else
{
window.opener.location = "about:blank";
}
window.close();
}
}
else
{
var frame = "0";
frame = UserCheck.DataObj.frame;
if(typeof frame === "undefined" || frame == "0" || frame ==
"")
{
if (window.isThinPortal == true)
{
window.location = "about:blank";
}
}
else
{
if (window.isThinPortal == true)
{
window.opener.location = "about:blank";
}
window.close();
}
}
}
else
{
window.location.reload();
}
}
this.handleUserReportWrongCategoryData = function(xhrStatus, xhrResponse,
callback)
{
DEBUG.out("UserAction::handleUserLogData");
this.handleTimeout = function()
{
var requestData = {
IID: "-1"
};
requestData.IID = UserCheck.DataObj.IID;
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
window.oUserAction.handleTimeoutExtension,
this,
[new Callback()]);
}
if (callback == undefined)
{
callback = new Callback();
}
if (xhrStatus != 200)
{
if (window.isThinPortal === undefined)
{
DEBUG.out('Retreiving UserCheck Timeout Extension data
failed. ('+xhrStatus+')', DEBUG.ERROR);
callback.call();
return;
}
else
{
window.location = "about:blank";
return;
}
}
var extensionObject = JSON.parse(xhrResponse);
if(extensionObject.ReturnCode == "SUCCESS")
{
if(extensionObject.Expiration > 15){
UserCheck.tools.oTimeoutManager.startTimeoutTimer(extensionObject.Expiration
- 15, window.oUserAction.handleTimeout);
}
}
else
{
if(window.isThinPortal === undefined)
{
var button = document.getElementById('UserCheck_OK_Button');
if(button !=null)
button.style.display = "none";
var select =
document.getElementById('usercheck_language_selection');
if(select != null)
select.disabled = true;
showPortalMessage(PORTAL_IS.L10N.L10N_Obj.getStr("TIMEOUT") + "
<a href='" + window.oUserAction.incidentObject.RedirectToAddr + "'>" +
PORTAL_IS.L10N.L10N_Obj.getStr("RETRY") + "</a>", null,
PORTAL_IS.MESSAGE_TYPE.Display, true);
}
else
{
/* If we are in thin portal, redirect to about:blank
so that client can catch it and act accordingly. */
window.location = "about:blank";
}
}
}
prevSelectedLanguage =
PORTAL_IS.L10N.L10N_Obj.selectLanguage(langArr);
}
if(document.getElementById('usercheck_language_selection_div') != null)
{
count = 0;
var select =
document.getElementById('usercheck_language_selection');
select.options.length = 0;
for(var Language in Languages)
{
select =
document.getElementById('usercheck_language_selection');
select.options[select.options.length] = new
Option(Languages[Language].Language, Language, false, Language ===
prevSelectedLanguage);
count++;
}
//Display language selection only if NOT in thin portal.
if(count > 1 && window.isThinPortal === undefined)
document.getElementById('usercheck_language_selection_div').style.display =
"block";
else
{
document.getElementById('usercheck_language_selection_div').style.display =
"none";
}
}
this.handleLanguageChange(true, userSelected);
}
this.checkBoxExists = function(adminMessage)
{
if(adminMessage.indexOf("UserCheck_Confirm_Checkbox") != -1)
return true;
return false;
}
this.textareaExists = function(adminMessage)
{
if(adminMessage.indexOf("UserCheck_Textual_Input") != -1)
return true;
return false;
}
this.asyncLanguageChangeCallback = function(userSelected)
{
if (userSelected === undefined)
{
userSelected = true;
}
var select = document.getElementById('usercheck_language_selection');
var check = document.getElementById('UserCheck_Confirm_Checkbox');
sendAsynchronousRequest(getURL("UpdateUserData"),
"Language="+encodeURIComponent(selectedLanguage) +
"&IID="+encodeURIComponent(UserCheck.DataObj.IID)+"&UserID="+cookieVal,
handleUpdateUserDataResponse,
this,
[new Callback()]);
}
else
{
document.getElementById('usercheck_title_div').innerHTML =
TitleText;
if(window.oUserAction.incidentObject.HasBeenCancelled ===
undefined || window.oUserAction.incidentObject.HasBeenCancelled === false)
{
if (window.oUserAction.incidentObject.IncidentStatus == 0
|| window.oUserAction.incidentObject.IncidentStatus == 2 ||
window.oUserAction.incidentObject.IncidentStatus == 8)//ok or cancel or
ok_scrubbing
{
document.getElementById('usercheck_main_div').innerHTML = AdminMessage;
}
else if (window.oUserAction.incidentObject.IncidentStatus
== 3)// sent
{
// if http learning is enabled on action succeded
show the HTTP_LEARNING message
if (HTTPLearningEnabled == true &&
window.oUserAction.incidentObject.RedirectToAddr != "")
{
var usercheck_main_div =
document.getElementById('usercheck_main_div')
if (usercheck_main_div != null)
usercheck_main_div.innerHTML = "<p>"
+PORTAL_IS.L10N.L10N_Obj.getStr("HTTP_LEARNING")+"</p>";
}
else // an SMTP message
{
document.getElementById('usercheck_main_div').innerHTML = AdminMessage;
}
}
else if (window.oUserAction.incidentObject.IncidentStatus
== 4)//discarded
{
document.getElementById('usercheck_main_div').innerHTML = AdminMessage;
}
else if (window.oUserAction.incidentObject.IncidentStatus
== 5)//already sent
{
if (HTTPLearningEnabled == true &&
window.oUserAction.incidentObject.RedirectToAddr != "")
{
//if approved http and then refreshed the page
var usercheck_main_div =
document.getElementById('usercheck_main_div')
if (usercheck_main_div != null)
usercheck_main_div.innerHTML = "<p>"
+PORTAL_IS.L10N.L10N_Obj.getStr("HTTP_LEARNING")+"</p>";
}
else
{
document.getElementById('usercheck_main_div').innerHTML = AdminMessage;
var return_to_site_div =
document.getElementById('usercheck_return_to_site_div')
if (return_to_site_div != null)
return_to_site_div.innerHTML = "<p
style='color: #FF5000;font-weight: bold;'>"
+PORTAL_IS.L10N.L10N_Obj.getStr("EMAIL_ALREADY_SENT") +"</p>";
}
}
else if (window.oUserAction.incidentObject.IncidentStatus
== 6)//already discarded
{
document.getElementById('usercheck_main_div').innerHTML = AdminMessage;
var return_to_site_div =
document.getElementById('usercheck_return_to_site_div')
if (return_to_site_div != null)
return_to_site_div.innerHTML = "<p
style='color: #FF5000;font-weight: bold;'>"
+PORTAL_IS.L10N.L10N_Obj.getStr("EMAIL_ALREADY_DISCARDED") +"</p>";
}
else
{
document.getElementById('usercheck_main_div').innerHTML = "<p>" +
PORTAL_IS.L10N.L10N_Obj.getStr("UNKOWN_INCIDENT_STATUS") + "</p>" +
window.oUserAction.incidentObject.IncidentStatus;
}
document.getElementById('usercheck_cancel_div').style.display = "none";
if( document.getElementById('usercheck_ok_div')
!= null){
//alert("entered first");
document.getElementById('usercheck_ok_div').style.marginRight = "auto";
document.getElementById('usercheck_ok_div').style.marginLeft = "auto";
}
var dlp_block_div =
document.getElementById('usercheck_cancel_div');
if(dlp_block_div != null)
{
document.getElementById('usercheck_cancel_div').style.marginTop = "0px";
}
dlp_block_div =
document.getElementById('usercheck_scrollable_div'); //if this is the client
if(dlp_block_div != null){
document.getElementById('usercheck_scrollable_div').style.height = "250px";
}
}
if(window.oUserAction.incidentObject.Action ==
"ASK"){
var is_client =
document.getElementById('usercheck_scrollable_div'); //if this is the client
if(is_client != null){
var checkBox_td =
document.getElementById('UserCheck_checkbox_td');
if(checkBox_td != null){
//for ask client with
checkbox, move padding-top to 0px
document.getElementById('UserCheck_checkbox_td').style.paddingTop = "0px";
}
}
}
}
btnDiv = document.getElementById('usercheck_send_div');
// show the send button on SMTP (which is actually the send
button) OR show it on inform action (which is actually OK button)
if (btnDiv != null &&
(window.oUserAction.incidentObject.RedirectToAddr == "" ||
window.oUserAction.incidentObject.Action == "INFORM") )
{
btnDiv.innerHTML = SendButtonMessage;
var is_client =
document.getElementById('usercheck_scrollable_div'); //if this is the client
if(is_client != null)
{
document.getElementById('usercheck_send_div').style.marginLeft = "15%";
}else
{
document.getElementById('usercheck_send_div').style.marginLeft = "auto";
}
if(document.getElementById('usercheck_middle_div') != null)
{
document.getElementById('usercheck_middle_div').style.marginRight = "auto";
document.getElementById('usercheck_middle_div').style.marginLeft = "auto";
}
}else if(btnDiv != null &&
window.oUserAction.incidentObject.Action == "ASK"){
document.getElementById('usercheck_send_div').style.display = "none";
}
btnDiv = document.getElementById('usercheck_middle_div');
if (btnDiv != null)
{
btnDiv.innerHTML = MiddleButtonMessage;
}
var goBackDiv =
document.getElementById('usercheck_return_to_site_div');
if (goBackDiv)
{
// show return to site only when its http violation
AND if the action is: sent or discarded or already sent or already discarded or
cancelled.
if
(window.oUserAction.incidentObject.RedirectToAddr != "" &&
(window.oUserAction.incidentObject.IncidentStatus == 3 ||
window.oUserAction.incidentObject.IncidentStatus == 4 ||
window.oUserAction.incidentObject.IncidentStatus == 5 ||
window.oUserAction.incidentObject.IncidentStatus == 6 ||
window.oUserAction.incidentObject.IncidentStatus == 2))
{
goBackDiv.innerHTML = '<a href="' +
window.oUserAction.incidentObject.RedirectToAddr + '">' +
PORTAL_IS.L10N.L10N_Obj.getStr("RETURN_TO_SITE") + '</a>';
}
}
}
else
document.getElementById('usercheck_main_div').innerHTML =
CancelMessage;
span = document.getElementById('UserCheck_Send_Button_span');
if(span != null)
span.innerHTML =
PORTAL_IS.L10N.L10N_Obj.getStr('BUTTON.SEND');
span = document.getElementById('UserCheck_Middle_Button_span');
if(span != null)
{
if (window.oUserAction.incidentObject.RedirectToAddr == "")
{
span.innerHTML =
PORTAL_IS.L10N.L10N_Obj.getStr('BUTTON.DISCARD');
}
else{
span.innerHTML =
PORTAL_IS.L10N.L10N_Obj.getStr("BUTTON.APPROVE");
span.style.paddingRight = "27px";
span.style.paddingLeft = "29px";
}
}
var reportLink =
document.getElementById('UserCheck_Wrong_Category');
if(reportLink != null)
{
var correctClass = window.oUserAction.getCorrectClass();
reportLink.setAttribute(correctClass,
"usercheck_url_class");
reportLink.onclick = function(e)
{ window.oUserAction.sendReport(); }
}
if(window.oUserAction.textareaExists(AdminMessage))
{
textarea_element =
document.getElementById('UserCheck_Textual_Input');
//If the textarea is an incorrect element or length is
correct, check passes.
if(textarea_element.value === undefined)
{
//This element is not really our text area so we
don't need it.
textarea_element = null;
}
}
if(textarea_element != null)
{
window.oUserAction.textAreaText = textarea_element.value;
textarea_element.onfocus = function()
{ window.oUserAction.clearRequiredInput(); };
}
//disable the approve button only on PortalMaindlp. on thin
client approve button should always be enabled
if (window.oUserAction.incidentObject.RedirectToAddr != "" &&
window.isThinPortal != true)
{
window.oUserActionCommon.DlpHttpLearning(AdminMessage,HTTPLearningEnabled);
}
// hiding the cancel and middle button on inform and block on dlp
only
window.oUserActionCommon.DlpHideCancelBtn(window.oUserAction.incidentObject.Action)
;
}
}
//Get the application name. If this variable has been modified (added
application icon for example), take the original.
var appname = Variables['application_name_orig'];
var malwareID = Variables['application_id'];
if(appname === undefined)
appname = Variables['application_name'];
requestData.IID = "-1";
requestData.UserOption = "LOG-WRONG-CATEGORY";
requestData.UserID = cookie;
requestData.IsReasonExist = false;
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("data/GetUserCheckUserChoiceData");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleUserReportWrongCategoryData,
this,
[new Callback()]);
this.handleReportTimeout = function()
{
var elem = document.getElementById('testID');
document.getElementsByTagName('head')[0].removeChild(elem);
}
var AdminMessage =
window.oUserAction.incidentObject.Languages[window.oUserAction.incidentObject.Selec
tedLanguage].AdminMessage;
//If the checkbox exists (and it is a correct element), its value will
determine the button status.
if(window.oUserAction.incidentObject.IsCheckBoxEnforced == true &&
window.oUserAction.checkBoxExists(AdminMessage) == true &&
document.getElementById('UserCheck_Confirm_Checkbox').checked !== undefined)
{
checkbox_element =
document.getElementById('UserCheck_Confirm_Checkbox');
checkbox_ready = checkbox_element.checked;
}
else
checkbox_ready = true;
//If the reason textbox exists and is enforced, its value will
determine the button status.
if(window.oUserAction.incidentObject.IsReasonEnforced === true &&
window.oUserAction.textareaExists(AdminMessage))
{
textarea_element =
document.getElementById('UserCheck_Textual_Input');
if(checkbox_element != null)
{
checkbox_element.parentNode.parentNode.parentNode.parentNode.setAttribute(correctCl
ass, (checkbox_ready ? "usercheck_red_no_highlight" : "usercheck_red_highlight" ));
elememt_to_scroll = checkbox_ready ? elememt_to_scroll :
checkbox_element.parentNode.parentNode.parentNode.parentNode;
}
if(textarea_element != null)
{
textarea_element.setAttribute(correctClass,
"usercheck_message_class usercheck_textual_input_class " + (textarea_ready ?
"usercheck_red_no_highlight" : "usercheck_red_highlight
usercheck_textual_input_class_required" ));
elememt_to_scroll = textarea_ready ? elememt_to_scroll :
textarea_element;
if(!textarea_ready)
{
if(window.oUserAction.textAreaText === "" ||
textarea_element.value !== window.oUserAction.textAreaText)
{
if(window.oUserAction.textAreaText != "")
textarea_element.value =
window.oUserAction.textAreaText;
else
textarea_element.value =
PORTAL_IS.L10N.L10N_Obj.getStr("ENTER_TEXT");
}
textarea_element.onfocus = function()
{ window.oUserAction.clearRequiredInput(); };
}
}
if(checkbox_element.parentNode.parentNode.parentNode.parentNode.offsetTop >
textarea_element.offsetTop)
elememt_to_scroll = checkbox_element;
if(elememt_to_scroll!=null){
elememt_to_scroll.scrollIntoView(false);
var scrollableDiv =
document.getElementById("usercheck_scrollable_div");
if (scrollableDiv !== null)
scrollableDiv.scrollLeft = 0;
}
return all_ready;
}
this.clearRequiredInput = function()
{
textarea_element = document.getElementById('UserCheck_Textual_Input');
textarea_element.value = "";
if(textarea_element.getAttribute(correctClass).indexOf("usercheck_red_highlight") !
== -1){
textarea_element.setAttribute(correctClass, "usercheck_message_class
usercheck_textual_input_class usercheck_red_highlight");
}
else
textarea_element.setAttribute(correctClass,
"usercheck_message_class usercheck_textual_input_class");
textarea_element.onfocus = function() { };
}
this.sendMail = function()
{
DEBUG.out("UserAction::sendMail");
this.last_action = 'sent';
if(!window.oUserAction.highlightInput())
//There was some user input missing - don't continue.
return;
this.discardMail = function()
{
DEBUG.out("UserAction::deleteMail");
this.last_action = 'delete';
requestData.Reason = reason;
}
else
{
requestData.IsReasonExist = false;
}
}
//Sometimes the cookie is not written correctly, so used global
user.
if(requestData.UserID == null || requestData.UserID == "")
requestData.UserID = g_userID;
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL =
PORTAL_IS.TOOLS.getURL("data/GetUserCheckUserChoiceData");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleUserCheckChoiceData,
this,
[new Callback()]);
}
}
this.goToBlank = function()
{
window.location = "about:blank";
}
this.ApproveHttp = function()
{
this.sendMail();
}
this.name_show = function(target)
{
document.getElementById(target).style.display = 'inline';
}
this.name_hide = function(target)
{
document.getElementById(target).style.display = 'none';
}
this.expand_link = function(target,data)
{
//simple code for chrome and FF
//document.getElementById(target).innerHTML = data;
this.isEmailAddressValid = function(inputvalue)
{
var pattern=/^[^@;\s<>]+@[^@;\s<>]+\.[^@;\s<>]+$/;
if(pattern.test(inputvalue))
{
return true;
}
else
{
return false;
}
}
this.highlightScrubInput = function()
{
var correctClass = window.oUserAction.getCorrectClass();
var textarea_ready = false;
textarea_element = document.getElementById('send_original_email_textarea');
var errorElement = document.getElementById('scrub_error_div');
var isValidEmail = false;
//If the textarea is an incorrect element or length is correct, check
passes.
if(textarea_element.value != null)
{
isValidEmail =
window.oUserAction.isEmailAddressValid(textarea_element.value);
error_string = isValidEmail ? "" :
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_EMAIL_INVALID");
if(errorElement != null)
{
errorElement.innerHTML = isValidEmail ? "" : "<br/><span
style='color: #FF0000; display=inline'>* " +
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_INVALID_EMAIL") + "</span>";
}
}
textarea_element.setAttribute(correctClass, (textarea_ready ?
"usercheck_red_no_highlight" : "usercheck_red_highlight " ));
if(!textarea_ready)
{
if(textarea_element.value === "")
{
textarea_element.value =
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_SEND_EMAIL_EXAMPLE");
textarea_element.setAttribute(correctClass,
"usercheck_red_highlight");
}
if(textarea_element.value ===
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_SEND_EMAIL_EXAMPLE"))
{
textarea_element.onfocus = function()
{ window.oUserAction.clearScrubRequiredInput(); };
}
}
}
var scrub_send_email_result =
document.getElementById('scrub_send_email_result_div');
if(scrub_send_email_result != null)
{
scrub_send_email_result.innerHTML = "";
}
return textarea_ready;
}
this.clearScrubRequiredInput = function()
{
textarea_element =
document.getElementById('send_original_email_textarea');
textarea_element.value = "";
var correctClass = window.oUserAction.getCorrectClass();
if(textarea_element.getAttribute(correctClass) &&
textarea_element.getAttribute(correctClass).indexOf("usercheck_red_highlight") !==
-1)
textarea_element.setAttribute(correctClass,
"usercheck_red_highlight");
else
textarea_element.setAttribute(correctClass, "");
textarea_element.onfocus = function() { };
}
this.ScrubSendOriginalMail = function(IID)
{
receipientarea_element =
document.getElementById('send_original_email_textarea');
if(receipientarea_element != null)
{
if(document.getElementById('send_original_email_textarea').value !==
undefined)
//Unfocus the text-area.
document.getElementById('send_original_email_textarea').blur();
if(!window.oUserAction.highlightScrubInput())
//There was some user input missing - don't continue.
return;
textarea_element =
document.getElementById('send_original_email_textarea');
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
this.handleScrubSendEmailResponse,
this,
[new Callback()]);
}
}
if (xhrStatus != 200)
{
DEBUG.out('Scrub Sending Email failed. ('+xhrStatus+')',
DEBUG.ERROR);
callback.call();
return;
}
this.SendingEmailStatus = JSON.parse(xhrResponse);
this.result = this.SendingEmailStatus.mailActionStatus;
var scrub_send_email_result =
document.getElementById('scrub_send_email_result_div');
if(scrub_send_email_result == null)
{
return;
}
setCookie('Scrub_UserEmail',PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_SEND_EMAIL_EXA
MPLE") , 30);
scrub_send_email_result.innerHTML = "<br/><span style='color:
#FF0000;'>" + PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_SEND_EMAIL_ERROR") +
"</span>";
}
this.createScrubbingSendOrigMailOption = function()
{
var send_orig_option = "";
var cookie = getCookie('Scrub_UserEmail');
var image = "images/confirmation.png";
var toolTip =
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_SEND_ORIGINAL_EMAIL");
if(g_BlockSendMail == true)
{
image = "img/block.png";
toolTip =
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_MAIL_BLOCKED_BY_POLICY");
if(g_refreshFiles == true)
{
image = "img/loader.gif";
toolTip =
PORTAL_IS.L10N.L10N_Obj.getStr("CP_SCRUB_FILE_STATUS_WAITING_FOR_TE");
}
}
send_orig_option += "</li>";
send_orig_option += "</ul>";
send_orig_option += "</div>";
return send_orig_option;
}
if (xhrStatus != 200)
{
DEBUG.out('Retreiving UserCheck Incident Data failed.
('+xhrStatus+')', DEBUG.ERROR);
callback.call();
return;
}
this.scrubbingResponse = JSON.parse(xhrResponse);
g_refreshFiles = false;
g_BlockSendMail = false;
var scrub_links_simple = document.getElementById('links_simple');
if (scrub_links_simple != null)
{
if (scrub_links_simple.hasChildNodes())
scrub_links_simple.removeChild(scrub_links_simple.childNodes[0]);
var tmp = document.createElement("div");
tmp.innerHTML =
window.oUserAction.createScrubbingLinks(attachments, false);
scrub_links_simple.appendChild(tmp);
}
scrub_links_extended.removeChild(scrub_links_extended.childNodes[0]);
var tmp = document.createElement("div");
tmp.innerHTML =
window.oUserAction.createScrubbingLinks(attachments, true);
scrub_links_extended.appendChild(tmp);
}
document.getElementById('usercheck_content_table').style.width =
'auto';
if (scrub_send_orig_mail != null)
{
if (scrub_send_orig_mail.hasChildNodes())
scrub_send_orig_mail.removeChild(scrub_send_orig_mail.childNodes[0]);
var tmp = document.createElement("div");
tmp.innerHTML =
window.oUserAction.createScrubbingSendOrigMailOption();
scrub_send_orig_mail.appendChild(tmp);
var scrub_orig_eml_textarea =
document.getElementById('send_original_email_textarea');
if(scrub_orig_eml_textarea != null)
{
scrub_orig_eml_textarea.onfocus = function()
{ window.oUserAction.clearScrubRequiredInput(); };
}
if(g_BlockSendMail == true)
{
setButtonMode(false,'send_original_email_button')
}
}
if (g_refreshFiles)
{
UserCheck.tools.oTimeoutManager.startTimeoutTimer(30,
window.oUserAction.refreshScrubbingFiles);
}
callback.call();
}
this.refreshScrubbingFiles = function()
{
var requestData = {
IID: "-1"
};
requestData.IID = UserCheck.DataObj.IID;
var sAbsoluteURL = PORTAL_IS.TOOLS.getURL("data/GetScrubFiles");
sendAsynchronousRequest(sAbsoluteURL,
flattenObject(requestData),
window.oUserAction.handleScrubbingFiles,
this,
[new Callback()]);
}
this.showOrHideRemovedPartsfromFiles = function(FileIndex)
{
var infoimg_element = document.getElementById('infoimg_' + FileIndex);
var removed_parts_element = document.getElementById('removed_parts_' +
FileIndex);
</script>
</html>