コード例 #1
0
function getFolderPermissions()
{
    $message = "";
    $directories = array(PATH_UPLOADS, PATH_LOG, PATH_STATS, PATH_STATS . "day/", PATH_STATS . "month/", PATH_STATS . "year/");
    foreach ($directories as $dir) {
        $result = IOStruct::IsWriteable($dir);
        if (!$result) {
            $message .= "Insufficient write access" . " (" . $dir . ")<br>";
        }
    }
    if (!empty($message)) {
        $message = "<span class=\"lz_index_error_cat\">Write Access:<br></span> <span class=\"lz_index_red\">" . $message . "</span><a href=\"" . CONFIG_LIVEZILLA_FAQ . "en/?fid=changepermissions#changepermissions\" class=\"lz_index_helplink\" target=\"_blank\">Learn how to fix this problem</a>";
    }
    return $message;
}
コード例 #2
0
function getLanguageJS($_isoLanguageCode)
{
    global $LZLANG;
    $languageData = array();
    $LZLANGEN = $LZLANG;
    if (empty($_isoLanguageCode) || strlen($_isoLanguageCode) > 5) {
        $_isoLanguageCode = Server::$Configuration->File["gl_default_language"];
    }
    $languageFiles[] = array(LocalizationManager::GetLocalizationFileString($_isoLanguageCode, true, true, false) => false);
    $languageFiles[] = array(LocalizationManager::GetLocalizationFileString($_isoLanguageCode, true, true, true) => true);
    if (strlen($_isoLanguageCode) > 2) {
        $shortLanguageCode = substr($_isoLanguageCode, 0, 2);
        $languageFiles[] = array(LocalizationManager::GetLocalizationFileString($shortLanguageCode, true, true, false) => false);
        $languageFiles[] = array(LocalizationManager::GetLocalizationFileString($shortLanguageCode, true, true, true) => true);
    }
    foreach ($languageFiles as $fileParams) {
        foreach ($fileParams as $file => $isOrg) {
            $folder = LIVEZILLA_PATH . (!$isOrg ? "_language/" : "mobile/php/translation/");
            if (IOStruct::RequireDynamic($file, $folder)) {
                break 2;
            }
        }
    }
    $translationKeys = array_keys($LZLANGEN);
    for ($i = 0; $i < count($translationKeys); $i++) {
        $translation = array("key" => $translationKeys[$i], "orig" => str_replace("'", "\\'", $LZLANGEN[$translationKeys[$i]]));
        if (isset($LZLANG[$translationKeys[$i]]) && $LZLANG[$translationKeys[$i]] !== "") {
            $translation[$_isoLanguageCode] = str_replace("'", "\\'", $LZLANG[$translationKeys[$i]]);
        } else {
            $translation[$_isoLanguageCode] = str_replace("'", "\\'", $LZLANGEN[$translationKeys[$i]]);
        }
        array_push($languageData, $translation);
    }
    $jsLanguageData = "[";
    for ($i = 0; $i < count($languageData) - 1; $i++) {
        $jsLanguageData .= "{'key': '" . $languageData[$i]["key"] . "', 'orig': '" . $languageData[$i]["orig"] . "', '" . $_isoLanguageCode . "': '" . $languageData[$i][$_isoLanguageCode] . "'}, ";
    }
    $i = count($languageData) - 1;
    $jsLanguageData .= "{'key': '" . $languageData[$i]["key"] . "', 'orig': '" . $languageData[$i]["orig"] . "', '" . $_isoLanguageCode . "': '" . $languageData[$i][$_isoLanguageCode] . "'}";
    $jsLanguageData .= "]";
    return $jsLanguageData;
}
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);
}
コード例 #4
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);
コード例 #5
0
 function SaveVisitorListToFile()
 {
     Server::SetTimeLimit(300);
     if ($this->CreateVisitorList) {
         IOStruct::CreateFile($this->GetFilename(true, true), $this->GetUsersHTML(), true, false, true);
     }
 }
コード例 #6
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 {
コード例 #7
0
function AbortFileUpload($_chat, $_filename, $_error = FILE_ACTION_ERROR, $response = "")
{
    $fileid = md5(IOStruct::GetNamebase($_filename) . $_chat->UserId . $_chat->BrowserId);
    $request = new FileUploadRequest(EX_FILE_UPLOAD_REQUEST . "_" . $fileid, $_chat->DesiredChatPartner, $_chat->ChatId);
    $request->Load();
    if (!$request->Closed) {
        $request->Error = $_error;
        $request->Save();
    } else {
        $response .= "lz_chat_file_reset();";
    }
    return $response;
}
コード例 #8
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);
コード例 #9
0
 static function LoadFromFile($_isoTwoletterCode)
 {
     global $LZLANG;
     IOStruct::RequireDynamic(LocalizationManager::GetLocalizationFileString($_isoTwoletterCode), LIVEZILLA_PATH . "_language/");
     LocalizationManager::$TranslationStrings = $LZLANG;
 }
コード例 #10
0
 static function GetTranslationData($translation = "")
 {
     global $LZLANG;
     if (OperatorRequest::IsValidated() && Is::Defined("VALIDATED_FULL_LOGIN") && OperatorRequest::IsAdministrator(true)) {
         Logging::SecurityLog("ServerManager::GetTranslationData", serialize($_POST), CALLER_SYSTEM_ID);
         $langid = $_POST["p_int_trans_iso"];
         if (strpos($langid, "..") === false && strlen($langid) <= 6) {
             $mobile = !empty($_POST["p_int_trans_m"]);
             $mobileOriginal = !empty($_POST["p_int_trans_mo"]);
             $path = !$mobileOriginal ? "_language/" : "mobile/php/translation/";
             IOStruct::RequireDynamic(LocalizationManager::GetLocalizationFileString($langid, true, $mobile, $mobileOriginal), LIVEZILLA_PATH . $path);
             $translation .= "<language key=\"" . base64_encode($langid) . "\">\r\n";
             foreach ($LZLANG as $key => $value) {
                 $translation .= "<val key=\"" . base64_encode($key) . "\">" . base64_encode($value) . "</val>\r\n";
             }
             $translation .= "</language>\r\n";
             Server::$Response->SetStandardResponse(1, $translation);
         } else {
             Server::$Response->SetStandardResponse(0, $translation);
         }
     }
 }
コード例 #11
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);
コード例 #12
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;
}
コード例 #13
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);
コード例 #14
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"]))) {
コード例 #15
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);
コード例 #16
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);
コード例 #17
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) {
コード例 #18
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);
    }
}
コード例 #19
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"));
コード例 #20
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;
         }
     }
 }
コード例 #21
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;
コード例 #22
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);
コード例 #23
0
 static function GetPermissions()
 {
     $directories = array(PATH_UPLOADS, PATH_CONFIG);
     foreach ($directories as $dir) {
         $result = IOStruct::IsWriteable($dir);
         if (!$result) {
             return 0;
         }
     }
     return 1;
 }