コード例 #1
0
 static function ReplaceColors($_html, $_operator)
 {
     $primary = Communication::ReadParameter("ovlc", "#73be28");
     $secondary = Communication::ReadParameter("ovlct", "#ffffff");
     $textshadow = Communication::ReadParameter("ovlts", 1);
     //$textheader = Communication::ReadParameter("ovlch","#ffffff");
     $_html = str_replace("<!--bgc-->", $primary, $_html);
     $_html = str_replace("<!--bgcm-->", Colors::TransformHEX($primary, 30), $_html);
     $_html = str_replace("<!--bgcd-->", Colors::TransformHEX($primary, 50), $_html);
     $_html = str_replace("<!--tc-->", $secondary, $_html);
     $_html = str_replace("<!--tch-->", $secondary, $_html);
     $_html = str_replace("<!--ts-->", $textshadow == 1 ? "text-shadow:1px 1px 0 #6b6b6b;" : "", $_html);
     return str_replace("<!--color-->", $_operator ? Colors::TransformHEX($secondary, 20) : "#000000", $_html);
 }
コード例 #2
0
 * LiveZilla is a registered trademark.
 *
 * Improper changes to this file may cause critical errors.
 ***************************************************************************************/
define("IN_LIVEZILLA", true);
header('Content-Type: text/html; charset=utf-8');
if (!defined("LIVEZILLA_PATH")) {
    define("LIVEZILLA_PATH", "./");
}
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
@set_error_handler("handleError");
if (!empty($_REQUEST["cid"]) && Server::InitDataProvider()) {
    $chat = VisitorChat::GetByChatId(Communication::ReadParameter("cid", 0));
    if ($chat != null) {
        if ($chat->Closed) {
            exit("lz_chat_file_stop();");
        } else {
            $visitor = new Visitor($chat->UserId);
            $visitor->Load();
            if (isset($_FILES["form_userfile"])) {
                if (StoreFile($visitor, $chat->BrowserId, $chat->DesiredChatPartner, $chat->UserData->Fullname, $chat->ChatId)) {
                    exit("lz_chat_file_ready();");
                } else {
                    exit("lz_chat_file_error(2);");
                }
            } else {
                if (Communication::GetIP() == $visitor->IP) {
                    if (!empty($_POST["p_fu_a"])) {
コード例 #3
0
define("IN_LIVEZILLA", true);
header('Content-Type: text/html; charset=utf-8');
if (!defined("LIVEZILLA_PATH")) {
    define("LIVEZILLA_PATH", "./");
}
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
@set_error_handler("handleError");
if (Server::InitDataProvider()) {
    Server::InitDataBlock(array("DBCONFIG", "INTERNAL"));
    LocalizationManager::AutoLoad();
    $fb_html = IOStruct::GetFile(PATH_TEMPLATES . "feedback.tpl");
    $chat = VisitorChat::GetByChatId(intval(Communication::ReadParameter("cid", 0)));
    $ticket = Ticket::GetById(intval(Communication::ReadParameter("tid", "")));
    if ($ticket != null) {
        $ticket->LoadMessages();
        $ticket->LoadStatus();
    }
    if (Feedback::IsFlood()) {
        $fb_html = str_replace("<!--title-->", "<br><br><br>" . str_replace("<!--count-->", MAX_FEEDBACKS_PER_DAY, LocalizationManager::$TranslationStrings["client_feedback_max"]) . "<script>parent.parent.lz_chat_feedback_result();</script>", $fb_html);
        $fb_html = str_replace("<!--visible-->", "none", $fb_html);
    } else {
        if (!empty($_POST)) {
            $userid = "";
            $feedback = new Feedback(getId(32));
            if ($chat != null) {
                $feedback->ChatId = $chat->ChatId;
                $feedback->UserId = $userid = $chat->UserId;
                $feedback->GroupId = $chat->DesiredChatGroup;
コード例 #4
0
    $html = str_replace("<!--function_chat-->", To::BoolString(empty($_GET["hfc"])), $html);
    $html = str_replace("<!--function_knowledgebase-->", To::BoolString(empty($_GET["hfk"]) && !empty(Server::$Configuration->File["gl_knba"])), $html);
    $html = str_replace("<!--hide_group_select_chat-->", To::BoolString(Communication::GetParameter("hcgs", 0, $nu, FILTER_VALIDATE_INT) == "1" || !empty($_GET[GET_EXTERN_DYNAMIC_GROUP])), $html);
    $html = str_replace("<!--hide_group_select_ticket-->", To::BoolString(Communication::GetParameter("htgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html);
    $html = str_replace("<!--require_group_selection-->", To::BoolString(Communication::GetParameter("rgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html);
    $html = str_replace("<!--offline_message_pop-->", To::BoolString(!empty(Server::$Configuration->File["gl_om_pop_up"]) || empty(Server::$Configuration->File["gl_om_mode"])), $html);
    $html = str_replace("<!--dynamic_group-->", !empty(VisitorChat::$DynamicGroup) ? base64_encode(Server::$Groups[VisitorChat::$DynamicGroup]->Descriptions["EN"]) : "", $html);
} else {
    if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_lgin") {
        $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
        $html = isset(Server::$Configuration->File["gl_site_name"]) ? str_replace("<!--config_name-->", Server::$Configuration->File["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-->", Communication::GetScheme() == SCHEME_HTTP_SECURE && !empty(Server::$Configuration->File["gl_sssl"]) ? "" : "display:none;", $html);
        $html = str_replace("<!--bgc-->", $color = Communication::ReadParameter("epc", "#73be28"), $html);
        $html = str_replace("<!--color-->", Colors::TransformHEX($color, 30), $html);
    } else {
        if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_chat") {
            $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
            $html = str_replace("<!--alert-->", getAlertTemplate(), $html);
            $tlanguages = "";
            if (strlen(Server::$Configuration->File["gl_otrs"]) > 1) {
                $mylang = LocalizationManager::GetBrowserLocalization();
                $tlanguages = getLanguageSelects(LocalizationManager::GetBrowserLocalization());
            }
            $html = str_replace("<!--languages-->", $tlanguages, $html);
            Server::InitDataBlock(array("GROUPS"));
            $groupid = $_POST["intgroup"];
            if (!empty($groupid) && isset(Server::$Groups[$groupid])) {
                $html = str_replace("<!--SM_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[0]) ? "none" : "", $html);
コード例 #5
0
         VisitorMonitoring::$Browser->ForceUpdate();
     } else {
         if (count(VisitorMonitoring::$Browser->History) == 0) {
             VisitorMonitoring::Abort(11);
         }
     }
     VisitorMonitoring::$Browser->LoadWebsitePush();
     VisitorMonitoring::$Visitor->LoadChatRequests();
     VisitorMonitoring::$Browser->LoadAlerts();
     VisitorMonitoring::$Response .= VisitorMonitoring::TriggerEvents();
 }
 if (!empty($_GET["fbpos"]) && !empty($_GET["fbw"])) {
     $shadow = !empty($_GET["fbshx"]) ? "true," . Communication::ReadParameter("fbshb", 0) . "," . Communication::ReadParameter("fbshx", 0) . "," . Communication::ReadParameter("fbshy", 0) . ",'" . Communication::ReadParameter("fbshc", "#000000") . "'" : "false,0,0,0,''";
     $margin = !empty($_GET["fbmt"]) ? "," . Communication::ReadParameter("fbml", 0) . "," . Communication::ReadParameter("fbmt", 0) . "," . Communication::ReadParameter("fbmr", 0) . "," . Communication::ReadParameter("fbmb", 0) : ",0,0,0,0";
     if (!(!$conline && !empty($_GET["fboo"]))) {
         VisitorMonitoring::$Response .= "lz_tracking_add_floating_button(" . Communication::ReadParameter("fbpos", "10") . "," . $shadow . $margin . "," . Communication::ReadParameter("fbw", 0) . "," . Communication::ReadParameter("fbh", 0) . ");";
     }
 }
 VisitorMonitoring::LoadOverlayChat();
 VisitorMonitoring::$Browser->LoadOverlayBoxes();
 VisitorMonitoring::$Response .= processActions("", Visitor::$OpenChatExternal);
 if (!empty($_GET["cboo"]) && !operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"], false)) {
     VisitorMonitoring::$Response .= "lz_tracking_remove_buttons();";
 }
 if (empty($_GET["ovlc"]) && !empty(Server::$Configuration->File["gl_hide_inactive"]) && !VisitorMonitoring::$Visitor->IsActivity(VisitorMonitoring::$Browser)) {
     VisitorMonitoring::$Response .= "lz_tracking_stop_tracking(17);";
 } else {
     if (empty($_GET["ovlc"]) && !empty($_SERVER['HTTP_DNT']) && Server::$Configuration->File["gl_dnt"]) {
         VisitorMonitoring::$Browser->Destroy();
         VisitorMonitoring::$Response .= "lz_tracking_stop_tracking(10);";
     } else {
コード例 #6
0
 require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
 require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
 @set_error_handler("handleError");
 Server::InitDataProvider();
 Server::DefineURL("knowledgebase.php");
 LocalizationManager::AutoLoad();
 $color = ExternalChat::ReadTextColor();
 $entry = KnowledgeBaseEntry::GetById(Communication::ReadParameter("id", ""), true);
 if (!empty($entry)) {
     $html = IOStruct::GetFile(PATH_TEMPLATES . "kb_entry.tpl");
     if (!empty(Server::$Configuration->File["gl_kcss"])) {
         $html = str_replace("<!--custom_css-->", "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . Server::$Configuration->File["gl_kcss"] . "\">", $html);
     }
     if (Server::$Configuration->File["gl_knbr"]) {
         $rresult = $entry->GetRateResult();
         if (($rate = Communication::ReadParameter("h", -1)) != -1) {
             $html = str_replace("<!--rate_text-->", "<br><div id=\"lz_chat_dialog_kb_rate\">" . $LZLANG["client_feedback_success"] . "</div>", $html);
             $entry->SaveRateResult($rate);
         } else {
             $bhtml = "<a href=\"./knowledgebase.php?id=<!--id-->&h=MQ__\"><!--lang_client_yes--></a><a href=\"./knowledgebase.php?id=<!--id-->&h=MA__\"><!--lang_client_no--></a>";
             $fhtml = $rresult[0] > 0 ? str_replace("<!--users-->", $rresult[0], str_replace("<!--total-->", $rresult[1], $LZLANG["client_found_helpful"])) . " " : "";
             $html = str_replace("<!--rate_text-->", "<br><div id=\"lz_chat_dialog_kb_rate\">" . $fhtml . $LZLANG["client_was_helpful"] . $bhtml . "</div>", $html);
         }
     } else {
         $html = str_replace("<!--rate_text-->", "", $html);
     }
     if ($entry->Type == 1) {
         $html = str_replace("<!--html-->", $entry->Value, $html);
     } else {
         if ($entry->Type == 2) {
             $html = str_replace("<!--html-->", "<script>window.location.replace('" . $entry->Value . "');</script>", $html);
コード例 #7
0
 $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);
                     $res = str_replace("<!--id-->", $match->Id, $res);
                     $res = str_replace("<!--color-->", $color, $res);
                     $entries = "";
コード例 #8
0
 static function ApplyDynamicGroup($_chatObj = null)
 {
     if (!empty($_GET[GET_EXTERN_DYNAMIC_GROUP])) {
         if ($_chatObj != null && empty($_chatObj->Forward)) {
             $_chatObj->LoadForward();
         }
         if ($_chatObj != null && !empty($_chatObj->Forward)) {
             return;
         }
         $tgroup = Communication::ReadParameter(GET_EXTERN_DYNAMIC_GROUP, "");
         if (isset(Server::$Groups[$tgroup]) && Server::$Groups[$tgroup]->IsDynamic) {
             VisitorChat::$DynamicGroup = $tgroup;
         }
     }
 }
コード例 #9
0
 }
 if ($OVERLAY->PlaySound) {
     $USER->AddFunctionCall("lz_chat_play_sound('message');", false);
 }
 if (!empty($_GET["tid"])) {
     if ($ticket = $USER->SaveTicket(Communication::GetParameter("eg", "", $c), $USER->GeoCountryISO2, false, true, BaseURL::GetInputURL())) {
         $USER->Browsers[1]->ForceUpdate();
         $ticket->SendAutoresponder($USER, $USER->Browsers[0]);
     }
 }
 $OVERLAY->OverlayHTML = str_replace("<!--server-->", LIVEZILLA_URL, $OVERLAY->OverlayHTML);
 if ($OVERLAY->LanguageRequired) {
     $OVERLAY->OverlayHTML = Server::Replace($OVERLAY->OverlayHTML, $OVERLAY->LanguageRequired, false);
 }
 if (!empty($OVERLAY->OverlayHTML)) {
     $USER->AddFunctionCall("lz_chat_add_html_element('" . base64_encode($OVERLAY->OverlayHTML) . "',true," . $OVERLAY->LastPostReceived . "," . $OVERLAY->LastMessageReceived . ",'" . base64_encode($OVERLAY->LastPoster) . "','" . base64_encode(Communication::ReadParameter("lp", "")) . "'," . $OVERLAY->OperatorPostCount . ");", false);
 }
 $USER->AddFunctionCall("lz_chat_set_connecting(" . To::BoolString(!$OVERLAY->Botmode && (!empty($USER->Browsers[0]->ChatId) && !$USER->Browsers[0]->InternalActivation && !$USER->Browsers[0]->Closed && !$USER->Browsers[0]->Declined)) . ",'" . $USER->Browsers[0]->SystemId . "'," . To::BoolString(!empty($USER->Browsers[0]->OperatorId) && Server::$Operators[$USER->Browsers[0]->OperatorId]->Status == USER_STATUS_AWAY) . "," . $OVERLAY->GetWaitingMessage() . "," . intval(Server::$Configuration->File["gl_wmes"]) . ");", false);
 if ($OVERLAY->RepollRequired) {
     $USER->AddFunctionCall("lz_tracking_poll_server(1211);", false);
 }
 if ($USER->Browsers[0]->TranslationSettings != null) {
     $USER->AddFunctionCall("lz_chat_set_translation(" . $USER->Browsers[0]->TranslationSettings[0] . ",'" . base64_encode($USER->Browsers[0]->TranslationSettings[1]) . "','" . base64_encode($USER->Browsers[0]->TranslationSettings[2]) . "');", false);
 } else {
     $USER->AddFunctionCall("lz_chat_set_translation(null,null,null);", false);
 }
 if ($OVERLAY->FullLoad) {
     $USER->AddFunctionCall("lz_chat_load_input_values();", false);
 }
 $USER->ReloadGroups(true, Visitor::$PollCount == 1);
 if (!empty($USER->Browsers[0]->DesiredChatGroup)) {