* * Improper changes to this file may cause critical errors. ***************************************************************************************/ if (!defined("IN_LIVEZILLA")) { die; } require LIVEZILLA_PATH . "_lib/objects.external.inc.php"; require LIVEZILLA_PATH . "_lib/functions.external.inc.php"; if (isset($_POST[POST_EXTERN_SERVER_ACTION])) { languageSelect(); initData(array("GROUPS", "FILTERS")); $externalUser = new Visitor(base64UrlDecode($_POST[POST_EXTERN_USER_USERID])); $externalUser->ExtendSession = true; $externalUser->Load(); array_push($externalUser->Browsers, new VisitorChat($externalUser->UserId, base64UrlDecode($_POST[POST_EXTERN_USER_BROWSERID]))); define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), base64UrlDecode($_POST[POST_EXTERN_USER_USERID]), true)); define("IS_FLOOD", $externalUser->Browsers[0]->FirstCall && isFlood(getIP(), @$_POST[POST_EXTERN_USER_USERID], true)); $externalUser->Browsers[0]->Load(); if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_LISTEN) { $externalUser = listen($externalUser); } else { if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_MAIL) { initData(array("GROUPS")); $phone = isset($_POST["p_phone"]) ? base64UrlDecode($_POST["p_phone"]) : ""; if (($ticket = $externalUser->SaveTicket(base64UrlDecode($_POST[POST_EXTERN_USER_GROUP]), base64UrlDecode($_POST[POST_EXTERN_USER_NAME]), base64UrlDecode($_POST[POST_EXTERN_USER_EMAIL]), base64UrlDecode($_POST[POST_EXTERN_USER_COMPANY]), $externalUser->GeoCountryISO2, $phone, isset($_GET["cmb"]), base64UrlDecode($_POST[POST_EXTERN_USER_MAIL]), true, getOParam("p_url", "", $nu, FILTER_SANITIZE_URL))) !== false && ($CONFIG["gl_scom"] != null || $CONFIG["gl_sgom"] != null)) { Visitor::SendTicketAutoresponder($ticket, $externalUser->Language); } $externalUser->Browsers[0]->SaveLoginData(); } else { if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RATE) { initData(array("INTERNAL"));
$TRACKINGSCRIPT = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--get_track_params-->", getParams("", array("ws" => true, "ecsgs" => true, "ecsge" => true, "ecsc" => true, "ecsy" => true, "ecsx" => true, "ecsb" => true, "ecsa" => true, "ecslw" => true, "echc" => true, "ecfs" => true, "ecfe" => true, "echt" => true, "echst" => true, "ecoht" => true, "ecohst" => true, "ovlto" => true, "ovlt" => true, "ovlp" => true, "ovlml" => true, "ovlmr" => true, "ovlmt" => true, "ovlmb" => true, "ovls" => true, "ovloo" => true, "ovlc" => true, "ovlapo" => true, "ovlct" => true, GET_EXTERN_GROUP => true, "intid" => true, "pref" => true, "cboo" => true, "hg" => true, "fbpos" => false, "fbw" => false, "fbh" => false, "fbshx" => false, "fbshy" => false, "fbshb" => false, "fbshc" => false, "fbmt" => false, "fbmr" => false, "fbmb" => false, "fbml" => false, "fboo" => false, "eca" => true, "ecw" => true, "ech" => true, "ecmb" => true, "ecml" => true, "cf0" => true, "cf1" => true, "cf2" => true, "cf3" => true, "cf4" => true, "cf5" => true, "cf6" => true, "cf7" => true, "cf8" => true, "cf9" => true)), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--server-->", LIVEZILLA_URL, $TRACKINGSCRIPT); } else { $TRACKINGSCRIPT = "lz_tracking_set_sessid(\"" . base64_encode(CALLER_USER_ID) . "\",\"" . base64_encode(CALLER_BROWSER_ID) . "\");"; if (BaseURL::IsInputURL() && strpos(BaseURL::GetInputURL(), GET_INTERN_COBROWSE) !== false) { abortTracking(1); } $BROWSER = VisitorBrowser::FromCache(CALLER_USER_ID, CALLER_BROWSER_ID); $EXTERNALUSER->AddBrowser($BROWSER); if ($EXTERNALUSER->FirstCall && !$BROWSER->GetFirstCall()) { $EXTERNALUSER->FirstCall = false; } initData(array("INTERNAL", "FILTERS", "EVENTS")); define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), CALLER_USER_ID)); define("IS_FLOOD", $BROWSER->GetFirstCall() && Filter::IsFlood(getIP(), CALLER_USER_ID)); if (IS_FILTERED || IS_FLOOD || !empty($_GET["deactr"]) || getCookieValue(OO_TRACKING_FILTER_NAME) != null) { if (!IS_FILTERED) { Filter::Create($_SERVER["REMOTE_ADDR"], CALLER_USER_ID, OO_TRACKING_FILTER_NAME, isset($_GET["deactr"]) && is_int($_GET["deactr"]) ? $_GET["deactr"] : 365, true, true); } $monitoringActive = false; abortTracking(556); } $BROWSER->Customs = getCustomArray($BROWSER->Customs); if ($INPUTS[111]->IsServerInput()) { $BROWSER->Fullname = cutString($INPUTS[111]->GetServerInput(), 255); } else { if ($INPUTS[111]->Cookie) { $BROWSER->Fullname = getCookieValue("form_111"); }
$groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG); $groupbuilder->Generate(); if (!$groupbuilder->GroupAvailable) { exit("<html><script language=\"JavaScript\">if(typeof(window.opener != null) != 'undefined')window.opener.location = \"" . $CONFIG["gl_om_http"] . "\";window.close();</script></html>"); } } else { initData(array("FILTERS")); } if (isset($_POST["company"]) && !empty($_POST["company"]) || isset($_POST["email"]) && !empty($_POST["email"]) || isset($_POST["name"]) && !empty($_POST["name"]) || isset($_POST["text"]) && !empty($_POST["text"])) { exit(createFloodFilter(getIP(), null)); } } header("Content-Type: text/html; charset=utf-8"); if (!isset($_GET[GET_EXTERN_TEMPLATE])) { define("IS_FLOOD", isFlood(getIP(), null, true)); define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), SESSION, true)); require LIVEZILLA_PATH . "_lib/trdp/mobde.php"; $MobileDetect = new Mobile_Detect(); $small = $MobileDetect->isMobile() && !$MobileDetect->isTablet(); initData(array("INTERNAL")); $html = getFile(TEMPLATE_HTML_CHAT); $html = str_replace("<!--extern_script-->", getFile(TEMPLATE_SCRIPT_EXTERN) . getFile(TEMPLATE_SCRIPT_DATA) . getFile(TEMPLATE_SCRIPT_CHAT) . getFile(TEMPLATE_SCRIPT_FRAME), $html); $html = str_replace("<!--server_id-->", substr(md5($CONFIG["gl_lzid"]), 5, 5), $html); $html = str_replace("<!--connector_script-->", getFile(TEMPLATE_SCRIPT_CONNECTOR), $html); $html = str_replace("<!--group_script-->", getFile(TEMPLATE_SCRIPT_GROUPS), $html); $html = str_replace("<!--global_script-->", getFile(TEMPLATE_SCRIPT_GLOBAL), $html); $html = str_replace("<!--browser_id-->", $browserId, $html); $html = str_replace("<!--extern_timeout-->", min($CONFIG["timeout_chats"], $CONFIG["timeout_track"]), $html); $html = str_replace("<!--show_oib-->", parseBool(!empty($CONFIG["gl_soib"])), $html); $html = str_replace("<!--window_width-->", $CONFIG["wcl_window_width"], $html); $html = str_replace("<!--window_height-->", $CONFIG["wcl_window_height"], $html);
initData(true, true, false, true); $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG); $groupbuilder->Generate(); if (!$groupbuilder->GroupAvailable) { exit("<html><script language=\"JavaScript\">if(typeof(window.opener != null) != 'undefined')window.opener.location = \"" . $CONFIG["gl_om_http"] . "\";window.close();</script></html>"); } } else { initData(false, false, false, true); } if (isset($_POST["company"]) && !empty($_POST["company"]) || isset($_POST["email"]) && !empty($_POST["email"]) || isset($_POST["name"]) && !empty($_POST["name"]) || isset($_POST["text"]) && !empty($_POST["text"])) { exit(createFloodFilter(getIP(), null)); } } if (!isset($_GET[GET_EXTERN_TEMPLATE])) { define("IS_FLOOD", isFlood(getIP(), null, true)); define("IS_FILTERED", $FILTERS->Match($_SERVER["REMOTE_ADDR"], formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), SESSION)); initData(true, false, false, false); $html = getFile(TEMPLATE_HTML_EXTERN); $html = str_replace("<!--extern_script-->", getFile(TEMPLATE_SCRIPT_EXTERN) . getFile(TEMPLATE_SCRIPT_DATA) . getFile(TEMPLATE_SCRIPT_CHAT) . getFile(TEMPLATE_SCRIPT_FRAME), $html); $html = str_replace("<!--server_id-->", substr(md5($CONFIG["gl_lzid"]), 5, 5), $html); $html = str_replace("<!--connector_script-->", getFile(TEMPLATE_SCRIPT_CONNECTOR), $html); $html = str_replace("<!--group_script-->", getFile(TEMPLATE_SCRIPT_GROUPS), $html); $html = str_replace("<!--global_script-->", getFile(TEMPLATE_SCRIPT_GLOBAL), $html); $html = str_replace("<!--browser_id-->", $browserId, $html); $html = str_replace("<!--extern_timeout-->", $CONFIG["timeout_clients"], $html); $html = str_replace("<!--chat_transcript_form_visible-->", parseBool($CONFIG["gl_uret"] && $CONFIG["gl_soct"]), $html); $html = str_replace("<!--translation_service_visible-->", parseBool($CONFIG["gl_otrs"]), $html); $html = str_replace("<!--extern_frequency-->", $CONFIG["poll_frequency_clients"], $html); $html = str_replace("<!--cbcd-->", parseBool($CONFIG["gl_cbcd"]), $html); $html = str_replace("<!--bookmark_name-->", base64_encode($CONFIG["gl_site_name"]), $html); $html = str_replace("<!--user_id-->", SESSION, $html);
if (isset($_GET[GET_TRACK_BROWSERID]) && isset($_GET[GET_TRACK_START]) && isset($_GET[GET_TRACK_URL])) { if (!isnull($_GET[GET_TRACK_URL]) && strpos(base64UrlDecode($_GET[GET_TRACK_URL]), GET_INTERN_COBROWSE) !== false) { exit("lz_tracking_stop_tracking();"); } $BROWSER = new ExternalBrowser(CALLER_BROWSER_ID, CALLER_USER_ID); if (isset($_GET[GET_EXTERN_USER_NAME]) && !isnull($_GET[GET_EXTERN_USER_NAME])) { $BROWSER->Fullname = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_NAME])), 0, 32); } if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !isnull($_GET[GET_EXTERN_USER_EMAIL])) { $BROWSER->Email = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL])), 0, 50); } if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !isnull($_GET[GET_EXTERN_USER_COMPANY])) { $BROWSER->Company = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY])), 0, 50); } getData(false, false, false, true); define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!isnull(getServerParam("HTTP_ACCEPT_LANGUAGE")) ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""), CALLER_USER_ID)); define("IS_FLOOD", !dataSetExists($BROWSER->SessionFile) && isFlood()); if (!getAvailability() || IS_FILTERED || IS_FLOOD) { $BROWSER->Destroy(); exit("lz_tracking_stop_tracking();"); } if (dataSetExists($BROWSER->SessionFile)) { $BROWSER->Load(); } $count = count($BROWSER->History); if (!dataSetExists($externalUser->ExternalStatic->SessionFile)) { createStaticFile($externalUser, array(@$_GET[GET_TRACK_RESOLUTION_WIDTH], @$_GET[GET_TRACK_RESOLUTION_HEIGHT]), @$_GET[GET_TRACK_COLOR_DEPTH], @$_GET[GET_TRACK_TIMEZONE_OFFSET], @$_GET[GEO_LATITUDE], @$_GET[GEO_LONGITUDE], @$_GET[GEO_COUNTRY_ISO_2], @$_GET[GEO_CITY], @$_GET[GEO_REGION], @$_GET[GEO_TIMEZONE], @$_GET[GEO_ISP], @$_GET[GEO_SSPAN], @$_GET[GEO_RESULT_ID]); } if (isset($_GET[GET_TRACK_CLOSE_CHAT_WINDOW])) { $chat = new ExternalChat($externalUser->UserId, $_GET[GET_TRACK_CLOSE_CHAT_WINDOW]); $chat->Load();
* Improper changes to this file may cause critical errors. It is strongly * recommended to desist from editing this file. * ***************************************************************************************/ if (!defined("IN_LIVEZILLA")) { die; } require LIVEZILLA_PATH . "_lib/objects.external.inc.php"; require LIVEZILLA_PATH . "_lib/functions.external.inc.php"; if (isset($_POST[POST_EXTERN_SERVER_ACTION])) { languageSelect(); getData(false, true, false, true); $externalUser = new UserExternal($_POST[POST_EXTERN_USER_USERID]); $externalUser->ExternalStatic = new ExternalStatic($externalUser->UserId); array_push($externalUser->Browsers, new ExternalChat($externalUser->UserId, $_POST[POST_EXTERN_USER_BROWSERID])); define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(getServerParam("HTTP_ACCEPT_LANGUAGE") != null ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""), $_POST[POST_EXTERN_USER_USERID])); define("IS_FLOOD", !dataSetExists($externalUser->Browsers[0]->SessionFile) && isFlood()); if (dataSetExists($externalUser->Browsers[0]->SessionFile)) { $externalUser->Browsers[0]->Load(); } $externalUser->ExternalStatic->Language = getServerParam("HTTP_ACCEPT_LANGUAGE") != null ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""; $externalUser->Browsers[0]->LoadChat($CONFIG, null); if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_LISTEN) { $externalUser = listen($externalUser); } else { if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_MAIL) { getData(false, true, false, false); if ($externalUser->SaveTicket(AJAXDecode($_POST[POST_EXTERN_USER_GROUP])) && ($CONFIG["gl_scom"] != null || $CONFIG["gl_sgom"] != null)) { $externalUser->SendCopyOfMail(AJAXDecode($_POST[POST_EXTERN_USER_GROUP]), $CONFIG, $GROUPS); } } else {
define("LIVEZILLA_URL", getScheme() . $_SERVER["HTTP_HOST"] . str_replace(FILE_CHAT, "", $_SERVER["PHP_SELF"])); setDataProvider(); @set_time_limit($CONFIG["timeout_clients"]); if (!isset($_GET["file"])) { @set_error_handler("handleError"); } $browserId = getId(USER_ID_LENGTH); define("SESSION", getSessionId()); header("Content-Type: text/html; charset=utf-8"); languageSelect(); getData(false, false, false, true); if (isset($_POST["company"]) && !isnull($_POST["company"]) || isset($_POST["email"]) && !isnull($_POST["email"]) || isset($_POST["name"]) && !isnull($_POST["name"]) || isset($_POST["text"]) && !isnull($_POST["text"])) { exit(createFloodFilter(getIP(), null)); } if (!isset($_GET[GET_EXTERN_TEMPLATE])) { define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(getServerParam("HTTP_ACCEPT_LANGUAGE") != null ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""), SESSION)); $html = getFile(TEMPLATE_HTML_EXTERN); $html = str_replace("<!--extern_script-->", getFile(TEMPLATE_SCRIPT_EXTERN) . getFile(TEMPLATE_SCRIPT_DATA) . getFile(TEMPLATE_SCRIPT_CHAT) . getFile(TEMPLATE_SCRIPT_FRAME), $html); $html = str_replace("<!--connector_script-->", getFile(TEMPLATE_SCRIPT_CONNECTOR), $html); $html = str_replace("<!--group_script-->", getFile(TEMPLATE_SCRIPT_GROUPS), $html); $html = str_replace("<!--global_script-->", getFile(TEMPLATE_SCRIPT_GLOBAL), $html); $html = str_replace("<!--browser_id-->", $browserId, $html); $html = str_replace("<!--extern_timeout-->", $CONFIG["timeout_clients"], $html); $html = str_replace("<!--extern_frequency-->", $CONFIG["poll_frequency_clients"], $html); $html = str_replace("<!--cbcd-->", parseBool($CONFIG["gl_cbcd"]), $html); $html = str_replace("<!--bookmark_name-->", base64_encode($CONFIG["gl_site_name"]), $html); $html = str_replace("<!--user_id-->", SESSION, $html); $html = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $html); $html = replaceLoginDetails($html); $html = geoReplacements($html); $html = str_replace("<!--requested_intern_userid-->", isset($_GET[GET_EXTERN_INTERN_USER_ID]) && !isnull($_GET[GET_EXTERN_INTERN_USER_ID]) ? base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : "", $html);