Esempio n. 1
0
}
if (!isset($_GET["browid"])) {
    exit;
}
languageSelect();
initData(array("INTERNAL", "GROUPS", "FILTERS", "INPUTS"));
$USER = new Visitor(base64UrlDecode(getParam(GET_TRACK_USERID)));
$USER->Load();
array_push($USER->Browsers, new VisitorChat($USER->UserId, $USER->UserId . "_OVL"));
array_push($USER->Browsers, $BROWSER);
$GroupBuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $USER->Browsers[0]->DesiredChatGroup, $USER->Browsers[0]->DesiredChatPartner, false);
$GroupBuilder->Generate(null, true);
$USER->Browsers[0]->Overlay = true;
$USER->Browsers[0]->Load();
if ($USER->Browsers[0]->FirstCall) {
    $USER->AddFunctionCall("lz_chat_init_data_change(null,null);", false);
}
if (IS_FILTERED) {
    $USER->Browsers[0]->CloseChat();
    $USER->Browsers[0]->Destroy();
    $USER->AddFunctionCall("lz_tracking_remove_overlay_chat();", true);
}
$USER->Browsers[0]->LoadForward(false);
$USER->LoadChatRequests();
if (!empty($USER->Browsers[0]->Forward) && (!$GROUPS[$USER->Browsers[0]->Forward->TargetGroupId]->IsHumanAvailable(true, true) || !empty($USER->Browsers[0]->Forward->TargetSessId) && @$INTERNAL[$USER->Browsers[0]->Forward->TargetSessId]->UserStatus >= USER_STATUS_OFFLINE)) {
    $USER->Browsers[0]->Forward->Destroy();
    $USER->Browsers[0]->Forward = null;
    $USER->Browsers[0]->ExternalClose();
    $USER->Browsers[0]->Save();
    $USER->Browsers[0]->Load();
}
 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();
             }
             if (count($matches) > 0) {
                 foreach ($matches as $match) {
                     $res = IOStruct::GetFile(PATH_TEMPLATES . "kb_result_category.tpl");
                     $res = str_replace("<!--title-->", htmlentities($match->Title, ENT_QUOTES, "UTF-8"), $res);
Esempio n. 3
0
}
if (!isset($_GET["browid"])) {
    exit;
}
languageSelect();
initData(array("INTERNAL", "GROUPS", "FILTERS", "INPUTS"));
$USER = new Visitor(base64UrlDecode(getParam(GET_TRACK_USERID)));
$USER->Load();
array_push($USER->Browsers, new VisitorChat($USER->UserId, $USER->UserId . "_OVL"));
array_push($USER->Browsers, $BROWSER);
$GroupBuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $USER->Browsers[0]->DesiredChatGroup, $USER->Browsers[0]->DesiredChatPartner, false);
$GroupBuilder->Generate(null, true);
$USER->Browsers[0]->Overlay = true;
$USER->Browsers[0]->Load();
if ($USER->Browsers[0]->FirstCall) {
    $USER->AddFunctionCall("lz_chat_init_data_change(null,null);", false);
}
if (IS_FILTERED) {
    $USER->Browsers[0]->CloseChat();
    $USER->Browsers[0]->Destroy();
    $USER->AddFunctionCall("lz_tracking_remove_overlay_chat();", true);
}
$USER->Browsers[0]->LoadForward(false);
$USER->LoadChatRequests();
if (!empty($USER->Browsers[0]->Forward) && (!$GROUPS[$USER->Browsers[0]->Forward->TargetGroupId]->IsHumanAvailable(true, true) || !empty($USER->Browsers[0]->Forward->TargetSessId) && @$INTERNAL[$USER->Browsers[0]->Forward->TargetSessId]->UserStatus >= USER_STATUS_OFFLINE)) {
    $USER->Browsers[0]->Forward->Destroy();
    $USER->Browsers[0]->Forward = null;
    $USER->Browsers[0]->ExternalClose();
    $USER->Browsers[0]->Save();
    $USER->Browsers[0]->Load();
}