コード例 #1
0
 function GetHTML()
 {
     $html = IOStruct::GetFile(PATH_TEMPLATES . "feedback_type_" . $this->Type . ".tpl");
     $html = str_replace("<!--cid-->", $this->Id, $html);
     $html = str_replace("<!--title-->", $this->Title, $html);
     return $html;
 }
コード例 #2
0
 * All rights reserved.
 * 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";
Server::DefineURL("print.php");
@set_error_handler("handleError");
if (Server::InitDataProvider()) {
    if (!empty($_GET[GET_TRACK_CHATID]) && !empty($_GET[GET_TRACK_BROWSERID]) && !empty($_GET[GET_TRACK_USERID])) {
        $archive = new Chat();
        $archive->ChatId = intval(Communication::GetParameter("c", ""));
        $archive->Load();
        $chat = VisitorChat::GetByChatId($archive->ChatId);
        if ($chat->BrowserId == Communication::GetParameter(GET_TRACK_BROWSERID, "") && $chat->UserId == Communication::GetParameter(GET_TRACK_USERID, "") && $chat->LastActive > time() - 3600) {
            $print = IOStruct::GetFile(PATH_TEMPLATES . "print.tpl");
            $archive->Generate($archive->ChatId, "", true, true);
            $print = str_replace("<!--chat_id-->", $archive->ChatId, $print);
            $print = str_replace("<!--transcript-->", nl2br($archive->PlainText), $print);
        }
        exit($print);
    }
}
コード例 #3
0
if (!defined("LIVEZILLA_PATH")) {
    define("LIVEZILLA_PATH", "./");
}
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
if (isset($_GET["intid"]) && Server::InitDataProvider()) {
    Server::InitDataBlock(array("INTERNAL"));
    $id = Operator::GetSystemId($_GET["intid"]);
    if (isset(Server::$Operators[$id])) {
        $sysid = $_GET["intid"];
        if (!empty(Server::$Operators[$id]->Profile)) {
            header("Content-Type: application/vcard;");
            header("Content-Disposition: attachment; filename=" . utf8_decode($sysid) . ".vcf");
            $vcard = IOStruct::GetFile("./templates/vcard.tpl");
            $vcard = str_replace("<!--Name-->", qp_encode(Server::$Operators[$id]->Profile->Name), $vcard);
            $vcard = str_replace("<!--Firstname-->", qp_encode(Server::$Operators[$id]->Profile->Firstname), $vcard);
            $vcard = str_replace("<!--Company-->", qp_encode(Server::$Operators[$id]->Profile->Company), $vcard);
            $vcard = str_replace("<!--Comments-->", qp_encode(Server::$Operators[$id]->Profile->Comments), $vcard);
            $vcard = str_replace("<!--Phone-->", qp_encode(Server::$Operators[$id]->Profile->Phone), $vcard);
            $vcard = str_replace("<!--Fax-->", qp_encode(Server::$Operators[$id]->Profile->Fax), $vcard);
            $vcard = str_replace("<!--Street-->", qp_encode(Server::$Operators[$id]->Profile->Street), $vcard);
            $vcard = str_replace("<!--City-->", qp_encode(Server::$Operators[$id]->Profile->City), $vcard);
            $vcard = str_replace("<!--ZIP-->", qp_encode(Server::$Operators[$id]->Profile->ZIP), $vcard);
            $vcard = str_replace("<!--Country-->", qp_encode(Server::$Operators[$id]->Profile->Country), $vcard);
            $vcard = str_replace("<!--URL-->", qp_encode("http://" . Server::$Configuration->File["gl_host"] . str_replace("visitcard.php", FILE_CHAT . "?intid=" . Encoding::Base64UrlEncode($_GET["intid"]), htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES, "UTF-8"))), $vcard);
            $vcard = str_replace("<!--Languages-->", qp_encode(Server::$Operators[$id]->Profile->Languages), $vcard);
            $vcard = str_replace("<!--Email-->", Server::$Operators[$id]->Profile->Email, $vcard);
            $vcard = str_replace("<!--Gender-->", qp_encode(Server::$Operators[$id]->Profile->Gender), $vcard);
            $vcard = str_replace("<!--Picture-->", !empty(Server::$Operators[$id]->ProfilePicture) ? "\r\nPHOTO;TYPE=JPEG;ENCODING=BASE64:\r\n" . Server::$Operators[$id]->ProfilePicture : "", $vcard);
function buildReports($xml = "")
{
    if (empty($_POST[POST_INTERN_XMLCLIP_REPORTS_END_TIME])) {
        return;
    }
    if (empty(Server::$Statistic->CurrentDay) || Server::$Operators[CALLER_SYSTEM_ID]->GetPermission(PERMISSION_REPORTS) == PERMISSION_NONE) {
        return;
    }
    if ($_POST[POST_INTERN_XMLCLIP_REPORTS_END_TIME] == XML_CLIP_NULL) {
        $_POST[POST_INTERN_XMLCLIP_REPORTS_END_TIME] = "0_0";
    }
    $parts = explode("_", $_POST[POST_INTERN_XMLCLIP_REPORTS_END_TIME]);
    if ($result = DBManager::Execute(true, "SELECT *,(SELECT MAX(`time`) FROM `" . DB_PREFIX . DATABASE_STATS_AGGS . "`) AS `maxtime`,(SELECT MAX(`mtime`) FROM `" . DB_PREFIX . DATABASE_STATS_AGGS . "` WHERE `maxtime`=`time`) AS `maxmtime` FROM `" . DB_PREFIX . DATABASE_STATS_AGGS . "` WHERE (`time` = " . DBManager::RealEscape($parts[0]) . " AND `mtime` > " . DBManager::RealEscape($parts[1]) . ") OR (`time` > " . DBManager::RealEscape($parts[0]) . ") ORDER BY `time` ASC,`mtime` ASC LIMIT 1")) {
        while ($row = DBManager::FetchArray($result)) {
            if ($row["month"] == 0) {
                $report = new StatisticYear($row["year"], 0, 0, $row["aggregated"], $row["mtime"]);
            } else {
                if ($row["day"] == 0) {
                    $report = new StatisticMonth($row["year"], $row["month"], 0, $row["aggregated"], $row["mtime"]);
                } else {
                    $report = new StatisticDay($row["year"], $row["month"], $row["day"], $row["aggregated"], $row["mtime"]);
                }
            }
            $type = -1;
            $update = false;
            $value = "";
            if ($report->Type == STATISTIC_PERIOD_TYPE_DAY) {
                if ($_POST[POST_INTERN_PROCESS_UPDATE_REPORT_TYPE] == 1) {
                    if (Server::$Statistic->CurrentDay->CreateVisitorList) {
                        if (empty($row["aggregated"]) && (!@file_exists($report->GetFilename(true, true)) || $row["time"] < time() - StatisticProvider::$AutoUpdateTime)) {
                            $report->SaveVisitorListToFile();
                        }
                        if (@file_exists($report->GetFilename(true, true))) {
                            $value = IOStruct::GetFile($report->GetFilename(true, true));
                        }
                    }
                    $type = 1;
                } else {
                    if ($_POST[POST_INTERN_PROCESS_UPDATE_REPORT_TYPE] == 0) {
                        if (Server::$Statistic->CurrentDay->CreateReport) {
                            if (empty($row["aggregated"]) && (!@file_exists($report->GetFilename(true, false)) || $row["time"] < time() - StatisticProvider::$AutoUpdateTime)) {
                                $update = true;
                                $report->SaveReportToFile();
                            } else {
                                if (@file_exists($report->GetFilename(true, false))) {
                                    $value = IOStruct::GetFile($report->GetFilename(true, false));
                                }
                            }
                        }
                        $type = 0;
                    }
                }
            } else {
                if (empty($row["aggregated"]) && (!@file_exists($report->GetFilename(true, false)) || $row["time"] < time() - StatisticProvider::$AutoUpdateTime)) {
                    $report->SaveReportToFile();
                }
                if (@file_exists($report->GetFilename(true, false))) {
                    $value = IOStruct::GetFile($report->GetFilename(true, false));
                }
                $type = $report->Type == STATISTIC_PERIOD_TYPE_MONTH ? 2 : 3;
            }
            if ($type > -1) {
                $convrate = $row["sessions"] > 0 ? round(100 * $row["conversions"] / $row["sessions"], StatisticProvider::$RoundPrecision) : 0;
                $chats = $chatsd = 0;
                $qmonth = $report->Type == STATISTIC_PERIOD_TYPE_YEAR ? "" : " AND `month`='" . DBManager::RealEscape($row["month"]) . "'";
                $qday = $report->Type != STATISTIC_PERIOD_TYPE_DAY ? "" : " AND `day`='" . DBManager::RealEscape($row["day"]) . "'";
                if ($results = DBManager::Execute(true, "SELECT (SUM(`amount`)-SUM(`multi`)) AS `samount` FROM `" . DB_PREFIX . DATABASE_STATS_AGGS_CHATS . "` WHERE `year`='" . DBManager::RealEscape($row["year"]) . "'" . $qmonth . $qday . "")) {
                    if (DBManager::GetRowCount($results) == 1) {
                        $rows = DBManager::FetchArray($results);
                        if (is_numeric($rows["samount"])) {
                            $chats = $rows["samount"];
                        }
                    }
                }
                LocalizationManager::AutoLoad("", true);
                $value = Server::Replace($value, true, false, false, true);
                $xml .= "<r cid=\"" . base64_encode(getId(3)) . "\" ragg=\"" . base64_encode(empty($row["aggregated"]) ? 0 : 1) . "\" rtype=\"" . base64_encode($type) . "\" convrate=\"" . base64_encode($convrate) . "\" chats=\"" . base64_encode($chats) . "\" update=\"" . base64_encode($update ? 1 : 0) . "\" visitors=\"" . base64_encode($row["sessions"]) . "\" time=\"" . base64_encode($row["time"]) . "\" mtime=\"" . base64_encode($row["mtime"]) . "\" year=\"" . base64_encode($row["year"]) . "\" month=\"" . base64_encode($row["month"]) . "\" day=\"" . base64_encode($row["day"]) . "\">" . base64_encode($value) . "</r>\r\n";
            }
            $xml .= "<ri maxtime=\"" . base64_encode($row["maxtime"]) . "\" maxmtime=\"" . base64_encode($row["maxmtime"]) . "\" />";
        }
    }
    Server::$Response->SetStandardResponse(1, $xml);
}
コード例 #5
0
            $response = utf8_encode("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><livezilla_js>" . base64_encode(isset($EXTERNSCRIPT) ? $EXTERNSCRIPT : "") . "</livezilla_js>");
        } else {
            if (isset($_POST[POST_INTERN_REQUEST]) && $_POST[POST_INTERN_REQUEST] == CALLER_TYPE_INTERNAL) {
                define("CALLER_TYPE", CALLER_TYPE_INTERNAL);
                define("CALLER_TIMEOUT", Server::$Configuration->File["timeout_clients"]);
                header("Connection: close");
                header("Cache-Control: no-cache, must-revalidate");
                header("Content-Type: text/xml; charset=UTF-8");
                require LIVEZILLA_PATH . "intern.php";
                $response = utf8_encode($response);
            } else {
                if ($getRequest == "cronjob" && !empty($_GET["cjid"]) && $_GET["cjid"] == Server::$Configuration->File["gl_cjid"]) {
                    define("CALLER_TYPE", "cronjob");
                    define("CALLER_TIMEOUT", 360);
                    Server::InitDataBlock(array("INTERNAL", "GROUPS"));
                    $response = DB_CONNECTION ? "Success" : "No database connection";
                }
            }
        }
    }
    //if(DB_CONNECTION && Is::Defined("CALLER_TYPE") && (!empty(Server::$Configuration->File["gl_cjfs"])||CALLER_TYPE=="cronjob") && !Is::Defined("SERVERSETUP") && !Is::Defined("LOGIN"))
    if (DB_CONNECTION && Is::Defined("CALLER_TYPE") && !Is::Defined("SERVERSETUP") && !Is::Defined("LOGIN")) {
        Server::RunCronJobs(false);
    }
}
if (!isset($response)) {
    exit(IOStruct::GetFile(TEMPLATE_HTML_SUPPORT));
}
Communication::SendPushMessages();
Server::UnloadDataProvider();
exit($response);
コード例 #6
0
 function RenderTopTable($_id, $_title, $_column, $_trend = true, $crow = "")
 {
     $hrow = IOStruct::GetFile(TEMPLATE_HTML_STATS_TOP_ROW);
     if ($_id == 6) {
         Server::InitDataBlock(array("LANGUAGES"));
     } else {
         if ($_id == 2) {
             Server::InitDataBlock(array("COUNTRIES"));
         }
     }
     foreach ($this->Tops[$_id] as $count => $values) {
         if ($_id == 6 && isset(Server::$Languages[strtoupper($values[0])][0])) {
             $crow .= str_replace("<!--title-->", Server::$Languages[strtoupper($values[0])][0], $hrow);
         } else {
             if ($_id == 2 && isset(Server::$Countries[strtoupper($values[0])])) {
                 $crow .= str_replace("<!--title-->", Server::$Countries[strtoupper($values[0])], $hrow);
             } else {
                 if ($_id == 13 && isset(StatisticProvider::$Durations[$values[0]])) {
                     $crow .= str_replace("<!--title-->", StatisticProvider::$Durations[$values[0]], $hrow);
                 } else {
                     $crow .= str_replace("<!--title-->", $values[0], $hrow);
                 }
             }
         }
         $crow = str_replace("<!--rel_amount-->", $values[1], $crow);
         $crow = str_replace("<!--rel_floor_amount-->", $values[2], $crow);
         $crow = str_replace("<!--abs_amount-->", number_format($values[3], 0, ".", "."), $crow);
         $crow = str_replace("<!--trend-->", "const", $crow);
         $crow = str_replace("<!--count-->", $count, $crow);
     }
     $html = str_replace("<!--rows-->", $crow, IOStruct::GetFile(TEMPLATE_HTML_STATS_TOP_TABLE));
     $html = str_replace("<!--column_count_width-->", "16", $html);
     $html = str_replace("<!--expand_all-->", "none", $html);
     $html = str_replace("<!--expand_all_block-->", "", $html);
     //if($_trend)
     //	$html = str_replace("<!--trend-->","<!--lang_stats_trend-->",$html);
     $html = str_replace("<!--column_value_title-->", $_column, $html);
     return str_replace("<!--title-->", $_title, $html);
 }
コード例 #7
0
                VisitorMonitoring::$Response = str_replace("<!--ec_o_image-->", Encoding::Base64UrlEncode(Communication::ReadParameter("ecio", "")), VisitorMonitoring::$Response);
            }
        }
        VisitorMonitoring::$Response = Server::Replace(VisitorMonitoring::$Response, true, false);
    }
    VisitorMonitoring::$Response = str_replace("<!--user_name-->", Encoding::Base64UrlEncode(VisitorMonitoring::$Browser->UserData->Fullname), VisitorMonitoring::$Response);
    VisitorMonitoring::$Response = str_replace("<!--user_email-->", Encoding::Base64UrlEncode(VisitorMonitoring::$Browser->UserData->Email), VisitorMonitoring::$Response);
    VisitorMonitoring::$Response = str_replace("<!--height-->", Server::$Configuration->File["wcl_window_height"], VisitorMonitoring::$Response);
    VisitorMonitoring::$Response = str_replace("<!--width-->", Server::$Configuration->File["wcl_window_width"], VisitorMonitoring::$Response);
    VisitorMonitoring::$Response = str_replace("<!--get_track_params-->", getParams("", array("deactr" => true, "prv" => true, "ecsgs" => true, "hcgs" => true, "htgs" => true, "ecsge" => true, "ecsc" => true, "ecsy" => true, "ecsx" => true, "ecsb" => true, "ecsa" => true, "ecslw" => true, "echc" => true, "ecfs" => true, "ecfe" => true, "echt" => true, "echst" => true, "ecoht" => true, "ecohst" => true, "ovlto" => true, "ovlt" => true, "ovlp" => true, "ovloe" => true, "ovlml" => true, "ovlmr" => true, "ovlhm" => true, "ovlmt" => true, "ovlmb" => true, "ovls" => true, "ovloo" => true, "ovlc" => true, "ovlch" => true, "ovlts" => true, "ovlapo" => true, "ovlct" => true, "ovlntwo" => true, "ovlw" => true, "ovlh" => true, GET_EXTERN_GROUP => true, "intid" => true, "pref" => true, "cboo" => true, "hg" => true, "fbpos" => false, "fbw" => false, "fbh" => false, "fbshx" => true, "fbshy" => true, "fbshb" => true, "fbshc" => true, "fbmt" => false, "fbmr" => false, "fbmb" => false, "fbml" => false, "fboo" => false, "eca" => true, "ecw" => true, "ech" => true, "echm" => true, "ecmb" => true, "ecfi" => true, "ecfo" => true, "ecml" => true, "cf0" => true, "cf1" => true, "cf2" => true, "cf3" => true, "cf4" => true, "cf5" => true, "cf6" => true, "cf7" => true, "cf8" => true, "cf9" => true)), VisitorMonitoring::$Response);
    VisitorMonitoring::$Response = str_replace("<!--server-->", LIVEZILLA_URL, VisitorMonitoring::$Response);
} else {
    Visitor::$PollCount = Communication::ReadParameter("pc", 0);
    VisitorMonitoring::$Response = "lz_tracking_set_sessid(\"" . base64_encode(CALLER_USER_ID) . "\",\"" . base64_encode(CALLER_BROWSER_ID) . "\");";
    if (BaseURL::IsInputURL() && strpos(BaseURL::GetInputURL(), "lzmobile") !== false && Visitor::$PollCount == 1) {
        exit("eval(lz_global_base64_decode('" . base64_encode(IOStruct::GetFile(PATH_TEMPLATES . "jscript/jstrack.mob.tpl")) . "'));lz_tracking_stop_tracking(75);");
    }
    if (BaseURL::IsInputURL() && strpos(BaseURL::GetInputURL(), GET_INTERN_COBROWSE) !== false) {
        VisitorMonitoring::Abort(1);
    }
    VisitorMonitoring::$Browser = new VisitorBrowser(CALLER_BROWSER_ID, CALLER_USER_ID);
    VisitorMonitoring::$Visitor->AddBrowser(VisitorMonitoring::$Browser);
    if (VisitorMonitoring::$Visitor->FirstCall && !VisitorMonitoring::$Browser->GetFirstCall()) {
        VisitorMonitoring::$Visitor->FirstCall = false;
    }
    Server::InitDataBlock(array("FILTERS", "EVENTS"));
    define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), CALLER_USER_ID, VisitorMonitoring::$Visitor->GeoCountryISO2));
    define("IS_FLOOD", VisitorMonitoring::$Browser->GetFirstCall() && Filter::IsFlood(Communication::GetIP(), CALLER_USER_ID));
    Server::InitDataBlock(array("INTERNAL"));
    $deactp = Communication::ReadParameter("deactr", 0);
    if (IS_FILTERED && !FILTER_ALLOW_TRACKING || IS_FLOOD || !empty($deactp) || Cookie::Get(OO_TRACKING_FILTER_NAME) != null) {
コード例 #8
0
                    exit("lz_chat_file_ready();");
                } else {
                    exit("lz_chat_file_error(2);");
                }
            } else {
                if (Communication::GetIP() == $visitor->IP) {
                    if (!empty($_POST["p_fu_a"])) {
                        exit(AbortFileUpload($chat, $_POST[POST_EXTERN_USER_FILE_UPLOAD_NAME]));
                    }
                    if (!empty($_POST["p_iu"])) {
                        exit(RequestFileUpload($visitor, $chat, $_POST[POST_EXTERN_USER_FILE_UPLOAD_NAME]));
                    } else {
                        $html = IOStruct::GetFile(PATH_TEMPLATES . "upload.tpl");
                        $html = str_replace("<!--upload-->", IOStruct::GetFile(PATH_TEMPLATES . "file_upload.tpl"), $html);
                        $html = str_replace("<!--action-->", "lz_chat_file_init_upload();", $html);
                        $html = str_replace("<!--connector_script-->", IOStruct::GetFile(TEMPLATE_SCRIPT_CONNECTOR), $html);
                        $html = str_replace("<!--cid-->", Encoding::Base64UrlEncode($chat->ChatId), $html);
                        $html = str_replace("<!--mwidth-->", "max-width:90%;", $html);
                        $html = str_replace("<!--chat_id-->", Encoding::Base64UrlEncode($chat->ChatId), $html);
                        exit(Server::Replace($html));
                    }
                }
            }
        }
    }
}
function StoreFile($_visitor, $_browserId, $_partner, $_fullname, $_chatId)
{
    $filename = IOStruct::GetNamebase($_FILES['form_userfile']['name']);
    Logging::GeneralLog($filename);
    if (!IOStruct::IsValidUploadFile($filename)) {
コード例 #9
0
             $main = str_replace("<!--categories-->", $catcount > 1 ? $navcats : "", $main);
             $main = str_replace("<!--content-->", $result, $main);
         }
         if (!empty($result) && !empty($main)) {
             $externalUser->AddFunctionCall("lz_chat_search_result('" . base64_encode(Server::Replace($main, true, false, false, false)) . "',0);", false);
         } else {
             $externalUser->AddFunctionCall("lz_chat_search_result('" . base64_encode("<div><br><br>" . LocalizationManager::$TranslationStrings["client_kb_no_entries"] . "</div>" . $result) . "',0);", false);
         }
     } else {
         if (strlen($query) >= 3) {
             $matches = KnowledgeBase::GetMatches($query, Visitor::$BrowserLanguage);
             if (count($matches) > 0) {
                 foreach ($matches as $match) {
                     $result .= $match->GetHTML($color);
                 }
                 $res = IOStruct::GetFile(PATH_TEMPLATES . "kb_result_category.tpl");
                 $res = str_replace("<!--title-->", "\"" . cutString($query, 50, true) . "\"", $res);
                 $res = str_replace("<!--entries-->", $result, $res);
                 $res = str_replace("<!--search-->", "true", $res);
                 $res = str_replace("<!--id-->", "sr", $res);
                 $externalUser->AddFunctionCall("lz_chat_search_result('" . base64_encode("<div><b>" . str_replace("<!--count-->", count($matches), LocalizationManager::$TranslationStrings["client_kb_results_found"]) . " </b><br><br>" . $res) . "'," . count($matches) . ");", false);
             } else {
                 $externalUser->AddFunctionCall("lz_chat_search_result('" . base64_encode("<div><br><br>" . LocalizationManager::$TranslationStrings["client_search_no_result"] . "</div>" . $result . "") . "',0);", false);
             }
         } else {
             $externalUser->AddFunctionCall("lz_chat_search_result('" . base64_encode("<div><br><br>" . LocalizationManager::$TranslationStrings["client_search_no_result"] . "</div>" . $result . "") . "',0);", false);
         }
     }
 } else {
     if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_LISTEN) {
         $externalUser = ExternalChat::Listen($externalUser);
コード例 #10
0
 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 . "_lib/functions.external.inc.php";
 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);
コード例 #11
0
function getAlertTemplate()
{
    $html = str_replace("<!--server-->", LIVEZILLA_URL, IOStruct::GetFile(TEMPLATE_SCRIPT_ALERT));
    $html = str_replace("<!--title-->", Server::$Configuration->File["gl_site_name"], $html);
    return $html;
}
コード例 #12
0
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_lib/functions.index.inc.php";
CacheManager::Flush();
LocalizationManager::AutoLoad();
@set_error_handler("handleError");
Server::InitDataProvider();
Server::DefineURL("index.php");
$scheme = Communication::GetScheme();
$html = IOStruct::GetFile(TEMPLATE_HTML_INDEX);
$errorbox = null;
$errors['write'] = getFolderPermissions();
$errors['php_version'] = getPhpVersion();
$errors['mysql'] = getMySQL();
$errors['disabled'] = getDisabledFunctions();
if (!empty($errors['write']) || !empty($errors['php_version']) || !empty($errors['mysql']) || !empty($errors['disabled'])) {
    $errorbox = IOStruct::GetFile(TEMPLATE_HTML_INDEX_ERRORS);
    $errorbox = str_replace("<!--write_access-->", $errors['write'], $errorbox);
    if (strlen($errors['write']) > 0 && !empty($errors['php_version'])) {
        $errors['php_version'] = "<br><br>" . $errors['php_version'];
    }
    if ((strlen($errors['write']) > 0 || !empty($errors['php_version'])) && !empty($errors['mysql'])) {
        $errors['mysql'] = "<br><br>" . $errors['mysql'];
    }
    if ((strlen($errors['write']) > 0 || !empty($errors['php_version']) || !empty($errors['mysql'])) && !empty($errors['disabled'])) {
        $errors['disabled'] = "<br><br>" . $errors['disabled'];
    }
    $errorbox = str_replace("<!--mysql-->", $errors['mysql'], $errorbox);
    $errorbox = str_replace("<!--php_version-->", $errors['php_version'], $errorbox);
    $errorbox = str_replace("<!--disabled-->", $errors['disabled'], $errorbox);
}
$html = str_replace("<!--index_errors-->", $errorbox, $html);
コード例 #13
0
             $OVERLAY->AddHTML($OVERLAY->GetLeaveChatHTML(true, Server::$Operators[$USER->Browsers[0]->Forward->SenderSystemId]->Fullname, "&nbsp;" . LocalizationManager::$TranslationStrings["client_forwarding"]), "sys", "");
         }
     }
     Visitor::$IsActiveOverlayChat = !$USER->Browsers[0]->Declined;
 } else {
     if ($OVERLAY->IsChatAvailable && (empty($USER->Browsers[0]->Forward) && !(!empty($USER->Browsers[1]->ChatRequest) && !$USER->Browsers[1]->ChatRequest->Closed) && empty($USER->Browsers[0]->OperatorId) && !$USER->Browsers[0]->Waiting || !empty($USER->Browsers[0]->OperatorId) && Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot && $OVERLAY->Flags["LMR"] == "ONM01" || $OVERLAY->FullLoad)) {
         if (($OVERLAY->Flags["LMR"] != "ONM01" || $OVERLAY->FullLoad) && (!$OVERLAY->Botmode || !empty($USER->Browsers[0]->OperatorId) && !Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot || !empty($USER->Browsers[1]->ChatRequest) && !$USER->Browsers[1]->ChatRequest->Closed)) {
             if (!$OVERLAY->Botmode && (!empty($USER->Browsers[0]->ChatId) && !$USER->Browsers[0]->InternalActivation && !$USER->Browsers[0]->Closed && !$USER->Browsers[0]->Declined && !$USER->Browsers[0]->Waiting)) {
                 $OVERLAY->AddHTML(str_replace("<!--message-->", LocalizationManager::$TranslationStrings["client_int_is_connected"], IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_STATUS)), "sys", "ONM01");
             } else {
                 if ($USER->Browsers[0]->Status == CHAT_STATUS_OPEN && !$USER->Browsers[0]->Waiting) {
                     $OVERLAY->AddHTML(str_replace("<!--message-->", LocalizationManager::$TranslationStrings["client_chat_available"], IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_STATUS)), "sys", "ONM01");
                 }
             }
             if (!empty($USER->Browsers[0]->ChatId) && !$USER->Browsers[0]->InternalActivation && !empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Invite && !empty($USER->Browsers[0]->Forward->TargetGroupId) && $USER->Browsers[0]->Forward->Processed) {
                 $OVERLAY->AddHTML(str_replace("<!--message-->", LocalizationManager::$TranslationStrings["client_forwarding"], IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_STATUS)), "sys", "ONM01");
             }
         } else {
             if ($OVERLAY->Botmode && (($OVERLAY->Flags["LMR"] != "OBM01" || $OVERLAY->FullLoad) && (empty($USER->Browsers[0]->OperatorId) && empty($OVERLAY->CurrentOperatorId) || !empty($USER->Browsers[0]->OperatorId) && Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot))) {
                 $USER->Browsers[0]->FindOperator(VisitorChat::$Router, $USER, true, true);
                 if (!empty(Server::$Operators[$USER->Browsers[0]->DesiredChatPartner]) && Server::$Operators[$USER->Browsers[0]->DesiredChatPartner]->IsBot) {
                     $text = $OVERLAY->Human ? @LocalizationManager::$TranslationStrings["client_now_speaking_to_va"] : @LocalizationManager::$TranslationStrings["client_now_speaking_to_va_offline"];
                     $USER->AddFunctionCall("lz_chat_input_bot_state(true,false);", false);
                     $OVERLAY->AddHTML($OVERLAY->GetPostHTML(str_replace("<!--operator_name-->", Server::$Operators[$USER->Browsers[0]->DesiredChatPartner]->Fullname, $text), "", true, true, Server::$Operators[$USER->Browsers[0]->DesiredChatPartner]->Fullname, time(), $USER->Browsers[0]->DesiredChatPartner, Server::$Operators[$USER->Browsers[0]->DesiredChatPartner]->IsBot), "sys", "OBM01");
                     $OVERLAY->SetHost($USER->Browsers[0]->DesiredChatPartner);
                 }
             }
         }
     }
 }
 if (!$OVERLAY->Botmode && empty($_GET["tth"]) && ($USER->Browsers[0]->Status > CHAT_STATUS_OPEN || isset($_GET["mi0"]))) {
コード例 #14
0
            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);
                $html = str_replace("<!--SO_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[1]) ? "none" : "", $html);
                $html = str_replace("<!--PR_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[2]) ? "none" : "", $html);
                $html = str_replace("<!--FV_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[4]) ? "none" : "", $html);
                $html = str_replace("<!--FU_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[5]) || !empty($_GET[GET_EXTERN_DYNAMIC_GROUP]) ? "none" : "", $html);
                $html = str_replace("<!--post_chat_js-->", base64_encode(Server::$Groups[$groupid]->PostJS), $html);
            }
            $html = str_replace("<!--TR_HIDDEN-->", strlen(Server::$Configuration->File["gl_otrs"]) > 1 ? "" : "none", $html);
            $html = str_replace("<!--ET_HIDDEN-->", !empty(Server::$Configuration->File["gl_retr"]) && !empty(Server::$Configuration->File["gl_soct"]) ? "" : "none", $html);
        }
    }
}
$header = IOStruct::GetFile(PATH_TEMPLATES . "header.tpl");
if (isset($_GET[GET_EXTERN_USER_HEADER]) && !empty($_GET[GET_EXTERN_USER_HEADER])) {
    $header = str_replace("<!--logo-->", "<img src=\"" . Encoding::Base64UrlDecode($_GET[GET_EXTERN_USER_HEADER]) . "\" border=\"0\"><br>", $header);
} else {
    if (!empty(Server::$Configuration->File["gl_cali"])) {
        $header = str_replace("<!--logo-->", "<img src=\"" . Server::$Configuration->File["gl_cali"] . "\" border=\"0\"><br>", $header);
    }
}
if (!empty(Server::$Configuration->File["gl_cahi"])) {
    $header = str_replace("<!--background-->", "<img src=\"" . Server::$Configuration->File["gl_cahi"] . "\" border=\"0\"><br>", $header);
}
$html = str_replace("<!--param-->", @Server::$Configuration->File["gl_cpar"], $html);
$html = str_replace("<!--header-->", $header, $html);
$html = str_replace("<!--server-->", LIVEZILLA_URL, $html);
$html = str_replace("<!--html-->", "<html dir=\"" . LocalizationManager::$Direction . "\">", $html);
$html = str_replace("<!--rtl-->", To::BoolString(LocalizationManager::$Direction == "rtl"), $html);
コード例 #15
0
* Copyright 2014 LiveZilla GmbH
* All rights reserved.
* LiveZilla is a registered trademark.
* 
* Improper changes to this file may cause critical errors.
***************************************************************************************/
define("IN_LIVEZILLA", true);
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";
header("Content-Type: image/jpg;");
@set_error_handler("handleError");
if (isset($_GET["intid"]) && Server::InitDataProvider()) {
    Server::InitDataBlock(array("INTERNAL"));
    $id = Operator::GetSystemId(Encoding::Base64UrlDecode($_GET["intid"]));
    if (isset(Server::$Operators[$id])) {
        if (!empty(Server::$Operators[$id]->WebcamPicture)) {
            exit(base64_decode(Server::$Operators[$id]->WebcamPicture));
        } else {
            if (!empty(Server::$Operators[$id]->ProfilePicture)) {
                exit(base64_decode(Server::$Operators[$id]->ProfilePicture));
            }
        }
    }
}
exit(IOStruct::GetFile("./images/avatar.png"));
コード例 #16
0
 function Listen()
 {
     global $USER;
     $isOp = false;
     if ($USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE) {
         $result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_CHAT_OPERATORS . "` WHERE `chat_id`='" . DBManager::RealEscape($USER->Browsers[0]->ChatId) . "' ORDER BY `status` DESC, `dtime` DESC;");
         while ($row = DBManager::FetchArray($result)) {
             if (isset(Server::$Operators[$row["user_id"]])) {
                 $ChatMember = new ChatMember($row["user_id"], $row["status"], !empty($row["declined"]), $row["jtime"], $row["ltime"]);
                 if ($ChatMember->Status == 1 && $ChatMember->Joined >= $USER->Browsers[0]->LastActive) {
                     $isOp = true;
                     $this->AddHTML(str_replace("<!--message-->", str_replace("<!--intern_name-->", Server::$Operators[$ChatMember->SystemId]->Fullname, LocalizationManager::$TranslationStrings["client_intern_arrives"]), IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_STATUS)), "sys", "LMMJ" . $ChatMember->SystemId);
                 } else {
                     if (($ChatMember->Status == 9 || $ChatMember->Status == 2) && $ChatMember->Left >= $USER->Browsers[0]->LastActive && $ChatMember->Joined > 0) {
                         $this->AddHTML($this->GetLeaveChatHTML(false, Server::$Operators[$ChatMember->SystemId]->Fullname), "sys", "LCM01" . $ChatMember->SystemId);
                     }
                 }
                 if ($ChatMember->Status == 0) {
                     $isOp = true;
                 }
             }
         }
     } else {
         $isOp = true;
     }
     if (Communication::ReadParameter("ovlif")) {
         $this->InitFeedback();
     }
     $USER->Browsers[0]->Typing = isset($_GET["typ"]);
     if (!$USER->Browsers[0]->Declined) {
         $USER->Browsers[0]->Save();
     }
     $USER->Browsers[0]->ValidateOperator();
     $this->CurrentOperatorId = Communication::GetParameter("op", "", $c, FILTER_SANITIZE_SPECIAL_CHARS, null, 32);
     if ($USER->Browsers[0]->Waiting && $this->Botmode || empty($USER->Browsers[0]->OperatorId) && !empty($this->CurrentOperatorId) && isset(Server::$Operators[$this->CurrentOperatorId]) && !Server::$Operators[$this->CurrentOperatorId]->IsBot || !empty($this->CurrentOperatorId) && empty($USER->Browsers[0]->ChatId) && !$this->Botmode || !$isOp || $USER->Browsers[0]->Closed) {
         if (!$USER->Browsers[0]->ExternalClosed) {
             $USER->Browsers[0]->ExternalClose();
             $USER->Browsers[0]->Save();
             $USER->Browsers[0]->Load();
         }
         $USER->Browsers[0]->Members = array();
         if (!empty($this->CurrentOperatorId) && !empty(Server::$Operators[$this->CurrentOperatorId]) && $isOp) {
             $this->AddHTML($this->GetLeaveChatHTML(true, Server::$Operators[$this->CurrentOperatorId]->Fullname), "sys", "LCM01" . $this->CurrentOperatorId);
             if (!empty(Server::$Configuration->File["gl_fboe"]) && Communication::ReadParameter("po", 0) == 0 && !Server::$Operators[$this->CurrentOperatorId]->IsBot) {
                 if (!empty(Server::$Groups[$USER->Browsers[0]->DesiredChatGroup]->ChatFunctions[3])) {
                     $this->InitFeedback(false);
                 }
             }
             $this->Flags["LMR"] = "null";
             $USER->Browsers[0]->OperatorId = null;
             $this->CurrentOperatorId = "";
             $this->RepollRequired = true;
         }
     }
 }
コード例 #17
0
 * 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 (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;
コード例 #18
0
<?php

/****************************************************************************************
* LiveZilla map.php
* 
* Copyright 2014 LiveZilla GmbH
* All rights reserved.
* LiveZilla is a registered trademark.
* 
* Improper changes to this file may cause critical errors.
***************************************************************************************/
define("IN_LIVEZILLA", true);
define("LIVEZILLA_PATH", "./");
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
$map = IOStruct::GetFile(TEMPLATE_HTML_MAP);
exit($map);
コード例 #19
0
         $ticket->Extends = "";
     }
 }
 if (!empty(Server::$Configuration->Database["cct"][$_POST["form_voucher_type"]])) {
     $ticket->Language = Visitor::$BrowserLanguage;
     $ticket->ChatSessionsMax = Server::$Configuration->Database["cct"][$_POST["form_voucher_type"]]->ChatSessionsMax;
     $ticket->ChatTimeMax = Server::$Configuration->Database["cct"][$_POST["form_voucher_type"]]->ChatTimeMax * 60;
     $ticket->Price = Server::$Configuration->Database["cct"][$_POST["form_voucher_type"]]->Price;
     if (!empty(Server::$Configuration->File["gl_ccsv"])) {
         $ticket->VAT = $ticket->GetVAT();
     }
     $ticket->CurrencyISOThreeLetter = Server::$Configuration->Database["cct"][$_POST["form_voucher_type"]]->CurrencyISOThreeLetter;
     $ticket->Save();
     $ticket->SendCreatedEmail();
 }
 $html = IOStruct::GetFile(PATH_TEMPLATES . "payment/paypal.tpl");
 $html = str_replace("<!--account-->", Server::$Configuration->Database["ccpp"]["PayPal"]->Account, $html);
 $html = str_replace("<!--price-->", $_POST["form_total_price"] - $_POST["form_vat"], $html);
 $html = str_replace("<!--tax-->", $_POST["form_vat"], $html);
 $html = str_replace("<!--currency-->", $_POST["form_currency"], $html);
 $html = str_replace("<!--user_id-->", $_POST["form_visitor_id"], $html);
 $html = str_replace("<!--order_id-->", $ticket->Id, $html);
 $html = str_replace("<!--voucher_id-->", Encoding::Base64UrlEncode($ticket->Id), $html);
 $html = str_replace("<!--server-->", LIVEZILLA_URL, $html);
 $ofc = !empty($_POST["form_ofc"]) ? "&amp;ofc=MQ__" : "";
 if (!empty($_POST["form_extends"]) && !empty($_POST["form_group"])) {
     $html = str_replace("<!--co-->", "&amp;co=" . Encoding::Base64UrlEncode($_POST["form_extends"]) . "&amp;intgroup=" . Encoding::Base64UrlEncode($_POST["form_group"]) . $ofc, $html);
 } else {
     if (!empty($_POST["form_group"])) {
         $html = str_replace("<!--co-->", "&amp;intgroup=" . Encoding::Base64UrlEncode($_POST["form_group"]) . $ofc, $html);
     } else {