本文整理汇总了PHP中base64UrlEncode函数的典型用法代码示例。如果您正苦于以下问题:PHP base64UrlEncode函数的具体用法?PHP base64UrlEncode怎么用?PHP base64UrlEncode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了base64UrlEncode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signRequest
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;
}
示例2: getInvitationTemplate
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);
}
示例3: testSignInvoice
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);
}
示例4: header
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;
}
示例5: Base64UrlEncode
function Base64UrlEncode($_value)
{
return base64UrlEncode($_value);
}
示例6: Visitor
$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);
示例7: getFile
}
$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"]) ? "&ofc=MQ__" : "";
if (!empty($_POST["form_extends"]) && !empty($_POST["form_group"])) {
$html = str_replace("<!--co-->", "&co=" . base64UrlEncode($_POST["form_extends"]) . "&intgroup=" . base64UrlEncode($_POST["form_group"]) . $ofc, $html);
} else {
if (!empty($_POST["form_group"])) {
$html = str_replace("<!--co-->", "&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]));
示例8: GetOperatorPictureFile
function GetOperatorPictureFile()
{
global $CONFIG;
$url = "picture.php?intid=" . base64UrlEncode($this->UserId);
if (empty($CONFIG["gl_root"])) {
$url .= "&ws=" . base64UrlEncode($CONFIG["gl_host"]);
}
return $url;
}
示例9: file_get_contents
<?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;
}
示例10: GetOperatorPictureFile
function GetOperatorPictureFile()
{
return "picture.php?intid=" . base64UrlEncode($this->UserId) . "&acid=" . getId(3);
}
示例11: sendPushMessages
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);
}
}
}
}
}
示例12: defined
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
示例13: CreateInvitationTemplate
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;
}
示例14: GetVoucherChatURL
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;
}
示例15: _actionProcess
/**
* 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;
}