require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php"; require LIVEZILLA_PATH . "_lib/functions.external.inc.php"; require LIVEZILLA_PATH . "_lib/objects.external.inc.php"; Server::DefineURL(FILE_CHAT); Server::InitDataProvider(); LocalizationManager::AutoLoad(); $browserId = getId(USER_ID_LENGTH); if (!isset($_GET[GET_EXTERN_TEMPLATE])) { @set_time_limit(Server::$Configuration->File["timeout_chats"]); if (!isset($_GET["file"])) { @set_error_handler("handleError"); } define("SESSION", getSessionId()); if (empty(Server::$Configuration->File["gl_om_pop_up"]) && Server::$Configuration->File["gl_om_mode"] == 1) { Server::InitDataBlock(array("INTERNAL", "GROUPS", "FILTERS")); $groupbuilder = new GroupBuilder(); $groupbuilder->Generate(); if (!$groupbuilder->GroupAvailable) { exit("<html><script language=\"JavaScript\">if(typeof(window.opener != null) != 'undefined')window.opener.location = \"" . Server::$Configuration->File["gl_om_http"] . "\";window.close();</script></html>"); } } 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));
function reloadGroups($_user) { global $CONFIG, $INTERNAL, $GROUPS; initData(true, false, false, true); $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG); $groupbuilder->Generate(); if (isset($_POST[POST_EXTERN_REQUESTED_INTERNID]) && !empty($_POST[POST_EXTERN_REQUESTED_INTERNID])) { $_user->Browsers[0]->DesiredChatPartner = getInternalSystemIdByUserId(AJAXDecode($_POST[POST_EXTERN_REQUESTED_INTERNID])); } $_user->AddFunctionCall("top.lz_chat_set_groups(\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ");", false); $_user->AddFunctionCall("lz_chat_release(" . parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2) . "," . $groupbuilder->ErrorHTML . ");", false); return $_user; }
public static function setNameInfoBlock($name) { self::$_nameInfoBlock = $name; }
$html = isset($CONFIG["gl_site_name"]) ? str_replace("<!--config_name-->", $CONFIG["gl_site_name"], $html) : str_replace("<!--config_name-->", "LiveZilla", $html); $html = getChatLoginInputs($html, MAX_INPUT_LENGTH); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--com_chats-->", getChatVoucherTemplate(), $html); $html = str_replace("<!--ssl_secured-->", getScheme() == SCHEME_HTTP_SECURE && !empty($CONFIG["gl_sssl"]) ? "" : "display:none;", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.lgin.0.0") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat" && isset($_POST[GET_EXTERN_GROUP])) { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--intgroup-->", base64UrlEncode($_POST[GET_EXTERN_GROUP]), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.mail.1.0") { initData(array("INTERNAL", "GROUPS", "INPUTS")); $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, NULL); $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = getChatLoginInputs($html, MAX_INPUT_LENGTH); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--ssl_secured-->", getScheme() == SCHEME_HTTP_SECURE && !empty($CONFIG["gl_sssl"]) ? "" : "display:none;", $html); $html = str_replace("<!--groups-->", $groupbuilder->GetHTML($DEFAULT_BROWSER_LANGUAGE), $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]) . "\" border=\"0\"><br>", $html); } else { if (!empty($CONFIG["gl_cali"])) { $html = str_replace("<!--logo-->", "<img src=\"" . $CONFIG["gl_cali"] . "\" border=\"0\"><br>", $html); } }
function reloadGroups($_user) { global $CONFIG, $INTERNAL, $GROUPS; initData(array("INTERNAL", "FILTERS")); if (!empty($_GET[GET_EXTERN_GROUP])) { $_user->Browsers[0]->DesiredChatGroup = base64UrlDecode(getParam(GET_EXTERN_GROUP)); } $opParam = getOperatorParameter(); if (!empty($opParam)) { $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $_user->Browsers[0]->DesiredChatGroup, $_user->Browsers[0]->DesiredChatPartner); $groupbuilder->Generate($_user); if (!empty($opParam)) { $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupsAvailable = parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2); $_user->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ");", false); $_user->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false); return $_user; }
$html = str_replace("<!--info_text-->", $CONFIG["gl_info"], $html); $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html); $html = str_replace("<!--group_select_visibility-->", defined("HideChatGroupSelection") || count($GROUPS) < 2 ? "display:none;" : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.0.0") { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--button_message-->", $CONFIG["gl_no_om_sp"] ? "" : getFile(TEMPLATE_HTML_BUTTON_MESSAGE), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat" && isset($_POST[GET_EXTERN_GROUP])) { $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--intgroup-->", base64_encode($_POST[GET_EXTERN_GROUP]), $html); $html = str_replace("<!--misc_frame_height-->", $CONFIG["gl_uret"] && $CONFIG["gl_otrs"] ? 52 : ($CONFIG["gl_uret"] || $CONFIG["gl_otrs"] ? 31 : 0), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.mail") { initData(false, true, false, false); $groupbuilder = new GroupBuilder(NULL, $GROUPS, NULL); $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $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);
require LIVEZILLA_PATH . "_lib/functions.external.inc.php"; require LIVEZILLA_PATH . "_lib/objects.external.inc.php"; @set_time_limit($CONFIG["timeout_chats"]); if (!isset($_GET["file"])) { @set_error_handler("handleError"); } 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();
function ReloadGroups($_overlay = false, $_preSelect = true) { Server::InitDataBlock(array("INTERNAL", "FILTERS")); $grParam = UserGroup::ReadParams(); $opParam = Operator::ReadParams(); if (!empty($grParam) && empty($this->Browsers[0]->DesiredChatGroup)) { $this->Browsers[0]->DesiredChatGroup = $grParam; } if (!empty($opParam)) { $this->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupbuilder = new GroupBuilder($this->Browsers[0]->DesiredChatGroup, $this->Browsers[0]->DesiredChatPartner); $groupbuilder->Generate($this); if (!empty($opParam)) { $this->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupsAvailable = To::BoolString($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2); $_preSelect = $_preSelect ? Encoding::Base64UrlEncode($this->Browsers[0]->DesiredChatGroup) : ""; $this->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ",'" . $_preSelect . "');", false); if (!$_overlay) { $this->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false); } }
function reloadGroups($_user, $_overlay = false, $_preSelect = true, $_declined = false) { global $CONFIG, $INTERNAL, $GROUPS; initData(array("INTERNAL", "FILTERS")); $grParam = UserGroup::ReadParams(); $opParam = Operator::ReadParams(); if (!empty($grParam) && empty($_user->Browsers[0]->DesiredChatGroup)) { $_user->Browsers[0]->DesiredChatGroup = $grParam; } if (!empty($opParam)) { $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $_user->Browsers[0]->DesiredChatGroup, $_user->Browsers[0]->DesiredChatPartner); $groupbuilder->Generate($_user); if (!empty($opParam)) { $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam); } $groupsAvailable = parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2); $_preSelect = $_preSelect ? base64UrlEncode($_user->Browsers[0]->DesiredChatGroup) : ""; $_user->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ",'" . $_preSelect . "');", false); if (!$_overlay) { $_user->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false); } return $_user; }