Пример #1
0
        }
    } else {
        Server::InitDataBlock(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(Filter::CreateFloodFilter(Communication::GetIP(), null));
    }
}
header("Content-Type: text/html; charset=utf-8");
if (!isset($_GET[GET_EXTERN_TEMPLATE])) {
    define("IS_FLOOD", Filter::IsFlood(Communication::GetIP(), null, true));
    define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), SESSION));
    require LIVEZILLA_PATH . "_lib/trdp/mobde.php";
    $MobileDetect = new Mobile_Detect();
    Server::InitDataBlock(array("INTERNAL", "DBCONFIG"));
    VisitorChat::ApplyDynamicGroup();
    $html = IOStruct::GetFile(TEMPLATE_HTML_CHAT);
    $html = str_replace("<!--extern_script-->", IOStruct::GetFile(TEMPLATE_SCRIPT_EXTERN) . IOStruct::GetFile(TEMPLATE_SCRIPT_DATA) . IOStruct::GetFile(TEMPLATE_SCRIPT_CHAT) . IOStruct::GetFile(TEMPLATE_SCRIPT_FRAME), $html);
    $html = str_replace("<!--server_id-->", substr(md5(Server::$Configuration->File["gl_lzid"]), 5, 5), $html);
    $html = str_replace("<!--connector_script-->", IOStruct::GetFile(TEMPLATE_SCRIPT_CONNECTOR), $html);
    $html = str_replace("<!--group_script-->", IOStruct::GetFile(TEMPLATE_SCRIPT_GROUPS), $html);
    $html = str_replace("<!--global_script-->", IOStruct::GetFile(TEMPLATE_SCRIPT_GLOBAL), $html);
    $html = str_replace("<!--browser_id-->", $browserId, $html);
    $html = str_replace("<!--extern_timeout-->", min(Server::$Configuration->File["timeout_chats"], Server::$Configuration->File["timeout_track"]), $html);
    $html = str_replace("<!--show_oib-->", To::BoolString(!empty(Server::$Configuration->File["gl_soib"]) && empty($_GET[GET_EXTERN_DYNAMIC_GROUP])), $html);
    $html = str_replace("<!--window_width-->", Server::$Configuration->File["wcl_window_width"], $html);
    $html = str_replace("<!--window_height-->", Server::$Configuration->File["wcl_window_height"], $html);
    $html = str_replace("<!--window_resize-->", To::BoolString(Server::$Configuration->File["gl_hrol"]), $html);
    $html = str_replace("<!--feedback_on_exit-->", To::BoolString(Server::$Configuration->File["gl_fboe"]), $html);
    $html = str_replace("<!--switch_to_kb-->", To::BoolString(Communication::ReadParameter("t", "") == "kb" && empty($_GET["hfk"])), $html);
    $html = str_replace("<!--kb_only-->", To::BoolString(!empty($_REQUEST["kbo"])), $html);
Пример #2
0
}
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
if (isset($_POST[POST_EXTERN_SERVER_ACTION])) {
    LocalizationManager::AutoLoad();
    Server::InitDataBlock(array("FILTERS", "INPUTS"));
    VisitorChat::$Router = new ChatRouter();
    $externalUser = new Visitor(Encoding::Base64UrlDecode($_POST[POST_EXTERN_USER_USERID]));
    $externalUser->ExtendSession = true;
    $externalUser->Load();
    array_push($externalUser->Browsers, new VisitorChat($externalUser->UserId, Encoding::Base64UrlDecode($_POST[POST_EXTERN_USER_BROWSERID])));
    array_push($externalUser->Browsers, new VisitorBrowser($externalUser->Browsers[0]->BrowserId, $externalUser->Browsers[0]->UserId));
    define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), Encoding::Base64UrlDecode($_POST[POST_EXTERN_USER_USERID]), $externalUser->GeoCountryISO2));
    define("IS_FLOOD", $externalUser->Browsers[0]->FirstCall && Filter::IsFlood(Communication::GetIP(), @$_POST[POST_EXTERN_USER_USERID], true));
    Server::InitDataBlock(array("INTERNAL", "GROUPS"));
    VisitorChat::ApplyDynamicGroup($externalUser->Browsers[0]);
    $externalUser->Browsers[0]->Load();
    if ($externalUser->Browsers[0]->Status == CHAT_STATUS_OPEN && IS_FILTERED && !FILTER_ALLOW_CHATS && !FILTER_ALLOW_TICKETS) {
        $error = buildLoginErrorField();
        $externalUser->AddFunctionCall("lz_chat_release(true,'" . $error . "');", false);
    } else {
        if ($_POST[POST_EXTERN_SERVER_ACTION] == "search_kb") {
            $query = Communication::ReadParameter("p_q", "");
            $color = ExternalChat::ReadTextColor();
            $catcount = 0;
            $main = $result = $navcats = "";
            if ($query == "%ALL%") {
                $matches = KnowledgeBase::GetEntries(Visitor::$BrowserLanguage);
                if (count($matches) == 0) {
                    $matches = KnowledgeBase::GetEntries();
                }