/** * 获取登陆用户 */ public static function GetLoginUser() { $sessionKey = SESSION_LOGIN_USER; $cookieKey = COOKIE_USER_ID; $user = Session::Get($sessionKey); if ($user) { return $user; } $userID = Cookie::Get($cookieKey); if ($userID) { $user = self::Fetch($userID); if ($user) { self::SaveUser($user); return $user; } } return false; }
function __construct() { $this->cookieId = Cookie::Get('id'); $this->cookieHash = Cookie::Get('hash'); $this->db = new db(); }
function getChatVoucherTemplate($html = "") { Server::InitDataBlock(array("DBCONFIG")); if (!Is::Defined("DB_CONNECTION") || !empty(Server::$Configuration->Database["ccpp"]["Custom"])) { return ""; } if (!empty(Server::$Configuration->File["gl_ccac"])) { foreach (Server::$Configuration->Database["cct"] as $type) { $html .= $type->GetTemplate(); } } $cchtml = IOStruct::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(Encoding::Base64UrlDecode($_GET["co"])) . "'" : ""; if (!Is::Null(Cookie::Get("userid")) || !empty($prefillco)) { $result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_VOUCHERS . "` WHERE `visitor_id`='" . DBManager::RealEscape(Cookie::Get("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 = Server::$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(Server::$Configuration->File["gl_ccsv"]) ? "''" : "none", $cchtml); $cchtml = str_replace("<!--voucher_form-->", $html, $cchtml); if (!empty(Server::$Configuration->Database["ccpp"]["PayPal"]->LogoURL)) { $cchtml = str_replace("<!--pp_logo_url-->", " src=\"" . Server::$Configuration->Database["ccpp"]["PayPal"]->LogoURL . "\"", $cchtml); } else { $cchtml = str_replace("<!--pp_logo_url-->", "", $cchtml); } $cchtml = str_replace("<!--extends_voucher-->", !empty($_GET["co"]) && strlen(Encoding::Base64UrlDecode($_GET["co"])) == 16 ? Encoding::Base64UrlDecode($_GET["co"]) : "", $cchtml); $cchtml = str_replace("<!--ofc-->", !empty($_GET["ofc"]) ? "MQ__" : "", $cchtml); $cchtml = str_replace("<!--VAT-->", str_replace("<!--VAT-->", Server::$Configuration->File["gl_ccva"], LocalizationManager::$TranslationStrings["client_voucher_include_vat"]), $cchtml); return $cchtml; }
$html = str_replace("<!--is_mobile-->", To::BoolString($MobileDetect->isMobile() && !$MobileDetect->isTablet()), $html); $html = str_replace("<!--ticket_file_uploads-->", To::BoolString(true), $html); $html = str_replace("<!--kb_suggest-->", To::BoolString(Server::$Configuration->File["gl_knbs"]), $html); $html = str_replace("<!--kb_query_min_length-->", intval(Server::$Configuration->File["gl_kbml"]), $html); $html = str_replace("<!--show_waiting_message-->", To::BoolString(strlen(Server::$Configuration->File["gl_wmes"]) > 0), $html); $html = str_replace("<!--waiting_message_time-->", Server::$Configuration->File["gl_wmes"], $html); $html = str_replace("<!--extern_frequency-->", Server::$Configuration->File["poll_frequency_clients"], $html); $html = str_replace("<!--cbcd-->", To::BoolString(Server::$Configuration->File["gl_cbcd"]), $html); $html = str_replace("<!--bookmark_name-->", base64_encode(Server::$Configuration->File["gl_site_name"]), $html); $html = str_replace("<!--user_id-->", SESSION, $html); $html = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $html); $html = GeoTracking::Replace($html); $html = str_replace("<!--requested_intern_userid-->", base64_encode(!empty($_GET[GET_EXTERN_INTERN_USER_ID]) && isset(Server::$Operators[Operator::GetSystemId(Encoding::Base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]) ? Encoding::Base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : ""), $html); $html = str_replace("<!--requested_intern_fullname-->", base64_encode(!empty($_GET[GET_EXTERN_INTERN_USER_ID]) && isset(Server::$Operators[Operator::GetSystemId(Encoding::Base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]) ? Server::$Operators[Operator::GetSystemId(Encoding::Base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))]->Fullname : ""), $html); $html = str_replace("<!--debug-->", To::BoolString(!empty($_GET["debug"])), $html); $html = str_replace("<!--geo_resolute-->", To::BoolString(!empty(Server::$Configuration->File["gl_use_ngl"]) && !(Cookie::Get("geo_data") != null && Cookie::Get("geo_data") > time() - 2592000) && !GeoTracking::SpanExists()), $html); $html = str_replace("<!--chat_id-->", !empty($_GET["cid"]) ? getParam("cid") : "", $html); $html = str_replace("<!--gtv2_api_key-->", strlen(Server::$Configuration->File["gl_otrs"]) > 1 ? Server::$Configuration->File["gl_otrs"] : "", $html); $html = str_replace("<!--template_message_intern-->", base64_encode(str_replace("<!--color-->", ExternalChat::ReadBackgroundColor(), str_replace("<!--dir-->", LocalizationManager::$Direction, IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_INTERN)))), $html); $html = str_replace("<!--template_message_extern-->", base64_encode(str_replace("<!--dir-->", LocalizationManager::$Direction, IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_EXTERN))), $html); $html = str_replace("<!--template_message_add-->", base64_encode(str_replace("<!--dir-->", LocalizationManager::$Direction, IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_ADD))), $html); $html = str_replace("<!--template_message_add_alt-->", base64_encode(str_replace("<!--dir-->", LocalizationManager::$Direction, IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE))), $html); $html = str_replace("<!--primary_color-->", ExternalChat::ReadBackgroundColor(), $html); $html = str_replace("<!--secondary_color-->", ExternalChat::ReadTextColor(), $html); $html = str_replace("<!--direct_login-->", To::BoolString(isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET]) || isset($_GET["dl"])), $html); $html = str_replace("<!--preselect_ticket-->", To::BoolString(isset($_GET["pt"])), $html); $html = str_replace("<!--is_ie-->", To::BoolString(!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false), $html); $html = str_replace("<!--is_ios-->", To::BoolString($MobileDetect->isIOS()), $html); $html = str_replace("<!--setup_error-->", base64_encode(buildLoginErrorField()), $html); $html = str_replace("<!--offline_message_mode-->", Server::$Configuration->File["gl_om_mode"], $html); $html = str_replace("<!--offline_message_http-->", Server::$Configuration->File["gl_om_http"], $html);
static function Set($_key, $_value, $_onlyWhenEmpty = false) { if (!empty(Server::$Configuration->File["gl_colt"]) && !empty($_value)) { $current = Cookie::Get($_key); if ($_onlyWhenEmpty && $current != null) { return; } if ($current == $_value) { return; } $lifetime = empty(Server::$Configuration->File["gl_colt"]) ? 0 : time() + Server::$Configuration->File["gl_colt"] * 86400; setcookie("lz_" . $_key, $_COOKIE["lz_" . $_key] = base64_encode($_value), $lifetime); setcookie("livezilla", "", time() - 3600); } }
static function TriggerEvents() { if (count(Server::$Events) == 0) { return; } $actionData = ""; $url = VisitorMonitoring::$Browser->History[count(VisitorMonitoring::$Browser->History) - 1]; $previous = count(VisitorMonitoring::$Browser->History) > 1 ? VisitorMonitoring::$Browser->History[count(VisitorMonitoring::$Browser->History) - 2]->Url->GetAbsoluteUrl() : ""; foreach (Server::$Events->Events as $event) { if (!$event->IsActive || empty($url)) { continue; } $urlor = count($event->FunnelUrls) == 0 && $event->MatchesURLCriterias($url->Url->GetAbsoluteUrl(), $url->Referrer->GetAbsoluteUrl(), $previous, time() - $url->Entrance); $urlfunnel = count($event->FunnelUrls) > 0 && $event->MatchesURLFunnelCriterias(VisitorMonitoring::$Browser->History); $global = $event->MatchesGlobalCriterias(count(VisitorMonitoring::$Browser->History), VisitorMonitoring::$Visitor->ExitTime - VisitorMonitoring::$Visitor->FirstActive, VisitorMonitoring::$Visitor->HasAcceptedChatRequest, VisitorMonitoring::$Visitor->HasDeclinedChatRequest, VisitorMonitoring::$Visitor->WasInChat(), VisitorMonitoring::$Browser->Query, VisitorMonitoring::$IsMobile || VisitorMonitoring::$IsTablet, VisitorMonitoring::$Visitor->GeoCountryISO2); if ($global && ($urlfunnel || $urlor)) { foreach (array($event->Goals, $event->Actions) as $elements) { foreach ($elements as $action) { $EventTrigger = new EventTrigger(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Id, time(), 1); $EventTrigger->Load(); $aexists = $action->Exists(CALLER_USER_ID, CALLER_BROWSER_ID); if (!$EventTrigger->Exists || $EventTrigger->Exists && $event->MatchesTriggerCriterias($EventTrigger)) { if (!$aexists) { if ($event->SaveInCookie) { if (!Is::Null(Cookie::Get("ea_" . $action->Id))) { continue; } else { Cookie::Set("ea_" . $action->Id, time()); } } $EventTrigger->Save($event->Id); if ($action->Type < 2) { foreach ($action->GetInternalReceivers() as $user_id) { $intaction = new EventActionInternal($user_id, $EventTrigger->Id); $intaction->Save(); } } else { if ($action->Type == 2 && !defined("EVENT_INVITATION")) { $sender = getActionSender($action->Invitation->Senders, true); Server::InitDataBlock(array("GROUPS")); if (!empty($sender) && !empty(Server::$Groups[$sender->GroupId]) && Server::$Groups[$sender->GroupId]->IsHumanAvailable(false) && !(VisitorMonitoring::$Browser->ChatRequest != null && !VisitorMonitoring::$Browser->ChatRequest->Closed) && !VisitorMonitoring::$Visitor->IsInChat(false, null, true)) { define("EVENT_INVITATION", true); $chatrequest = new ChatRequest($sender->UserSystemId, $sender->GroupId, CALLER_USER_ID, CALLER_BROWSER_ID, getActionText($sender, $action)); $chatrequest->EventActionId = $action->Id; $chatrequest->Save(); if (!$chatrequest->Displayed) { VisitorMonitoring::$Browser->ForceUpdate(); } VisitorMonitoring::$Browser->ChatRequest = $chatrequest; } } else { if ($action->Type == 3 && !defined("EVENT_ALERT")) { define("EVENT_ALERT", true); $alert = new Alert(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Value); $alert->EventActionId = $action->Id; $alert->Save(); VisitorMonitoring::$Browser->LoadAlerts(); } else { if ($action->Type == 4 && !defined("EVENT_WEBSITE_PUSH")) { define("EVENT_WEBSITE_PUSH", true); $sender = getActionSender($action->WebsitePush->Senders, false); $websitepush = new WebsitePush($sender->UserSystemId, $sender->GroupId, CALLER_USER_ID, CALLER_BROWSER_ID, getActionText($sender, $action), $action->WebsitePush->Ask, $action->WebsitePush->TargetURL); $websitepush->EventActionId = $action->Id; $websitepush->Save(); VisitorMonitoring::$Browser->LoadWebsitePush(); } else { if ($action->Type == 5 && !defined("EVENT_OVERLAY_BOX")) { define("EVENT_OVERLAY_BOX", true); $overlaybox = new OverlayBox(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Value); $overlaybox->EventActionId = $action->Id; $overlaybox->Save(); VisitorMonitoring::$Browser->LoadOverlayBoxes(); } else { if ($action->Type == 9 && STATS_ACTIVE) { Server::$Statistic->ProcessAction(ST_ACTION_GOAL, array(CALLER_USER_ID, $action->Id, VisitorMonitoring::$Visitor->Visits == 1 ? 1 : 0, VisitorMonitoring::$Browser->GetQueryId(Cookie::Get("sp"), null, 255, true))); } } } } } } } } if ($EventTrigger->Exists && $aexists) { $EventTrigger->Update(); } } } } } return $actionData; }
<?php session_start(); define("PLSPATH", __DIR__ . "/../"); require PLSPATH . 'classes/Config.php'; require PLSPATH . 'classes/Database.php'; require PLSPATH . 'classes/Validate.php'; require PLSPATH . 'classes/Authentication.php'; require PLSPATH . 'classes/User.php'; require PLSPATH . 'classes/Session.php'; require PLSPATH . 'classes/Error.php'; require PLSPATH . 'classes/Email.php'; require PLSPATH . 'classes/Cookie.php'; require PLSPATH . 'classes/Avatar.php'; Config::LoadFile("config/config.php"); Config::LoadFile("config/lang.php"); $db = new Database(); $db->Connect(); if (Config::Get("validation.use_captcha")) { require PLSPATH . 'classes/vendor/captcha/recaptchalib.php'; } if (isset($_COOKIE["rememberme"])) { if (!Authentication::Login(Cookie::Get(), true)) { Cookie::Clear(); } }
exit("eval(lz_global_base64_decode('" . base64_encode(IOStruct::GetFile(PATH_TEMPLATES . "jscript/jstrack.mob.tpl")) . "'));lz_tracking_stop_tracking(75);"); } if (BaseURL::IsInputURL() && strpos(BaseURL::GetInputURL(), GET_INTERN_COBROWSE) !== false) { VisitorMonitoring::Abort(1); } VisitorMonitoring::$Browser = new VisitorBrowser(CALLER_BROWSER_ID, CALLER_USER_ID); VisitorMonitoring::$Visitor->AddBrowser(VisitorMonitoring::$Browser); if (VisitorMonitoring::$Visitor->FirstCall && !VisitorMonitoring::$Browser->GetFirstCall()) { VisitorMonitoring::$Visitor->FirstCall = false; } Server::InitDataBlock(array("FILTERS", "EVENTS")); define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), CALLER_USER_ID, VisitorMonitoring::$Visitor->GeoCountryISO2)); define("IS_FLOOD", VisitorMonitoring::$Browser->GetFirstCall() && Filter::IsFlood(Communication::GetIP(), CALLER_USER_ID)); Server::InitDataBlock(array("INTERNAL")); $deactp = Communication::ReadParameter("deactr", 0); if (IS_FILTERED && !FILTER_ALLOW_TRACKING || IS_FLOOD || !empty($deactp) || Cookie::Get(OO_TRACKING_FILTER_NAME) != null) { if (!IS_FILTERED) { Filter::Create($_SERVER["REMOTE_ADDR"], CALLER_USER_ID, OO_TRACKING_FILTER_NAME, !empty($deactp) ? $deactp : 365, true, true); } VisitorMonitoring::LoadOverlayChat(); VisitorMonitoring::$IsActive = false; VisitorMonitoring::Abort(556); } VisitorMonitoring::$Browser->UserData->LoadFromPassThru(); if (JAVASCRIPT) { if (Visitor::$PollCount <= 3) { if (!BaseURL::IsInputURL()) { VisitorMonitoring::Abort(3); } $currentURL = new HistoryURL(BaseURl::GetInputURL(), Communication::GetParameter(GET_TRACK_SPECIAL_AREA_CODE, "", $nu, null, null, 255), Communication::GetParameter(GET_EXTERN_DOCUMENT_TITLE, "", $nu, null, null, 255), Communication::GetParameter(GET_TRACK_REFERRER, "", $nu, FILTER_SANITIZE_URL, null, 510), time()); if ($currentURL->Referrer->IsInternalDomain()) {
function GetPredefinedOperator($_user, &$direct_target, $_allowBots, $_requireBot, $desired = "") { if (!empty($this->TargetOperatorSystemId) && isset(Server::$Operators[$this->TargetOperatorSystemId]) && Server::$Operators[$this->TargetOperatorSystemId]->Status < USER_STATUS_OFFLINE) { if (!(!empty($this->TargetGroupId) && !in_array($this->TargetGroupId, Server::$Operators[$this->TargetOperatorSystemId]->GetGroupList(true)))) { $desired = $this->TargetOperatorSystemId; } } else { $this->TargetOperatorSystemId = null; $opParam = Operator::ReadParams(); if (!empty($opParam)) { $desired = $direct_target = Operator::GetSystemId($opParam); } else { if (!Is::Null(Cookie::Get("internal_user")) && !empty(Server::$Configuration->File["gl_save_op"])) { $desired = Operator::GetSystemId(Cookie::Get("internal_user")); if (!empty(Server::$Operators[$desired]) && !(!empty($this->TargetGroupId) && !in_array($this->TargetGroupId, Server::$Operators[$desired]->GetGroupList(true)))) { $direct_target = $desired; } else { $desired = ""; } } else { if (empty($desired) && !empty(Server::$Configuration->File["gl_save_op"])) { $desired = $_user->GetLastChatOperator(true); } } } } if (!empty($desired) && Server::$Operators[$desired]->MobileSleep($_user->Browsers[0])) { $this->TargetOperatorSystemId = $desired = ""; } else { if (!empty($desired) && !$_allowBots && Server::$Operators[$desired]->IsBot) { $this->TargetOperatorSystemId = $desired = ""; } else { if (!empty($desired) && $_requireBot && !Server::$Operators[$desired]->IsBot) { $this->TargetOperatorSystemId = $desired = ""; } } } return $desired; }
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) && Is::Null(Cookie::Get("sp"))) { Cookie::Set("sp", $this->Query); } $this->UpdateParams["query"] = $this->GetQueryId($this->Query, $_referrer); DBManager::Execute(true, $d = "UPDATE `" . DB_PREFIX . DATABASE_VISITOR_BROWSERS . "` SET `query`='" . DBManager::RealEscape($this->UpdateParams["query"]) . "' WHERE `id`='" . DBManager::RealEscape($this->BrowserId) . "' LIMIT 1;"); return true; } } } } return $issearchengine; }