Exemple #1
0
function signRequest($params)
{
    $params["timestamp"] = time();
    $params["appId"] = APP_ID;
    $payload = base64UrlEncode(json_encode($params));
    $rawSignature = hash_hmac("sha256", $payload, APP_SECRET, $raw = true);
    return base64UrlEncode($rawSignature) . "." . $payload;
}
function getInvitationTemplate($_requestid, $_internid, $_sessid, $_name, $_groupid)
{
    global $CONFIG;
    $template = !@file_exists(FILE_INVITATIONLOGO) ? getFile(TEMPLATE_SCRIPT_INVITATION) : getFile(TEMPLATE_SCRIPT_INVITATION_LOGO);
    $template = str_replace("<!--request_id-->", $_requestid, $template);
    $template = str_replace("<!--site_name-->", $CONFIG["gl_site_name"], $template);
    $template = str_replace("<!--sess_id-->", $_sessid, $template);
    $template = str_replace("<!--intern_name-->", $_name, $template);
    $template = str_replace("<!--group_id-->", base64UrlEncode($_groupid), $template);
    $template = str_replace("<!--intern_id-->", base64UrlEncode($_internid), $template);
    $template = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $template);
    $template = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $template);
    $template = str_replace("<!--server-->", LIVEZILLA_URL, $template);
    $template = str_replace("<!--intern_image-->", file_exists(PATH_INTERN_IMAGES . md5($_internid) . FILE_EXTENSION_PROFILE_PICTURE) ? md5($_internid) . FILE_EXTENSION_PROFILE_PICTURE . "?acid=" . uniqid(rand()) : "nopic" . FILE_EXTENSION_PROFILE_PICTURE, $template);
    return doReplacements($template);
}
 public function testSignInvoice()
 {
     require_once '_helpers.php';
     $config = (include '_config.php');
     if (!$this->checkConfig($config)) {
         $this->markTestSkipped('Config is empty');
         return;
     }
     $fiscal_verification = new \Neonbug\FiscalVerification\FiscalVerification($config['client_key_filename'], $config['client_key_password'], $config['ca_public_key_filename'], $config['base_url']);
     $header = $this->getTestHeader($fiscal_verification);
     $invoice = $this->getTestInvoice($fiscal_verification, $config['tax_number'], 'premise1');
     $token = $fiscal_verification->signRequest($header, $invoice, false);
     $token_arr = explode('.', $token);
     $this->assertCount(3, $token_arr);
     $signature = $token_arr[2];
     $signature_decoded = base64UrlDecode($signature);
     $sign_data = base64UrlEncode($header) . '.' . base64UrlEncode($invoice);
     $ret = openssl_verify($sign_data, $signature_decoded, openssl_pkey_get_public(file_get_contents($config['client_key_filename'])), 'SHA256');
     $this->assertEquals($ret, 1);
 }
Exemple #4
0
    if (isset($INTERNAL[$id])) {
        $sysid = $_GET["intid"];
        if (!empty($INTERNAL[$id]->Profile)) {
            header("Content-Type: application/vcard;");
            header("Content-Disposition: attachment; filename=" . utf8_decode($sysid) . ".vcf");
            $vcard = getFile("./templates/vcard.tpl");
            $vcard = str_replace("<!--Name-->", qp_encode($INTERNAL[$id]->Profile->Name), $vcard);
            $vcard = str_replace("<!--Firstname-->", qp_encode($INTERNAL[$id]->Profile->Firstname), $vcard);
            $vcard = str_replace("<!--Company-->", qp_encode($INTERNAL[$id]->Profile->Company), $vcard);
            $vcard = str_replace("<!--Comments-->", qp_encode($INTERNAL[$id]->Profile->Comments), $vcard);
            $vcard = str_replace("<!--Phone-->", qp_encode($INTERNAL[$id]->Profile->Phone), $vcard);
            $vcard = str_replace("<!--Fax-->", qp_encode($INTERNAL[$id]->Profile->Fax), $vcard);
            $vcard = str_replace("<!--Street-->", qp_encode($INTERNAL[$id]->Profile->Street), $vcard);
            $vcard = str_replace("<!--City-->", qp_encode($INTERNAL[$id]->Profile->City), $vcard);
            $vcard = str_replace("<!--ZIP-->", qp_encode($INTERNAL[$id]->Profile->ZIP), $vcard);
            $vcard = str_replace("<!--Country-->", qp_encode($INTERNAL[$id]->Profile->Country), $vcard);
            $vcard = str_replace("<!--URL-->", qp_encode("http://" . $CONFIG["gl_host"] . str_replace("visitcard.php", FILE_CHAT . "?intid=" . base64UrlEncode($_GET["intid"]), htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES, "UTF-8"))), $vcard);
            $vcard = str_replace("<!--Languages-->", qp_encode($INTERNAL[$id]->Profile->Languages), $vcard);
            $vcard = str_replace("<!--Email-->", $INTERNAL[$id]->Profile->Email, $vcard);
            $vcard = str_replace("<!--Gender-->", qp_encode($INTERNAL[$id]->Profile->Gender), $vcard);
            $vcard = str_replace("<!--Picture-->", !empty($INTERNAL[$id]->ProfilePicture) ? "\r\nPHOTO;TYPE=JPEG;ENCODING=BASE64:\r\n" . $INTERNAL[$id]->ProfilePicture : "", $vcard);
            exit($vcard);
        }
    }
}
function qp_encode($string)
{
    $string = str_replace(array('%20', '%0D%0A', '%'), array(' ', "\r\n", '='), rawurlencode(utf8_decode($string)));
    $string = preg_replace('/[^\\r\\n]{73}[^=\\r\\n]{2}/', "\$0=\r\n", $string);
    return $string;
}
Exemple #5
0
 function Base64UrlEncode($_value)
 {
     return base64UrlEncode($_value);
 }
Exemple #6
0
$EXTERNALUSER = new Visitor(CALLER_USER_ID);
$EXTERNALUSER->Load();
if (isset($_GET[GET_TRACK_OUTPUT_TYPE]) && ($_GET[GET_TRACK_OUTPUT_TYPE] == "jscript" || $_GET[GET_TRACK_OUTPUT_TYPE] == "jcrpt")) {
    $fullname = getParam(GET_EXTERN_USER_NAME);
    $email = getParam(GET_EXTERN_USER_EMAIL);
    $company = getParam(GET_EXTERN_USER_COMPANY);
    $customs = array();
    if (empty($_GET[GET_TRACK_NO_SEARCH_ENGINE])) {
        exit(getFile(TEMPLATE_HTML_SUPPORT));
    }
    $row = $EXTERNALUSER->CreateSignature();
    if (is_array($row) && $row["id"] != CALLER_USER_ID) {
        $EXTERNALUSER->UserId = $row["id"];
        $fullname = empty($fullname) ? base64UrlEncode($row["fullname"]) : "";
        $email = empty($email) ? base64UrlEncode($row["email"]) : "";
        $company = empty($company) ? base64UrlEncode($row["company"]) : "";
        $customs = @unserialize($row["customs"]);
    }
    $TRACKINGSCRIPT = getFile(TEMPLATE_SCRIPT_GLOBAL) . getFile(TEMPLATE_SCRIPT_TRACK);
    $TRACKINGSCRIPT .= str_replace("<!--file_chat-->", FILE_CHAT, getFile(TEMPLATE_SCRIPT_BOX));
    $TRACKINGSCRIPT = str_replace("<!--server_id-->", substr(md5($CONFIG["gl_lzid"]), 5, 5), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--server-->", LIVEZILLA_URL, $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--area_code-->", isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? htmlentities($_GET[GET_TRACK_SPECIAL_AREA_CODE], ENT_QUOTES, "UTF-8") : "", $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--browser_id-->", htmlentities(CALLER_BROWSER_ID, ENT_QUOTES, "UTF-8"), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_id-->", htmlentities($EXTERNALUSER->UserId, ENT_QUOTES, "UTF-8"), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--poll_frequency-->", getPollFrequency(), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = geoReplacements($TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--geo_resolute-->", parseBool(!isSSpanFile() && $EXTERNALUSER->FirstCall && !empty($CONFIG["gl_pr_ngl"]) && !(!isnull(getCookieValue("geo_data")) && getCookieValue("geo_data") > time() - 2592000)), $TRACKINGSCRIPT);
    }
    $html = getFile(PATH_TEMPLATES . "payment/paypal.tpl");
    $html = str_replace("<!--account-->", $CONFIG["db"]["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-->", 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=" . base64UrlEncode($_POST["form_extends"]) . "&amp;intgroup=" . base64UrlEncode($_POST["form_group"]) . $ofc, $html);
    } else {
        if (!empty($_POST["form_group"])) {
            $html = str_replace("<!--co-->", "&amp;intgroup=" . base64UrlEncode($_POST["form_group"]) . $ofc, $html);
        } else {
            $html = str_replace("<!--co-->", $ofc, $html);
        }
    }
    exit($html);
} else {
    if (!empty($_GET["confirm"]) && $_GET["confirm"] == "1" && !empty($_GET["vc"]) && strlen(base64UrlDecode($_GET["vc"])) == 16) {
        require LIVEZILLA_PATH . "_lib/functions.pp.paypal.inc.php";
        $voucher = new CommercialChatVoucher("", base64UrlDecode($_GET["vc"]));
        if ($voucher->Load()) {
            if (PayProvValidatePayment($voucher->Price)) {
                languageSelect($voucher->Language);
                $voucher->SetPaymentDetails(PayProvGetPaymentId(), PayProvGetPayerId(), PayProvGetPaymentDetails());
                if (empty($PAYMENTERROR)) {
                    $voucher->SetVoucherParams(!empty($voucher->Voided), true, false, false, false, true, base64UrlDecode($_GET[GET_EXTERN_GROUP]));
 function GetOperatorPictureFile()
 {
     global $CONFIG;
     $url = "picture.php?intid=" . base64UrlEncode($this->UserId);
     if (empty($CONFIG["gl_root"])) {
         $url .= "&ws=" . base64UrlEncode($CONFIG["gl_host"]);
     }
     return $url;
 }
Exemple #9
0
<?php

namespace Trianglman\Sqrl\Ed25519;

require_once __DIR__ . '/../src/Trianglman/Sqrl/Ed25519/CryptoInterface.php';
require_once __DIR__ . '/../src/Trianglman/Sqrl/Ed25519/Crypto.php';
$sk = $argv[1];
$messageSrc = $argv[2];
if (!file_exists($messageSrc)) {
    $m = $messageSrc;
} else {
    $m = file_get_contents($messageSrc);
}
$obj = new Crypto();
$pk = $obj->publickey($sk);
$sig = $obj->signature($m, $sk, $pk);
echo 'Message: "' . $m . "\"\n";
echo 'Public Key(base64url): ' . base64UrlEncode($pk) . "\n";
echo 'Signature(base64Url) : ' . base64UrlEncode($sig) . "\n";
echo 'Verifies? ' . ($obj->checkvalid($sig, $m, $pk) ? 'yes' : 'no') . "\n";
function base64UrlEncode($string)
{
    $base64 = base64_encode($string);
    $urlencode = str_replace(array('+', '/'), array('-', '_'), $base64);
    $urlencode = trim($urlencode, '=');
    return $urlencode;
}
 function GetOperatorPictureFile()
 {
     return "picture.php?intid=" . base64UrlEncode($this->UserId) . "&acid=" . getId(3);
 }
function sendPushMessages()
{
    global $CONFIG;
    if (!empty($CONFIG["gl_mpm"]) && DB_CONNECTION && defined("IS_PUSH_MESSAGE")) {
        $count = 0;
        $result = queryDB(false, "SELECT * FROM `" . DB_PREFIX . DATABASE_PUSH_MESSAGES . "` WHERE `sent`=0 ORDER BY `created` ASC LIMIT 10;");
        if ($result) {
            $data = array();
            while ($row = @DBManager::FetchArray($result)) {
                $data = array_merge($data, array('p_app_os_' . $count => $row["device_os"], 'p_device_id_' . $count => $row["device_id"], 'p_message_type_' . $count => $row["push_key"], 'p_message_' . $count => base64UrlEncode($row["push_value"]), 'p_chatpartner_id_' . $count => $row["chat_partner_id"], 'p_chat_id_' . $count++ => $row["chat_id"]));
            }
            queryDB(false, "UPDATE `" . DB_PREFIX . DATABASE_PUSH_MESSAGES . "` SET `sent`=1 ORDER BY `created` ASC LIMIT 10;");
            if (!empty($data)) {
                $opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($data)));
                $context = stream_context_create($opts);
                $result = file_get_contents(CONFIG_LIVEZILLA_PUSH, false, $context);
                if ($result !== "1") {
                    handleError("116", " Push Message Error: " . $result, CONFIG_LIVEZILLA_PUSH, 0);
                }
            }
        }
    }
}
Exemple #12
0
defined('KOOWA') or die;
?>

<?php 
$viewer = get_viewer();
$components = $this->getService('com://site/people.template.helper')->viewerMenuLinks($viewer);
?>

<ul class="nav">
<?php 
if ($viewer->guest()) {
    ?>
	<li>
		<?php 
    $return = base64UrlEncode(KRequest::url());
    ?>
		<a href="<?php 
    echo @route('option=com_people&view=session&return=' . $return);
    ?>
">
		<?php 
    echo @text('LIB-AN-ACTION-LOGIN');
    ?>
		</a>
	</li>
<?php 
} else {
    ?>
	<li>
		<a href="<?php 
 function CreateInvitationTemplate($_style, $_siteName, $_cwWidth, $_cwHeight, $_serverURL, $_sender, $_closeOnClick)
 {
     $template = @file_exists(FILE_INVITATIONLOGO) && @file_exists(TEMPLATE_SCRIPT_INVITATION . $_style . "/invitation_header.tpl") ? getFile(TEMPLATE_SCRIPT_INVITATION . $_style . "/invitation_header.tpl") : getFile(TEMPLATE_SCRIPT_INVITATION . $_style . "/invitation.tpl");
     $template = str_replace("<!--site_name-->", $_siteName, $template);
     $template = str_replace("<!--intern_name-->", $_sender->Fullname, $template);
     $template = str_replace("<!--template-->", $_style, $template);
     $template = str_replace("<!--group_id-->", base64UrlEncode($this->SenderGroupId), $template);
     $template = str_replace("<!--user_id-->", base64UrlEncode($_sender->UserId), $template);
     $template = str_replace("<!--width-->", $_cwWidth, $template);
     $template = str_replace("<!--height-->", $_cwHeight, $template);
     $template = str_replace("<!--server-->", $_serverURL, $template);
     $template = str_replace("<!--intern_image-->", $_sender->GetOperatorPictureFile(), $template);
     $template = str_replace("<!--close_on_click-->", $_closeOnClick, $template);
     return $template;
 }
 function GetVoucherChatURL($_purchasedForGroup = "")
 {
     global $CONFIG;
     if (!empty($_purchasedForGroup)) {
         $_purchasedForGroup = "&intgroup=" . base64UrlEncode($_purchasedForGroup);
     }
     $ws = empty($CONFIG["gl_root"]) ? "&ws=" . base64UrlEncode($CONFIG["gl_host"]) : "";
     return LIVEZILLA_URL . FILE_CHAT . "?vc=" . base64UrlEncode($this->Id) . $_purchasedForGroup . $ws;
 }
Exemple #15
0
 /**
  * Process Action.
  *
  * @param KCommandContext $context
  *
  * @return boolean
  */
 protected function _actionProcess($context)
 {
     try {
         $identifier = 'com://site/subscriptions.controller.subscription';
         $subscription = $this->getService($identifier)->setOrder($this->order->cloneEntity())->add();
     } catch (ComSubscriptionsDomainPaymentException $exception) {
         $this->setMessage('COM-SUBSCRIPTIONS-TRANSACTION-ERROR', 'error');
         throw new RuntimeException('Payment process error');
         return false;
     }
     if ($subscription) {
         //clreat the sesion
         $_SESSION['signup'] = null;
         KRequest::set('session.subscriber_id', $subscription->person->id);
         $url = JRoute::_('option=com_subscriptions&view=signup&layout=processed&id=' . $this->getItem()->id);
         if (get_viewer()->guest()) {
             $return = base64UrlEncode($url);
             $user = $subscription->person->getUserObject();
             $token = $user->activation;
             $url = JRoute::_('option=com_people&view=session&token=' . $token . '&return=' . $return);
         }
         $context->response->setRedirect($url);
     } else {
         throw new RuntimeException("Couldn't subscribe");
         return false;
     }
     return true;
 }
         $chat_available = $OPERATOR_COUNT > 0;
     }
 }
 $LANGUAGE = false;
 if (!$chat_available) {
     $USER->AddFunctionCall("lz_chat_set_connecting(false,'" . $USER->Browsers[0]->SystemId . "');lz_chat_set_host(null,'" . $USER->Browsers[0]->ChatId . "','','',null);", false);
 }
 $pc = 0;
 if (!empty($USER->Browsers[0]->QueuedPosts)) {
     if (!$USER->Browsers[0]->Waiting) {
         while (!empty($_GET["mi" . $pc])) {
             $pc++;
         }
         foreach ($USER->Browsers[0]->QueuedPosts as $id => $postar) {
             $_GET["mp" . $pc] = $postar[0];
             $_GET["mi" . $pc] = base64UrlEncode($id);
             $_GET["mrid" . $pc] = $id;
             $_GET["mc" . $pc++] = $postar[1];
             queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_POSTS . "` WHERE `id`='" . DBManager::RealEscape($id) . "' LIMIT 1;");
         }
         $pc = 0;
         $USER->Browsers[0]->QueuedPosts = array();
     }
 }
 if (!empty($_GET["mi" . $pc]) || $USER->Browsers[0]->Waiting || !empty($USER->Browsers[0]->InitChatWith) || !empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
     if ($USER->Browsers[0]->Waiting && $BOTMODE && !empty($USER->Browsers[0]->QueuedPosts)) {
         $USER->Browsers[0]->QueuedPosts = array();
     } else {
         if (!$openChatExternal) {
             initChat();
         }
if (!file_exists('file://' . $suppliedOpts['s'])) {
    $serverData = $suppliedOpts['s'];
} else {
    $serverData = file_get_contents($suppliedOpts['s']);
}
$command = $suppliedOpts['c'];
$idk = $suppliedOpts['i'];
if (isset($suppliedOpts['p'])) {
    $pidk = $suppliedOpts['p'];
}
if (isset($suppliedOpts['u'])) {
    $suk = $suppliedOpts['u'];
}
if (isset($suppliedOpts['v'])) {
    $vuk = $suppliedOpts['v'];
}
if (isset($suppliedOpts['a'])) {
    $ask = $suppliedOpts['a'];
}
$outfile = $argv[$argc - 1];
$fp = fopen($outfile, 'w');
$data = "server=" . base64UrlEncode($serverData) . '&';
$data .= 'client=' . base64UrlEncode("ver={$version}\r\n" . "idk={$idk}\r\n" . "cmd={$command}" . (isset($pidk) ? "\r\npidk={$pidk}" : '') . (isset($suk) ? "\r\nsuk={$suk}" : '') . (isset($vuk) ? "\r\nvuk={$vuk}" : '') . (isset($ask) ? "\r\nval={$ask}" : ''));
fwrite($fp, $data);
fclose($fp);
function base64UrlEncode($string)
{
    $base64 = base64_encode($string);
    $urlencode = str_replace(array('+', '/'), array('-', '_'), $base64);
    return trim($urlencode, '=');
}
function getJSCustomArray($_getCustomParams = "", $_fromHistory = null)
{
    global $INPUTS;
    initData(array("INPUTS"));
    $valArray = array();
    foreach ($INPUTS as $index => $input) {
        if ($input->Active && $input->Custom) {
            if (isset($_GET["cf" . $input->Index])) {
                $valArray[$index] = "'" . getParam("cf" . $input->Index) . "'";
            } else {
                if (!isnull(getCookieValue("cf_" . $input->Index)) && $input->Cookie) {
                    $valArray[$index] = "'" . base64UrlEncode(getCookieValue("cf_" . $input->Index)) . "'";
                } else {
                    if (is_array($_fromHistory) && isset($_fromHistory[$input->Index]) && !empty($_fromHistory[$input->Index])) {
                        $valArray[$index] = "'" . base64UrlEncode($_fromHistory[$input->Index]) . "'";
                    } else {
                        $valArray[$index] = "''";
                    }
                }
            }
        } else {
            if ($input->Custom) {
                $valArray[$index] = "''";
            }
        }
    }
    ksort($valArray);
    foreach ($valArray as $param) {
        if (!empty($_getCustomParams)) {
            $_getCustomParams .= ",";
        }
        $_getCustomParams .= $param;
    }
    return $_getCustomParams;
}
function getJSCustomArray($_getCustomParams = "", $_fromHistory = null)
{
    for ($i = 0; $i <= 9; $i++) {
        if (!empty($_getCustomParams)) {
            $_getCustomParams .= ",";
        }
        if (isset($_GET["cf" . $i]) && !empty($_GET["cf" . $i])) {
            $_getCustomParams .= "'" . htmlentities($_GET["cf" . $i], ENT_QUOTES, "UTF-8") . "'";
        } else {
            if (!isnull(getCookieValue("cf_" . $i))) {
                $_getCustomParams .= "'" . base64UrlEncode(getCookieValue("cf_" . $i)) . "'";
            } else {
                if (is_array($_fromHistory) && isset($_fromHistory[$i]) && !empty($_fromHistory[$i])) {
                    $_getCustomParams .= "'" . base64UrlEncode($_fromHistory[$i]) . "'";
                } else {
                    $_getCustomParams .= "''";
                }
            }
        }
    }
    return $_getCustomParams;
}
function processPlaceholders($html)
{
    $params = array(GET_EXTERN_USER_LANGUAGE, GET_EXTERN_USER_NAME, GET_EXTERN_USER_EMAIL, GET_EXTERN_USER_COMPANY, GET_TRACK_SPECIAL_AREA_CODE, GET_EXTERN_USER_QUESTION, GET_EXTERN_USER_HEADER);
    $placeholders = array("language", "name", "email", "company", "code", "question", "header_url");
    foreach ($params as $key => $value) {
        if (!empty($_GET[$value])) {
            $html = str_replace("&lt;!--replace_me_with_b64url_" . $placeholders[$key] . "--&gt;", base64UrlEncode(base64UrlDecode($_GET[$value])), $html);
        } else {
            $html = str_replace("&lt;!--replace_me_with_b64url_" . $placeholders[$key] . "--&gt;", "", $html);
        }
    }
    for ($i = 0; $i < 10; $i++) {
        if (!empty($_GET["cf" . $i])) {
            $html = str_replace("&lt;!--replace_me_with_b64url_custom_" . $i . "--&gt;", base64UrlEncode(base64UrlDecode($_GET["cf" . $i])), $html);
        } else {
            $html = str_replace("&lt;!--replace_me_with_b64url_custom_" . $i . "--&gt;", "", $html);
        }
    }
    return $html;
}
                                                }
                                                require LIVEZILLA_PATH . "_lib/trdp/mobde.php";
                                                $MobileDetect = new Mobile_Detect();
                                                $small = $MobileDetect->isMobile() && !$MobileDetect->isTablet();
                                                $html = str_replace("<!--translation_display-->", !$small && strlen($CONFIG["gl_otrs"]) > 1 ? "" : "none", $html);
                                                $html = str_replace("<!--transcript_option_display-->", !$small && !empty($CONFIG["gl_uret"]) ? "" : "none", $html);
                                                $html = str_replace("<!--languages-->", $tlanguages, $html);
                                            } else {
                                                if (in_array($_GET[GET_EXTERN_TEMPLATE], $static_frames) && strpos($_GET[GET_EXTERN_TEMPLATE], "..") === false) {
                                                    $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
$html = str_replace("<!--website-->", empty($CONFIG["gl_root"]) ? "&ws=" . base64UrlEncode($CONFIG["gl_host"]) : "", $html);
$html = str_replace("<!--server-->", LIVEZILLA_URL, $html);
$html = str_replace("<!--html-->", "<html dir=\"" . $LANG_DIR . "\">", $html);
$html = str_replace("<!--right-->", $LANG_DIR == "rtl" ? "left" : "right", $html);
$html = str_replace("<!--left-->", $LANG_DIR == "rtl" ? "right" : "left", $html);
$html = str_replace("<!--url_get_params-->", getParams(), $html);
unloadDataProvider();
exit(applyReplacements($html));
Exemple #22
0
            $TRACKINGSCRIPT = str_replace("<!--ec_header_text-->", base64UrlEncode(getOParam("echt", "Have questions?", $c, FILTER_HTML_ENTITIES)), $TRACKINGSCRIPT);
            $TRACKINGSCRIPT = str_replace("<!--ec_header_sub_text-->", base64UrlEncode(getOParam("echst", "Chat with us live", $c, FILTER_HTML_ENTITIES)), $TRACKINGSCRIPT);
            $TRACKINGSCRIPT = str_replace("<!--ec_o_header_text-->", base64UrlEncode(getOParam("ecoht", "Have questions?", $c, FILTER_HTML_ENTITIES)), $TRACKINGSCRIPT);
            $TRACKINGSCRIPT = str_replace("<!--ec_o_header_sub_text-->", base64UrlEncode(getOParam("ecohst", "Please leave a message", $c, FILTER_HTML_ENTITIES)), $TRACKINGSCRIPT);
        } else {
            if ($eca == 2) {
                $TRACKINGSCRIPT = str_replace("<!--ec_image-->", base64UrlEncode(getOParam("eci", "", $nu, FILTER_SANITIZE_URL)), $TRACKINGSCRIPT);
                $TRACKINGSCRIPT = str_replace("<!--ec_o_image-->", base64UrlEncode(getOParam("ecio", "", $nu, FILTER_SANITIZE_URL)), $TRACKINGSCRIPT);
            }
        }
        $ov = VisitorChat::FromCache($EXTERNALUSER->UserId, $EXTERNALUSER->UserId . "_OVL");
        if (!empty($ov->Fullname)) {
            $fullname = base64UrlEncode($ov->Fullname);
        }
        if (!empty($ov->Email)) {
            $email = base64UrlEncode($ov->Email);
        }
        $TRACKINGSCRIPT = applyReplacements($TRACKINGSCRIPT, true, false);
    }
    $TRACKINGSCRIPT = str_replace("<!--user_name-->", $fullname, $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_email-->", $email, $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--get_track_params-->", getParams("", array("ws" => true, "ecsgs" => 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, "ovlml" => true, "ovlmr" => true, "ovlmt" => true, "ovlmb" => true, "ovls" => true, "ovloo" => true, "ovlc" => true, "ovlapo" => true, "ovlct" => true, GET_EXTERN_GROUP => true, "intid" => true, "pref" => true, "cboo" => true, "hg" => true, "fbpos" => false, "fbw" => false, "fbh" => false, "fbshx" => false, "fbshy" => false, "fbshb" => false, "fbshc" => false, "fbmt" => false, "fbmr" => false, "fbmb" => false, "fbml" => false, "fboo" => false, "eca" => true, "ecw" => true, "ech" => true, "ecmb" => true, "ecml" => true, "cf0" => true, "cf1" => true, "cf2" => true, "cf3" => true, "cf4" => true, "cf5" => true, "cf6" => true, "cf7" => true, "cf8" => true, "cf9" => true)), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--server-->", LIVEZILLA_URL, $TRACKINGSCRIPT);
} else {
    $TRACKINGSCRIPT = "lz_tracking_set_sessid(\"" . base64_encode(CALLER_USER_ID) . "\",\"" . base64_encode(CALLER_BROWSER_ID) . "\");";
    if (BaseURL::IsInputURL() && strpos(BaseURL::GetInputURL(), GET_INTERN_COBROWSE) !== false) {
        abortTracking(1);
    }
    $BROWSER = VisitorBrowser::FromCache(CALLER_USER_ID, CALLER_BROWSER_ID);
function reloadGroups($_user, $_overlay = false, $_preSelect = true, $_declined = false)
{
    global $CONFIG, $INTERNAL, $GROUPS;
    initData(array("INTERNAL", "FILTERS"));
    $grParam = UserGroup::ReadParams();
    $opParam = Operator::ReadParams();
    if (!empty($grParam) && empty($_user->Browsers[0]->DesiredChatGroup)) {
        $_user->Browsers[0]->DesiredChatGroup = $grParam;
    }
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $_user->Browsers[0]->DesiredChatGroup, $_user->Browsers[0]->DesiredChatPartner);
    $groupbuilder->Generate($_user);
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupsAvailable = parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2);
    $_preSelect = $_preSelect ? base64UrlEncode($_user->Browsers[0]->DesiredChatGroup) : "";
    $_user->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ",'" . $_preSelect . "');", false);
    if (!$_overlay) {
        $_user->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false);
    }
    return $_user;
}