$html = getTicketInputs($html); if (isset($_POST["form_111"]) && !empty($_POST["form_111"])) { setCookieValue("form_111", $_POST["form_111"]); } if (isset($_POST["form_112"]) && !empty($_POST["form_112"])) { setCookieValue("form_112", $_POST["form_112"]); } if (isset($_POST["form_113"]) && !empty($_POST["form_113"])) { setCookieValue("form_113", $_POST["form_113"]); } if (isset($_POST["form_114"]) && !empty($_POST["form_114"])) { setCookieValue("form_114", $_POST["form_114"]); } $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--direct_send-->", isset($_GET["ds"]) ? "top.lz_chat_check_ticket_inputs();" : "document.getElementById('lz_chat_loading').style.display='none';document.getElementById('lz_ticket_elements').style.display='';", $html); $html = replaceLoginDetails($html); $html = str_replace("<!--groups-->", $groupbuilder->GetHTML(), $html); $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html); $html = str_replace("<!--group_select_visibility-->", defined("HideTicketGroupSelection") || count($GROUPS) < 2 ? "display:none;" : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.1.1") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); if (isset($_GET[GET_EXTERN_USER_HEADER]) && !empty($_GET[GET_EXTERN_USER_HEADER])) { $html = str_replace("<!--logo-->", "<img src=\"" . base64UrlDecode($_GET[GET_EXTERN_USER_HEADER]) . "\" alt=\"\" border=\"0\"><br>", $html); } else { $html = str_replace("<!--logo-->", file_exists(FILE_CARRIERLOGO) ? "<img src=\"" . FILE_CARRIERLOGO . "\" alt=\"livezilla.net\" border=\"0\"><br>" : "", $html); } $html = str_replace("<!--background-->", file_exists(FILE_CARRIERHEADER) ? "<img src=\"" . FILE_CARRIERHEADER . "\" alt=\"livezilla.net\" border=\"0\"><br>" : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.0.0" && isset($_GET[GET_EXTERN_GROUP])) { initData(false, true, false, 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 { $externalUser->Browsers[0]->CloseWindow(); exit; } } } } if (!isset($_POST[POST_EXTERN_RESOLUTION_WIDTH])) { $externalUser->KeepAlive(); } else { $externalUser->Save($CONFIG, array(getOParam(POST_EXTERN_RESOLUTION_WIDTH, "", $nu, FILTER_SANITIZE_SPECIAL_CHARS, null, 32), getOParam(POST_EXTERN_RESOLUTION_HEIGHT, "", $nu, FILTER_SANITIZE_SPECIAL_CHARS, null, 32)), getOParam(POST_EXTERN_COLOR_DEPTH, "", $nu, FILTER_SANITIZE_SPECIAL_CHARS, null, 32), getOParam(POST_EXTERN_TIMEZONE_OFFSET, "", $nu, FILTER_SANITIZE_SPECIAL_CHARS, null, 32), getOParam(GEO_LATITUDE, -522, $nu, FILTER_VALIDATE_FLOAT), getOParam(GEO_LONGITUDE, -522, $nu, FILTER_VALIDATE_FLOAT), getOParam(GEO_COUNTRY_ISO_2, "", $nu, null, null, 32), getOParam(GEO_CITY, "", $nu, null, null, 255), getOParam(GEO_REGION, "", $nu, null, null, 255), getOParam(GEO_TIMEZONE, "", $nu, null, null, 24), getOParam(GEO_ISP, "", $nu, null, null, 255), getOParam(GEO_SSPAN, 0, $nu, FILTER_VALIDATE_INT), getOParam(GEO_RESULT_ID, "", $nu, FILTER_SANITIZE_SPECIAL_CHARS, null, 32)); } if ($externalUser->SignatureMismatch) { $externalUser->AddFunctionCall("lz_chat_set_signature(\"" . $externalUser->UserId . "\");", true);
$chat = str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_HTML_OVERLAY_CHAT)); $chat = getChatLoginInputs($chat, MAX_INPUT_LENGTH_OVERLAY, true); $chat = str_replace("<!--tr_vis-->", strlen($CONFIG["gl_otrs"]) > 1 ? "''" : "none", $chat); $chat = str_replace("<!--overlay_input_max_length-->", MAX_INPUT_LENGTH_OVERLAY, $chat); $chat = applyReplacements($chat, true, false); $chat = str_replace("<!--bgc-->", base64UrlDecode($_GET["ovlc"]), $chat); $chat = str_replace("<!--bgcd-->", hexDarker(str_replace("#", "", base64UrlDecode($_GET["ovlc"])), 50), $chat); $chat = str_replace("<!--tc-->", base64UrlDecode($_GET["ovlct"]), $chat); $chat = str_replace("<!--apo-->", !empty($_GET["ovlapo"]) ? "" : "display:none;", $chat); $chat = str_replace("<!--offer_transcript-->", !empty($CONFIG["gl_soct"]) ? "" : "DISABLED", $chat); $chat = str_replace("<!--activate_transcript-->", empty($CONFIG["gl_soct"]) ? "" : "CHECKED", $chat); $chat = str_replace("<!--param-->", @$CONFIG["gl_cpas"], $chat); $mylang = getBrowserLocalization(); $tlanguages = getLanguageSelects(getBrowserLocalization()); $chat = str_replace("<!--languages-->", $tlanguages, $chat); replaceLoginDetails($USER); } if (($USER->Browsers[0]->Status > CHAT_STATUS_OPEN || !empty($USER->Browsers[0]->InitChatWith) || $USER->Browsers[0]->Waiting) && !$USER->Browsers[0]->Closed) { $ACTIVE_OVLC = $conline = !$USER->Browsers[0]->Declined; } else { if ($USER->Browsers[0]->Closed && $USER->Browsers[0]->LastActive > time() - $CONFIG["timeout_chats"] || !empty($_GET["mi0"])) { $ACTIVE_OVLC = !$USER->Browsers[0]->Declined; } } if (!empty($USER->Browsers[0]->DesiredChatGroup) && !IS_FILTERED) { $changed = $USER->Browsers[0]->ApplyOverlayInputValues($USER->Browsers[1]); if (isset($_GET["tc"])) { $changed = true; } if (empty($USER->Browsers[0]->Question) && !empty($_GET["mp0"])) { $USER->Browsers[0]->Question = cutString(base64UrlDecode($_GET["mp0"]), 255);