function AppendFromCookies() { if (defined("CALLER_TYPE") && CALLER_TYPE != CALLER_TYPE_INTERNAL) { if (!isnull(getCookieValue("login_email"))) { $this->Email = getCookieValue("login_email"); } if (!isnull(getCookieValue("login_name"))) { $this->Fullname = getCookieValue("login_name"); } if (!isnull(getCookieValue("login_company"))) { $this->Company = getCookieValue("login_company"); } } }
function SetQuery($_referrer, $issearchengine = false, $parammatch = false, $encoding = "") { $parts = parse_url(strtolower($_referrer)); $uparts = explode("&", @$parts["query"]); foreach (HistoryUrl::$SearchEngines as $sparam => $engines) { foreach ($uparts as $param) { $kv = explode("=", $param); $parammatch = $kv[0] == $sparam && !empty($kv[1]); foreach ($engines as $engine) { if (jokerCompare($engine, $parts["host"])) { $issearchengine = true; } if ($issearchengine && $parammatch) { if (empty($encoding)) { foreach (HistoryUrl::$SearchEngineEncodings as $enc => $eengines) { foreach ($eengines as $eengine) { if ($eengine == $engine) { $encoding = $enc; } } } } $this->Query = empty($encoding) ? urldecode(trim($kv[1])) : html_entity_decode(@iconv($encoding, "UTF-8", urldecode(trim($kv[1]))), ENT_QUOTES, 'UTF-8'); if (!empty($this->Query) && isnull(getCookieValue("sp"))) { setCookieValue("sp", $this->Query); } queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_VISITOR_BROWSERS . "` SET `query`='" . DBManager::RealEscape($this->GetQueryId($this->Query, $_referrer)) . "' WHERE `id`='" . DBManager::RealEscape($this->BrowserId) . "' LIMIT 1;"); return true; } } } } return $issearchengine; }
$html = str_replace("<!--small-->", parseBool($small), $html); //$html = str_replace("<!--chat_transcript_form_visible-->",parseBool(!$small && $CONFIG["gl_uret"] && $CONFIG["gl_soct"]),$html); //$html = str_replace("<!--translation_service_visible-->",parseBool(!$small && strlen($CONFIG["gl_otrs"])>1),$html); $html = str_replace("<!--show_waiting_message-->", parseBool(strlen($CONFIG["gl_wmes"]) > 0), $html); $html = str_replace("<!--waiting_message_time-->", $CONFIG["gl_wmes"], $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 = str_replace("<!--info_text-->", base64_encode($CONFIG["gl_info"]), $html); $html = geoReplacements($html); $html = str_replace("<!--requested_intern_userid-->", base64_encode(!empty($_GET[GET_EXTERN_INTERN_USER_ID]) && isset($INTERNAL[Operator::GetSystemId(base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]) ? base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : ""), $html); $html = str_replace("<!--requested_intern_fullname-->", base64_encode(!empty($_GET[GET_EXTERN_INTERN_USER_ID]) && isset($INTERNAL[Operator::GetSystemId(base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]) ? $INTERNAL[Operator::GetSystemId(base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]->Fullname : ""), $html); $html = str_replace("<!--debug-->", parseBool(!empty($_GET["debug"])), $html); $html = str_replace("<!--geo_resolute-->", parseBool(!empty($CONFIG["gl_use_ngl"]) && !empty($CONFIG["gl_pr_ngl"]) && !(getCookieValue("geo_data") != null && getCookieValue("geo_data") > time() - 2592000) && !isSSpanFile()), $html); $html = str_replace("<!--chat_id-->", !empty($_GET["cid"]) ? getParam("cid") : "", $html); $html = str_replace("<!--gtv2_api_key-->", strlen($CONFIG["gl_otrs"]) > 1 ? $CONFIG["gl_otrs"] : "", $html); $html = str_replace("<!--template_message_intern-->", base64_encode(str_replace("<!--dir-->", $LANG_DIR, getFile(TEMPLATE_HTML_MESSAGE_INTERN))), $html); $html = str_replace("<!--template_message_extern-->", base64_encode(str_replace("<!--dir-->", $LANG_DIR, getFile(TEMPLATE_HTML_MESSAGE_EXTERN))), $html); $html = str_replace("<!--template_message_add-->", base64_encode(str_replace("<!--dir-->", $LANG_DIR, getFile(TEMPLATE_HTML_MESSAGE_ADD))), $html); $html = str_replace("<!--template_message_add_alt-->", base64_encode(str_replace("<!--dir-->", $LANG_DIR, getFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE))), $html); $html = str_replace("<!--direct_login-->", parseBool(isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET]) || isset($_GET["dl"])), $html); $html = str_replace("<!--preselect_ticket-->", parseBool(isset($_GET["pt"])), $html); $html = str_replace("<!--is_ie-->", parseBool(!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false), $html); $html = str_replace("<!--setup_error-->", base64_encode(buildLoginErrorField()), $html); $html = str_replace("<!--offline_message_mode-->", $CONFIG["gl_om_mode"], $html); $html = str_replace("<!--offline_message_http-->", $CONFIG["gl_om_http"], $html); $html = str_replace("<!--lang_client_queue_message-->", $CONFIG["gl_sho_qu_inf"] == 1 ? $LZLANG["client_queue_message"] : $LZLANG["client_ints_are_busy"], $html); $html = str_replace("<!--checkout_url-->", !empty($CONFIG["db"]["ccpp"]["Custom"]) ? $CONFIG["db"]["ccpp"]["Custom"]->URL : "", $html); $html = str_replace("<!--checkout_only-->", parseBool(!empty($_GET["co"]) && !empty($_GET[GET_EXTERN_GROUP])), $html);
function getCustomArray() { $_getCustomParams = array('', '', '', '', '', '', '', '', '', ''); for ($i = 0; $i <= 9; $i++) { if (isset($_GET["cf" . $i]) && !empty($_GET["cf" . $i])) { $_getCustomParams[$i] = base64UrlDecode($_GET["cf" . $i]); } else { if (isset($_POST["p_cf" . $i]) && !empty($_POST["p_cf" . $i])) { $_getCustomParams[$i] = base64UrlDecode($_POST["p_cf" . $i]); } else { if (isset($_POST["form_" . $i]) && !empty($_POST["form_" . $i])) { $_getCustomParams[$i] = $_POST["form_" . $i]; } else { if (!isnull(getCookieValue("cf_" . $i))) { $_getCustomParams[$i] = getCookieValue("cf_" . $i); } } } } } return $_getCustomParams; }
function Generate() { foreach ($this->InternalUsers as $internaluser) { if ($internaluser->LastActive > time() - $this->Config["timeout_clients"] && $internaluser->Status < 2) { for ($count = 0; $count < count($internaluser->Groups); $count++) { if (isset($_GET[GET_EXTERN_INTERN_USER_ID]) && !isnull($_GET[GET_EXTERN_INTERN_USER_ID]) && $internaluser->UserId == base64URLdecode($_GET[GET_EXTERN_INTERN_USER_ID])) { if ($this->InternalGroups[$internaluser->Groups[$count]]["gr_extern"]) { if (!($this->GroupValues["req_for_group"] && $internaluser->Groups[$count] != base64UrlDecode($_GET[GET_EXTERN_GROUP])) || isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "user") { $this->GroupValues["set_by_get_user"] = $internaluser->Groups[$count]; } } } if (!isset($this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]])) { $this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]] = 0; } $this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]]++; } } } $counter = 0; foreach ($this->InternalGroups as $id => $group) { $used = false; $amount = isset($this->GroupValues["groups_online_amounts"]) && is_array($this->GroupValues["groups_online_amounts"]) && array_key_exists($id, $this->GroupValues["groups_online_amounts"]) ? $this->GroupValues["groups_online_amounts"][$id] : 0; $transport = base64_encode($id) . "," . base64_encode($amount) . "," . base64_encode($group["gr_desc"]) . "," . base64_encode($group["gr_email"]); if ($this->GroupValues["req_for_group"] && $amount > 0 && $id == base64UrlDecode($_GET[GET_EXTERN_GROUP])) { $this->GroupValues["set_by_get_group"] = $id; $used = true; } elseif ($amount > 0 && getCookieValue("login_group") != null && $id == getCookieValue("login_group") && !isset($requested_group) && $group["gr_extern"]) { $this->GroupValues["set_by_cookie"] = $id; $used = true; } elseif ($amount > 0 && !isnull($group["gr_standard"])) { $this->GroupValues["set_by_standard"] = $id; $used = true; } elseif ($amount > 0 && isnull($this->GroupValues["set_by_online"]) && $group["gr_extern"]) { $this->GroupValues["set_by_online"] = $id; $used = true; } if (!in_array($id, $this->GroupValues["groups_hidden"]) && ($group["gr_extern"] || $used)) { $counter++; if ($amount > 0) { $this->GroupAvailable = true; $this->GroupValues["groups_online"][$id] = $transport; } else { $this->GroupValues["groups_offline"][$id] = $transport; } } } if (isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "group") { if (isset($this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])]) && $this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])] > 0) { $this->GroupValues["set_by_get_user"] = null; $this->GroupValues["req_for_user"] = false; } } if (!isnull($this->GroupValues["set_by_get_user"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_user"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]]; } else { if (!isnull($this->GroupValues["set_by_get_group"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_group"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]]; } else { if (!isnull($this->GroupValues["set_by_cookie"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_cookie"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]]; } else { if (!isnull($this->GroupValues["set_by_standard"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_standard"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]]; } else { if (!isnull($this->GroupValues["set_by_online"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_online"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]]; } } } } } foreach ($this->GroupValues["groups_online"] as $id => $transport) { if (!isset($this->GroupValues["groups_output"][$id])) { $this->GroupValues["groups_output"][$id] = $transport; } } $result = array_merge($this->GroupValues["groups_output"], $this->GroupValues["groups_offline"]); foreach ($result as $key => $value) { if (!isnull($this->Result)) { $this->Result .= ";" . $value; } else { $this->Result = $value; } } if ($counter == 0) { $this->ErrorHTML = "lz_chat_data.Language.ClientErrorGroups"; } }
$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); $html = str_replace("<!--geo_url-->", CONFIG_LIVEZILLA_GEO . "?aid=" . $CONFIG["wcl_geo_tracking"], $html); $html = str_replace("<!--geo_resolute-->", parseBool(!isSSpanFile() && !isnull($CONFIG["wcl_geo_tracking"]) && !(getCookieValue("geo_data") != null && getCookieValue("geo_data") > time() - 2592000)), $html); $html = str_replace("<!--area_code-->", isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? "&code=" . $_GET[GET_TRACK_SPECIAL_AREA_CODE] : "", $html); $html = str_replace("<!--template_message_intern-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_INTERN)), $html); $html = str_replace("<!--template_message_extern-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_EXTERN)), $html); $html = str_replace("<!--template_message_add-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD)), $html); $html = str_replace("<!--template_message_add_alt-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE)), $html); $html = str_replace("<!--direct_login-->", parseBool(isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET]) && !isnull($_GET[GET_EXTERN_USER_NAME])), $html); $html = str_replace("<!--is_ie-->", parseBool(!isnull(getServerParam('HTTP_USER_AGENT')) && strpos(getServerParam('HTTP_USER_AGENT'), 'MSIE') !== false), $html); $html = str_replace("<!--setup_error-->", base64_encode(buildLoginErrorField()), $html); $html = str_replace("<!--offline_message_mode-->", $CONFIG["gl_om_mode"], $html); $html = str_replace("<!--offline_message_http-->", $CONFIG["gl_om_http"], $html); $html = str_replace("<!--offline_message_pre_chat-->", parseBool($CONFIG["gl_no_om_sp"] == 1), $html); $html = str_replace("<!--lang_client_queue_message-->", $CONFIG["gl_sho_qu_inf"] == 1 ? $LZLANG["client_queue_message"] : $LZLANG["client_ints_are_busy"], $html); } else { if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.1.0") { getData(true, false, false, false);
function getSessionId() { global $CONFIG; if (!isnull(getCookieValue("userid"))) { $session = getCookieValue("userid"); } else { setCookieValue("userid", $session = getId(USER_ID_LENGTH)); } return $session; }
function getJSCustomArray($_getCustomParams = "", $_fromHistory = null) { global $INPUTS; initData(array("INPUTS")); $valArray = array(); foreach ($INPUTS as $index => $input) { if ($input->Active && $input->Custom) { if (isset($_GET["cf" . $input->Index])) { $valArray[$index] = "'" . getParam("cf" . $input->Index) . "'"; } else { if (!isnull(getCookieValue("cf_" . $input->Index)) && $input->Cookie) { $valArray[$index] = "'" . base64UrlEncode(getCookieValue("cf_" . $input->Index)) . "'"; } else { if (is_array($_fromHistory) && isset($_fromHistory[$input->Index]) && !empty($_fromHistory[$input->Index])) { $valArray[$index] = "'" . base64UrlEncode($_fromHistory[$input->Index]) . "'"; } else { $valArray[$index] = "''"; } } } } else { if ($input->Custom) { $valArray[$index] = "''"; } } } ksort($valArray); foreach ($valArray as $param) { if (!empty($_getCustomParams)) { $_getCustomParams .= ","; } $_getCustomParams .= $param; } return $_getCustomParams; }
function getChatVoucherTemplate($html = "") { global $CONFIG, $COUNTRIES, $LZLANG; if (!is("DB_CONNECTION") || !empty($CONFIG["db"]["ccpp"]["Custom"])) { return ""; } if (!empty($CONFIG["gl_ccac"])) { foreach ($CONFIG["db"]["cct"] as $type) { $html .= $type->GetTemplate(); } } $cchtml = getFile(PATH_TEMPLATES . "chat_voucher_checkout.tpl"); $mycountry = ""; $replacements = array("<!--lp_company-->" => "", "<!--lp_firstname-->" => "", "<!--lp_email-->" => "", "<!--lp_lastname-->" => "", "<!--lp_taxid-->" => "", "<!--lp_business_type-->" => "", "<!--lp_address_1-->" => "", "<!--lp_address_2-->" => "", "<!--lp_city-->" => "", "<!--lp_state-->" => "", "<!--lp_country-->" => "", "<!--lp_phone-->" => "", "<!--lp_zip-->" => ""); $prefillco = !empty($_GET["co"]) ? " OR id='" . DBManager::RealEscape(base64URLDecode($_GET["co"])) . "'" : ""; if (!isnull(getCookieValue("userid")) || !empty($prefillco)) { $result = queryDB(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_VOUCHERS . "` WHERE `visitor_id`='" . DBManager::RealEscape(getCookieValue("userid")) . "'" . $prefillco . " ORDER BY `created` DESC LIMIT 1;"); if ($result) { if ($row = DBManager::FetchArray($result)) { $replacements = array("<!--lp_company-->" => $row["company"], "<!--lp_firstname-->" => $row["firstname"], "<!--lp_lastname-->" => $row["lastname"], "<!--lp_taxid-->" => $row["tax_id"], "<!--lp_email-->" => $row["email"], "<!--lp_business_type-->" => $row["business_type"], "<!--lp_address_1-->" => $row["address_1"], "<!--lp_address_2-->" => $row["address_2"], "<!--lp_city-->" => $row["city"], "<!--lp_state-->" => $row["state"], "<!--lp_country-->" => $row["country"], "<!--lp_phone-->" => $row["phone"], "<!--lp_zip-->" => $row["zip"]); $mycountry = $row["country"]; } } } $clist = $COUNTRIES; asort($clist); $countrieshtml = ""; foreach ($clist as $isokey => $value) { if (!empty($isokey)) { $countrieshtml .= $isokey == $mycountry ? "<option value=\"" . $isokey . "\" SELECTED>" . utf8_encode($value) . "</option>" : "<option value=\"" . $isokey . "\">" . utf8_encode($value) . "</option>"; } } $cchtml = str_replace("<!--countries-->", $countrieshtml, $cchtml); foreach ($replacements as $key => $value) { $cchtml = str_replace($key, $value, $cchtml); } $cchtml = str_replace("<!--show_VAT-->", !empty($CONFIG["gl_ccsv"]) ? "''" : "none", $cchtml); $cchtml = str_replace("<!--voucher_form-->", $html, $cchtml); if (!empty($CONFIG["db"]["ccpp"]["PayPal"]->LogoURL)) { $cchtml = str_replace("<!--pp_logo_url-->", " src=\"" . $CONFIG["db"]["ccpp"]["PayPal"]->LogoURL . "\"", $cchtml); } else { $cchtml = str_replace("<!--pp_logo_url-->", "", $cchtml); } $cchtml = str_replace("<!--extends_voucher-->", !empty($_GET["co"]) && strlen(base64UrlDecode($_GET["co"])) == 16 ? base64UrlDecode($_GET["co"]) : "", $cchtml); $cchtml = str_replace("<!--ofc-->", !empty($_GET["ofc"]) ? "MQ__" : "", $cchtml); $cchtml = str_replace("<!--VAT-->", str_replace("<!--VAT-->", $CONFIG["gl_ccva"], $LZLANG["client_voucher_include_vat"]), $cchtml); return $cchtml; }
function GetCookieValue() { return !$this->Custom ? getCookieValue("form_" . $this->Index) : getCookieValue("cf_" . $this->Index); }
function Generate() { foreach ($this->InternalUsers as $internaluser) { if ($internaluser->LastActive > time() - $this->Config["timeout_clients"] && $internaluser->Status < 2) { for ($count = 0; $count < count($internaluser->Groups); $count++) { if (isset($_GET[GET_EXTERN_INTERN_USER_ID]) && !empty($_GET[GET_EXTERN_INTERN_USER_ID]) && $internaluser->UserId == base64URLdecode($_GET[GET_EXTERN_INTERN_USER_ID])) { if (!($this->GroupValues["req_for_group"] && $internaluser->Groups[$count] != base64UrlDecode($_GET[GET_EXTERN_GROUP])) || isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "user") { $this->GroupValues["set_by_get_user"] = $internaluser->Groups[$count]; } } if (!isset($this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]])) { $this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]] = 0; } $this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]]++; } } } $counter = 0; foreach ($this->InternalGroups as $id => $group) { if (!$group->IsExternal) { continue; } $used = false; $amount = isset($this->GroupValues["groups_online_amounts"]) && is_array($this->GroupValues["groups_online_amounts"]) && array_key_exists($id, $this->GroupValues["groups_online_amounts"]) && $group->IsOpeningHour() ? $this->GroupValues["groups_online_amounts"][$id] : 0; $transport = base64_encode($id) . "," . base64_encode($amount) . "," . base64_encode($group->Description) . "," . base64_encode($group->Email); if ($this->GroupValues["req_for_group"] && $amount > 0 && $id == base64UrlDecode($_GET[GET_EXTERN_GROUP])) { $this->GroupValues["set_by_get_group"] = $id; $used = true; } elseif ($amount > 0 && getCookieValue("login_group") != null && $id == getCookieValue("login_group") && !isset($requested_group)) { $this->GroupValues["set_by_cookie"] = $id; $used = true; } elseif ($amount > 0 && $group->IsStandard) { $this->GroupValues["set_by_standard"] = $id; $used = true; } elseif ($amount > 0 && empty($this->GroupValues["set_by_online"])) { $this->GroupValues["set_by_online"] = $id; $used = true; } if (!in_array($id, $this->GroupValues["groups_hidden"]) && ($group->IsExternal || $used)) { $counter++; if ($amount > 0) { $this->GroupAvailable = true; $this->GroupValues["groups_online"][$id] = $transport; } else { $this->GroupValues["groups_offline"][$id] = $transport; } } } if (isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "group") { if (isset($this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])]) && $this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])] > 0) { $this->GroupValues["set_by_get_user"] = null; $this->GroupValues["req_for_user"] = false; } } if (!empty($this->GroupValues["set_by_get_user"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_user"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]]; } else { if (!empty($this->GroupValues["set_by_get_group"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_group"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]]; } else { if (!empty($this->GroupValues["set_by_cookie"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_cookie"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]]; } else { if (!empty($this->GroupValues["set_by_standard"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_standard"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]]; } else { if (!empty($this->GroupValues["set_by_online"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_online"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]]; } } } } } foreach ($this->GroupValues["groups_online"] as $id => $transport) { if (!isset($this->GroupValues["groups_output"][$id])) { $this->GroupValues["groups_output"][$id] = $transport; } } $result = array_merge($this->GroupValues["groups_output"], $this->GroupValues["groups_offline"]); foreach ($result as $key => $value) { $chat_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->ChatInputsHidden as $index) { if ($count > 0) { $chat_input_fields .= ","; } $chat_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($chat_input_fields . ");"); $chat_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->ChatInputsMandatory as $index) { if ($count > 0) { $chat_input_fields .= ","; } $chat_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($chat_input_fields . ");"); $ticket_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->TicketInputsHidden as $index) { if ($count > 0) { $ticket_input_fields .= ","; } $ticket_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($ticket_input_fields . ");"); $ticket_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->TicketInputsMandatory as $index) { if ($count > 0) { $ticket_input_fields .= ","; } $ticket_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($ticket_input_fields . ");"); if (!empty($this->Result)) { $this->Result .= ";" . $value; } else { $this->Result = $value; } } if ($counter == 0) { $this->ErrorHTML = "lz_chat_data.Language.ClientErrorGroups"; } }
if (!isset($_GET[GET_TRACK_NO_SEARCH_ENGINE])) { header("Location: http://www.livezilla.net"); exit(getFile(TEMPLATE_HTML_SUPPORT)); } $TRACKINGSCRIPT = getFile(TEMPLATE_SCRIPT_GLOBAL) . getFile(TEMPLATE_SCRIPT_TRACK) . getFile(TEMPLATE_SCRIPT_BOX); $TRACKINGSCRIPT = str_replace("<!--server-->", LIVEZILLA_URL, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--area_code-->", !isnull(getParam(GET_TRACK_SPECIAL_AREA_CODE)) ? $_GET[GET_TRACK_SPECIAL_AREA_CODE] : "", $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--browser_id-->", CALLER_BROWSER_ID, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_id-->", CALLER_USER_ID, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--poll_frequency-->", $CONFIG["poll_frequency_tracking"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--timeout-->", $CONFIG["timeout_track"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $TRACKINGSCRIPT); $TRACKINGSCRIPT = geoReplacements($TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--geo_resolute-->", parseBool(!isSSpanFile() && !dataSetExists($externalUser->ExternalStatic->SessionFile) && !isnull($CONFIG["wcl_geo_tracking"]) && !(!isnull(getCookieValue("geo_data")) && getCookieValue("geo_data") > time() - 2592000)), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--alert_html-->", base64_encode(str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_SCRIPT_ALERT))), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_name-->", getParam(GET_EXTERN_USER_NAME), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_email-->", getParam(GET_EXTERN_USER_EMAIL), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_company-->", getParam(GET_EXTERN_USER_COMPANY), $TRACKINGSCRIPT); $TRACKINGSCRIPT = str_replace("<!--user_header-->", getParam(GET_EXTERN_USER_HEADER), $TRACKINGSCRIPT); if (isset($_GET[GET_EXTERN_USER_EMAIL])) { setCookieValue("login_email", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]))); } if (isset($_GET[GET_EXTERN_USER_COMPANY])) { setCookieValue("login_company", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]))); } if (isset($_GET[GET_EXTERN_USER_NAME])) { setCookieValue("login_name", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_NAME]))); } } else {
function createStaticFile($_externalUser, $_resolution, $_color, $_timezone, $_lat, $_long, $_countryiso2, $_city, $_region, $_geotimezone, $_isp, $_geosspan, $_grid, $_fromCookie = false) { global $CONFIG; if (isnull(getCookieValue("userid"))) { setCookieValue("visits", $_externalUser->ExternalStatic->Visits = 1); } else { if (!isnull(getCookieValue("userid"))) { setCookieValue("visits", $_externalUser->ExternalStatic->Visits = getCookieValue("visits") + 1); } } $_externalUser->ExternalStatic->IP = getIP(); $_externalUser->ExternalStatic->Host = getHost(); $_externalUser->ExternalStatic->SystemInfo = !isnull($userAgent = getServerParam("HTTP_USER_AGENT")) ? $userAgent : ""; $_externalUser->ExternalStatic->Language = !isnull($acceptLanguage = getServerParam("HTTP_ACCEPT_LANGUAGE")) ? $acceptLanguage : ""; if (strlen($_externalUser->ExternalStatic->Language) > 8 || strpos($_externalUser->ExternalStatic->Language, ";") !== false) { $parts = explode(";", $_externalUser->ExternalStatic->Language); if (count($parts) > 0) { $_externalUser->ExternalStatic->Language = $parts[0]; } else { $_externalUser->ExternalStatic->Language = substr($_externalUser->ExternalStatic->Language, 0, 8); } } $_externalUser->ExternalStatic->Resolution = is_array($_resolution) && count($_resolution) == 2 ? $_resolution[0] . " x " . $_resolution[1] : ""; $_externalUser->ExternalStatic->Resolution .= !isnull($_color) ? " (" . $_color . " Bit)" : ""; $_externalUser->ExternalStatic->GeoTimezoneOffset = getLocalTimezone($_timezone); if (!isnull($_geosspan)) { createSSpanFile($_geosspan); } if (!isnull($CONFIG["wcl_geo_tracking"])) { if (!isnull($_lat) && base64_decode($_lat) > -180) { setCookieValue(GEO_LATITUDE, $_externalUser->ExternalStatic->GeoLatitude = base64_decode($_lat)); setCookieValue(GEO_LONGITUDE, $_externalUser->ExternalStatic->GeoLongitude = base64_decode($_long)); setCookieValue(GEO_COUNTRY_ISO_2, $_externalUser->ExternalStatic->GeoCountryISO2 = base64_decode($_countryiso2)); setCookieValue(GEO_CITY, $_externalUser->ExternalStatic->GeoCity = base64_decode($_city)); setCookieValue(GEO_REGION, $_externalUser->ExternalStatic->GeoRegion = base64_decode($_region)); setCookieValue(GEO_TIMEZONE, $_externalUser->ExternalStatic->GeoTimezoneOffset = base64_decode($_geotimezone)); setCookieValue(GEO_ISP, $_externalUser->ExternalStatic->GeoISP = base64_decode($_isp)); setCookieValue("geo_data", time()); } else { if (isset($_lat)) { $_externalUser->ExternalStatic->GeoLatitude = base64_decode($_lat); $_externalUser->ExternalStatic->GeoLongitude = base64_decode($_long); } else { if (!isnull(getCookieValue("geo_data"))) { $_externalUser->ExternalStatic->GeoLatitude = getCookieValue(GEO_LATITUDE); $_externalUser->ExternalStatic->GeoLongitude = getCookieValue(GEO_LONGITUDE); $_externalUser->ExternalStatic->GeoCountryISO2 = getCookieValue(GEO_COUNTRY_ISO_2); $_externalUser->ExternalStatic->GeoCity = getCookieValue(GEO_CITY); $_externalUser->ExternalStatic->GeoRegion = getCookieValue(GEO_REGION); $_externalUser->ExternalStatic->GeoTimezoneOffset = getCookieValue(GEO_TIMEZONE); $_externalUser->ExternalStatic->GeoISP = getCookieValue(GEO_ISP); $_fromCookie = true; } } } removeSSpanFile(false); if ($_fromCookie) { $_externalUser->ExternalStatic->GeoResultId = 6; } else { if (isSSpanFile()) { if (@filemtime(FILE_SERVER_GEO_SSPAN) > time() + CONNECTION_ERROR_SPAN) { $_externalUser->ExternalStatic->GeoResultId = 5; } else { $_externalUser->ExternalStatic->GeoResultId = 4; } } else { if (base64_decode($_lat) == -777) { $_externalUser->ExternalStatic->GeoResultId = 5; } else { if (base64_decode($_lat) == -522) { $_externalUser->ExternalStatic->GeoResultId = 2; } else { if ($_grid != 4) { $_externalUser->ExternalStatic->GeoResultId = 3; } else { $_externalUser->ExternalStatic->GeoResultId = $_grid; } } } } } if (strlen($_externalUser->ExternalStatic->Language) == 2 && !isnull(GEO_COUNTRY_ISO_2)) { $_externalUser->ExternalStatic->Language .= "-" . $_externalUser->ExternalStatic->GeoCountryISO2; } } $_externalUser->ExternalStatic->Save(); }
$externalUser->Browsers[0]->SaveLoginData(); } else { if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RATE) { initData(array("INTERNAL")); $externalUser->SaveRate(base64UrlDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]), $CONFIG, $externalUser->Browsers[0]->ChatId); } else { if ($externalUser->Browsers[0]->Status != CHAT_STATUS_OPEN || $externalUser->Browsers[0]->Waiting) { $externalUser->Browsers[0]->CloseChat(7); $externalUser->Browsers[0] = new VisitorChat($externalUser->UserId, base64UrlDecode(@$_POST[POST_EXTERN_USER_BROWSERID]), $externalUser->Browsers[0]->Fullname, $externalUser->Browsers[0]->Email, $externalUser->Browsers[0]->Company, $externalUser->Browsers[0]->Question, $externalUser->Browsers[0]->Customs, $externalUser->Browsers[0]->DesiredChatGroup, $externalUser->Browsers[0]->DesiredChatPartner, $externalUser->Browsers[0]->Phone); } else { $externalUser->Browsers[0]->ChatId = base64UrlDecode(@$_POST[POST_EXTERN_CHAT_ID]); } $externalUser->Browsers[0]->Waiting = false; $externalUser->Browsers[0]->WaitingMessageDisplayed = null; if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RELOAD_GROUPS) { if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME]) && isnull(getCookieValue("form_111"))) { $externalUser->Browsers[0]->Fullname = base64UrlDecode($_GET[GET_EXTERN_USER_NAME]); } if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) { $externalUser->Browsers[0]->Email = base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]); } if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !empty($_GET[GET_EXTERN_USER_COMPANY])) { $externalUser->Browsers[0]->Company = base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]); } if (isset($_GET[GET_EXTERN_USER_QUESTION]) && !empty($_GET[GET_EXTERN_USER_QUESTION])) { $externalUser->Browsers[0]->Question = base64UrlDecode($_GET[GET_EXTERN_USER_QUESTION]); } $externalUser->Browsers[0]->Customs = getCustomArray($externalUser->Browsers[0]->Customs); $externalUser = replaceLoginDetails($externalUser); $externalUser = reloadGroups($externalUser); } else {
function Generate($_user = null, $_allowBots = false) { global $GROUPS; foreach ($this->InternalUsers as $internaluser) { if ($internaluser->LastActive > time() - $this->Config["timeout_clients"] && $internaluser->Status < USER_STATUS_OFFLINE && ($_allowBots || !$internaluser->IsBot) && !$internaluser->MobileSleep()) { $igroups = $internaluser->GetGroupList(true); for ($count = 0; $count < count($igroups); $count++) { if ($internaluser->UserId == $this->ReqOperator) { if (!($this->GroupValues["req_for_group"] && $igroups[$count] != $this->ReqGroup) || isset($_GET[GET_EXTERN_PREFERENCE]) && base64UrlDecode($_GET[GET_EXTERN_PREFERENCE]) == "user") { $this->GroupValues["set_by_get_user"] = $igroups[$count]; } } if (!isset($this->GroupValues["groups_online_amounts"][$igroups[$count]])) { $this->GroupValues["groups_online_amounts"][$igroups[$count]] = 0; } if ($internaluser->IsBot) { $this->GroupValues["groups_online_amounts"][$igroups[$count]] += 1; } else { if (isset($GROUPS[$igroups[$count]])) { if (!($GROUPS[$igroups[$count]]->MaxChatAmount > -1 && $GROUPS[$igroups[$count]]->MaxChatsStatus == USER_STATUS_AWAY && $GROUPS[$igroups[$count]]->MaxChatAmount <= $internaluser->GetExternalChatAmount())) { $this->GroupValues["groups_online_amounts"][$igroups[$count]] += 2; } } } } } } $counter = 0; if (is_array($this->InternalGroups)) { foreach ($this->InternalGroups as $id => $group) { if (!$group->IsExternal) { continue; } $used = false; $amount = isset($this->GroupValues["groups_online_amounts"]) && is_array($this->GroupValues["groups_online_amounts"]) && array_key_exists($id, $this->GroupValues["groups_online_amounts"]) && $group->IsOpeningHour() ? $this->GroupValues["groups_online_amounts"][$id] : 0; $transport = base64_encode($id) . "," . base64_encode($amount) . "," . base64_encode($group->GetDescription($_user != null ? $_user->Language : "")) . "," . base64_encode($group->Email); if ($this->GroupValues["req_for_group"] && $id == $this->ReqGroup) { $this->GroupValues["set_by_get_group"] = $id; $used = true; } elseif (getCookieValue("login_group") != null && $id == getCookieValue("login_group") && !isset($requested_group)) { $this->GroupValues["set_by_cookie"] = $id; $used = true; } elseif ($group->IsStandard) { $this->GroupValues["set_by_standard"] = $id; $used = true; } elseif (empty($this->GroupValues["set_by_online"])) { $this->GroupValues["set_by_online"] = $id; $used = true; } if (!in_array($id, $this->GroupValues["groups_hidden"]) && ($group->IsExternal || $used)) { $counter++; if ($amount > 0) { $this->GroupAvailable = true; $this->GroupValues["groups_online"][$id] = $transport; } else { if ($group->IsStandard) { $na[$id] = $transport; $na = array_merge($na, $this->GroupValues["groups_offline"]); $this->GroupValues["groups_offline"] = $na; } else { $this->GroupValues["groups_offline"][$id] = $transport; } } } } } if (isset($_GET[GET_EXTERN_PREFERENCE]) && base64UrlDecode($_GET[GET_EXTERN_PREFERENCE]) == "group") { if (isset($this->GroupValues["groups_online_amounts"][$this->ReqGroup]) && $this->GroupValues["groups_online_amounts"][$this->ReqGroup] > 0) { $this->GroupValues["set_by_get_user"] = null; $this->GroupValues["req_for_user"] = false; } } if (!empty($this->GroupValues["set_by_get_user"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_user"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]]; } else { if (!empty($this->GroupValues["set_by_get_group"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_group"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]]; } else { if (!empty($this->GroupValues["set_by_cookie"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_cookie"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]]; } else { if (!empty($this->GroupValues["set_by_standard"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_standard"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]]; } else { if (!empty($this->GroupValues["set_by_online"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_online"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]]; } else { if (!empty($this->GroupValues["set_by_cookie"]) && empty($this->GroupValues["groups_output"]) && !empty($this->GroupValues["groups_offline"][$this->GroupValues["set_by_cookie"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_cookie"]] = $this->GroupValues["groups_offline"][$this->GroupValues["set_by_cookie"]]; } else { if (!empty($this->GroupValues["set_by_get_group"]) && empty($this->GroupValues["groups_output"]) && !empty($this->GroupValues["groups_offline"][$this->GroupValues["set_by_get_group"]])) { $this->GroupValues["groups_output"][$this->GroupValues["set_by_get_group"]] = $this->GroupValues["groups_offline"][$this->GroupValues["set_by_get_group"]]; } } } } } } } foreach ($this->GroupValues["groups_online"] as $id => $transport) { if (!isset($this->GroupValues["groups_output"][$id])) { $this->GroupValues["groups_output"][$id] = $transport; } } if (empty($this->GroupValues["set_by_get_group"]) || empty($this->GroupValues["groups_online_amounts"][$this->GroupValues["set_by_get_group"]])) { $ngroups = array(); foreach ($this->GroupValues["groups_output"] as $id => $group) { $ngroups[$id] = !empty($this->GroupValues["groups_online_amounts"][$id]) ? $this->GroupValues["groups_online_amounts"][$id] : 0; if ($id == $this->GroupValues["set_by_standard"]) { $ngroups[$id] = 10000; } } arsort($ngroups); $nsgroups = array(); foreach ($ngroups as $id => $amount) { $nsgroups[$id] = $this->GroupValues["groups_output"][$id]; } $this->GroupValues["groups_output"] = $nsgroups; } $result = array_merge($this->GroupValues["groups_output"], $this->GroupValues["groups_offline"]); foreach ($result as $key => $value) { $chat_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->ChatInputsHidden as $index) { if ($count > 0) { $chat_input_fields .= ","; } $chat_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($chat_input_fields . ");"); $chat_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->ChatInputsMandatory as $index) { if ($count > 0) { $chat_input_fields .= ","; } $chat_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($chat_input_fields . ");"); $ticket_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->TicketInputsHidden as $index) { if ($count > 0) { $ticket_input_fields .= ","; } $ticket_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($ticket_input_fields . ");"); $ticket_input_fields = "new Array("; $count = 0; foreach ($this->InternalGroups[$key]->TicketInputsMandatory as $index) { if ($count > 0) { $ticket_input_fields .= ","; } $ticket_input_fields .= "'" . $index . "'"; $count++; } $value .= "," . base64_encode($ticket_input_fields . ");"); $mes = getPredefinedMessage($this->InternalGroups[$key]->PredefinedMessages, $_user != null ? $_user->Language : ""); if ($mes != null) { $value .= "," . base64_encode($mes->ChatInformation); $value .= "," . base64_encode($mes->CallMeBackInformation); $value .= "," . base64_encode($mes->TicketInformation); } else { $value .= "," . base64_encode(""); $value .= "," . base64_encode(""); $value .= "," . base64_encode(""); } $count = 0; $com_tickets_allowed = "new Array("; foreach ($this->InternalGroups[$key]->ChatVouchersRequired as $cttid) { if ($count > 0) { $com_tickets_allowed .= ","; } $com_tickets_allowed .= "'" . $cttid . "'"; $count++; } $value .= "," . base64_encode($com_tickets_allowed . ");"); if (!empty($this->Result)) { $this->Result .= ";" . $value; } else { $this->Result = $value; } } if ($counter == 0) { $this->ErrorHTML = "lz_chat_data.Language.ClientErrorGroups"; } }
} $BROWSER->Customs = getCustomArray(); if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME])) { $BROWSER->Fullname = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_NAME]), 254); } else { $BROWSER->Fullname = getCookieValue("form_111"); } if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) { $BROWSER->Email = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]), 254); } else { $BROWSER->Email = getCookieValue("form_112"); } if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !empty($_GET[GET_EXTERN_USER_COMPANY])) { $BROWSER->Company = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]), 254); } else { $BROWSER->Company = getCookieValue("form_113"); } if (isset($_GET[GET_EXTERN_USER_QUESTION]) && !empty($_GET[GET_EXTERN_USER_QUESTION])) { $BROWSER->Question = base64UrlDecode($_GET[GET_EXTERN_USER_QUESTION]); } $referrer = isset($_GET[GET_TRACK_REFERRER]) ? trim(slashesStrip(base64UrlDecode($_GET[GET_TRACK_REFERRER]))) : ""; if (JAVASCRIPT) { if (isset($_GET[GET_TRACK_RESOLUTION_WIDTH])) { if (!isset($_GET[GET_TRACK_URL])) { abortTracking(9); } else { if (empty($_GET[GET_TRACK_URL])) { abortTracking(3); } } $currentURL = new HistoryURL(substr(base64UrlDecode($_GET[GET_TRACK_URL]), 0, 2083), isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? base64UrlDecode($_GET[GET_TRACK_SPECIAL_AREA_CODE]) : "", base64UrlDecode(@$_GET[GET_EXTERN_DOCUMENT_TITLE]), $referrer, time());
function setCookieValue($_key, $_value, $_onlyWhenEmpty = false) { global $CONFIG; if (!empty($CONFIG["gl_colt"]) && !empty($_value)) { $current = getCookieValue($_key); if ($_onlyWhenEmpty && $current != null) { return; } if ($current == $_value) { return; } $lifetime = empty($CONFIG["gl_colt"]) ? 0 : time() + $CONFIG["gl_colt"] * 86400; setcookie("lz_" . $_key, $_COOKIE["lz_" . $_key] = base64_encode($_value), $lifetime); setcookie("livezilla", "", time() - 3600); } }
function Save($_config, $_resolution, $_color, $_timezone, $_lat, $_long, $_countryiso2, $_city, $_region, $_geotimezone, $_isp, $_geosspan, $_grid, $_js = true, $_fromCookie = false) { global $STATS, $COUNTRIES, $COUNTRY_ALIASES; if (!$this->FirstCall) { $this->KeepAlive(); } else { if (!isnull(getCookieValue("visits")) && $this->Visits == 1) { $this->Visits = getCookieValue("visits") + 1; } setCookieValue("visits", $this->Visits); if (!isnull(getCookieValue("last_visit"))) { $this->VisitLast = getCookieValue("last_visit"); } setCookieValue("last_visit", time()); $this->IP = getIP(); $this->SystemInfo = !empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : ""; $localization = getBrowserLocalization(); $this->Language = $localization[0]; $this->GeoCountryISO2 = $localization[1]; $this->Resolution = !empty($_resolution) && count($_resolution) == 2 && !empty($_resolution[0]) && !empty($_resolution[1]) ? $_resolution[0] . " x " . $_resolution[1] : ""; $this->Resolution .= !empty($_color) ? " (" . $_color . " Bit)" : ""; $this->GeoTimezoneOffset = getLocalTimezone($_timezone); $this->GeoResult = 0; if (!empty($_geosspan)) { createSSpanFile($_geosspan); } if (!empty($_config["gl_pr_ngl"]) && $_js) { if (!empty($_lat) && base64_decode($_lat) > -180) { setCookieValue(GEO_LATITUDE, $this->GeoLatitude = base64_decode($_lat)); setCookieValue(GEO_LONGITUDE, $this->GeoLongitude = base64_decode($_long)); setCookieValue(GEO_COUNTRY_ISO_2, $this->GeoCountryISO2 = base64_decode($_countryiso2)); setCookieValue(GEO_CITY, $this->GeoCity = base64_decode($_city)); setCookieValue(GEO_REGION, $this->GeoRegion = base64_decode($_region)); setCookieValue(GEO_TIMEZONE, $this->GeoTimezoneOffset = base64_decode($_geotimezone)); setCookieValue(GEO_ISP, $this->GeoISP = utf8_decode(base64_decode($_isp))); setCookieValue("geo_data", time()); } else { if (isset($_lat) && !empty($_lat)) { $this->GeoLatitude = base64_decode($_lat); $this->GeoLongitude = base64_decode($_long); } else { if (!isnull(getCookieValue("geo_data")) && !isnull(getCookieValue(GEO_LATITUDE))) { $this->GeoLatitude = getCookieValue(GEO_LATITUDE); $this->GeoLongitude = getCookieValue(GEO_LONGITUDE); $this->GeoCountryISO2 = getCookieValue(GEO_COUNTRY_ISO_2); $this->GeoCity = getCookieValue(GEO_CITY); $this->GeoRegion = getCookieValue(GEO_REGION); $this->GeoTimezoneOffset = getCookieValue(GEO_TIMEZONE); $this->GeoISP = getCookieValue(GEO_ISP); $_fromCookie = true; } } } removeSSpanFile(false); if ($_fromCookie) { $this->GeoResultId = 6; } else { if (!isnull($span = getSpanValue())) { if ($span > time() + CONNECTION_ERROR_SPAN) { $this->GeoResultId = 5; } else { $this->GeoResultId = 4; } } else { if (base64_decode($_lat) == -777) { $this->GeoResultId = 5; } else { if (base64_decode($_lat) == -522) { $this->GeoResultId = 2; } else { if ($_grid != 4) { $this->GeoResultId = 3; } else { $this->GeoResultId = $_grid; } } } } } } else { $this->GeoResultId = 7; } initData(false, false, false, false, false, false, true); if (isset($COUNTRY_ALIASES[$this->GeoCountryISO2])) { $this->GeoCountryISO2 = $COUNTRY_ALIASES[$this->GeoCountryISO2]; } else { if (!isset($COUNTRIES[$this->GeoCountryISO2]) && DEBUG_MODE) { logit($this->GeoCountryISO2, LIVEZILLA_PATH . "_log/unknown_countries.txt"); } } $detector = new DeviceDetector(); $detector->DetectBrowser(); if ($detector->AgentType == AGENT_TYPE_BROWSER || $detector->AgentType == AGENT_TYPE_UNKNOWN) { $detector->DetectOperatingSystem(); if (DEBUG_MODE && !empty($_SERVER["HTTP_USER_AGENT"])) { if ($detector->OperatingSystemUnknown) { logit("OS UNKNOWN: " . $_SERVER["HTTP_USER_AGENT"], LIVEZILLA_PATH . "_log/unknown_os.txt"); } else { if ($detector->AgentType == AGENT_TYPE_UNKNOWN) { logit("AGENT UNKNOWN: " . $_SERVER["HTTP_USER_AGENT"], LIVEZILLA_PATH . "_log/unknown_ag.txt"); } } } $bid = $this->GetBrowserId($detector->Browser, $detector->AgentType); $oid = $this->GetOSId($detector->OperatingSystem); $row = $this->CreateSignature(); if (is_array($row) && $row["id"] != $this->UserId) { $this->UserId = $row["id"]; $this->SignatureMismatch = true; } else { queryDB(true, "INSERT INTO `" . DB_PREFIX . DATABASE_VISITORS . "` (`id`, `entrance`,`last_active`, `host`,`ip`,`system`,`browser`, `visits`,`visit_id`,`visit_last`,`resolution`, `language`, `country`, `city`, `region`, `isp`, `timezone`, `latitude`, `longitude`, `geo_result`, `js`, `signature`) VALUES ('" . @mysql_real_escape_string($this->UserId) . "', '" . @mysql_real_escape_string(time()) . "','" . @mysql_real_escape_string(time()) . "', '" . @mysql_real_escape_string($this->Host) . "', '" . @mysql_real_escape_string($this->IP) . "', '" . @mysql_real_escape_string($oid) . "','" . @mysql_real_escape_string($bid) . "', '" . @mysql_real_escape_string($this->Visits) . "', '" . @mysql_real_escape_string($this->VisitId) . "','" . @mysql_real_escape_string($this->VisitLast) . "', '" . @mysql_real_escape_string(getValueId(DATABASE_VISITOR_DATA_RESOLUTIONS, "resolution", $this->Resolution, false, 32)) . "', '" . @mysql_real_escape_string(substr(strtoupper($this->Language), 0, 5)) . "','" . @mysql_real_escape_string($this->GeoCountryISO2) . "', '" . @mysql_real_escape_string(getValueId(DATABASE_VISITOR_DATA_CITIES, "city", $this->GeoCity, false)) . "', '" . @mysql_real_escape_string(getValueId(DATABASE_VISITOR_DATA_REGIONS, "region", $this->GeoRegion, false)) . "', '" . @mysql_real_escape_string(getValueId(DATABASE_VISITOR_DATA_ISPS, "isp", utf8_encode($this->GeoISP), false)) . "', '" . @mysql_real_escape_string($this->GeoTimezoneOffset) . "', '" . @mysql_real_escape_string($this->GeoLatitude) . "', '" . @mysql_real_escape_string($this->GeoLongitude) . "', '" . @mysql_real_escape_string($this->GeoResultId) . "', '" . @mysql_real_escape_string($_js ? 1 : 0) . "', '" . @mysql_real_escape_string($this->Signature) . "');"); if (mysql_affected_rows() == 1) { queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_VISITORS . "` SET `visit_latest`=0 WHERE `id`='" . @mysql_real_escape_string($this->UserId) . "' AND `visit_id`!='" . @mysql_real_escape_string($this->VisitId) . "';"); } } } else { if (STATS_ACTIVE) { $this->IsCrawler = true; $STATS->ProcessAction(ST_ACTION_LOG_CRAWLER_ACCESS, array($this->GetCrawlerId($detector->Browser), null)); } } } }
<?php require_once 'cookieProcess.php'; ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" > <title>雇员管理系统</title> </head> <body> <h1>管理员登录</h1> <form action="loginProcess.php" method="post"> <table> <tr><td>用户名:</td><td><input type="text" name="code" value="<?php echo getCookieValue('username'); ?> "></td></tr> <tr><td>密 码:</td><td><input type="password" name="password"></td></tr> <tr><td colspan="2">保存用户名<input type="checkbox" name="keep"></td></tr> <tr> <td><input type="submit" value="登录"></td> <td><input type="reset" value="重新输入"></td> </tr> </table> </form> <?php /** * Created by PhpStorm. * User: fish * Date: 2015/12/11 * Time: 10:22
if ($INPUTS[113]->Cookie) { $BROWSER->Company = getCookieValue("form_113"); } } if ($INPUTS[114]->IsServerInput()) { $BROWSER->Question = $INPUTS[114]->GetServerInput(); } else { if (isset($INPUTS[114]->Cookie) && $INPUTS[114]->Cookie) { $BROWSER->Question = getCookieValue("form_114"); } } if ($INPUTS[116]->IsServerInput()) { $BROWSER->Phone = $INPUTS[116]->GetServerInput(); } else { if (isset($INPUTS[116]->Cookie) && $INPUTS[116]->Cookie) { $BROWSER->Phone = getCookieValue("form_116"); } } if (JAVASCRIPT) { if (isset($_GET[GET_TRACK_RESOLUTION_WIDTH])) { if (!BaseURL::IsInputURL()) { abortTracking(3); } $currentURL = new HistoryURL(BaseURl::GetInputURL(), getOParam(GET_TRACK_SPECIAL_AREA_CODE, "", $nu, null, null, 255), getOParam(GET_EXTERN_DOCUMENT_TITLE, "", $nu, null, null, 255), getOParam(GET_TRACK_REFERRER, "", $nu, FILTER_SANITIZE_URL, null, 510), time()); if ($currentURL->Referrer->IsInternalDomain()) { $currentURL->Referrer = new BaseUrl(""); } if ($currentURL->Url->Excluded) { abortTracking(4); } if ($monitoringActive) {
$externalUser->Browsers[0]->SaveLoginData(); } else { if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RATE) { initData(array("INTERNAL")); $externalUser->SaveRate(base64UrlDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]), $CONFIG, $externalUser->Browsers[0]->ChatId); } else { if ($externalUser->Browsers[0]->Status != CHAT_STATUS_OPEN || $externalUser->Browsers[0]->Waiting) { $externalUser->Browsers[0]->CloseChat(7); $externalUser->Browsers[0] = new VisitorChat($externalUser->UserId, base64UrlDecode(@$_POST[POST_EXTERN_USER_BROWSERID]), $externalUser->Browsers[0]->Fullname, $externalUser->Browsers[0]->Email, $externalUser->Browsers[0]->Company, $externalUser->Browsers[0]->Question, $externalUser->Browsers[0]->Customs, $externalUser->Browsers[0]->DesiredChatGroup, $externalUser->Browsers[0]->DesiredChatPartner, $externalUser->Browsers[0]->Phone); } else { $externalUser->Browsers[0]->ChatId = base64UrlDecode(@$_POST[POST_EXTERN_CHAT_ID]); } $externalUser->Browsers[0]->Waiting = false; $externalUser->Browsers[0]->WaitingMessageDisplayed = null; if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RELOAD_GROUPS) { if ($INPUTS[111]->IsServerInput() && isnull(getCookieValue("form_111"))) { $externalUser->Browsers[0]->Fullname = $INPUTS[111]->GetServerInput(); } if ($INPUTS[112]->IsServerInput()) { $externalUser->Browsers[0]->Email = $INPUTS[112]->GetServerInput(); } if ($INPUTS[113]->IsServerInput()) { $externalUser->Browsers[0]->Company = $INPUTS[113]->GetServerInput(); } if ($INPUTS[114]->IsServerInput()) { $externalUser->Browsers[0]->Question = $INPUTS[114]->GetServerInput(); } $externalUser->Browsers[0]->Customs = getCustomArray($externalUser->Browsers[0]->Customs); $externalUser = replaceLoginDetails($externalUser); $externalUser = reloadGroups($externalUser); } else {