コード例 #1
0
<?php

ini_set('max_execution_time', 3600);
$appName = $argv[1];
define('CURRENT_DIR', realpath(dirname(__FILE__)));
define('_SUB_DIR', CURRENT_DIR . '/dns/');
require_once './create-po-config.php';
$poAccountName = $appName . '-cvc';
$vpoClient = new bsVideoPublisherServicesSoapClient($vpoBaseUrl, null, $poKey, 'Admin');
$response = $vpoClient->createCustomer($poAccountName);
$adminKey = new bsVideoPublisherKeyHelper($poKey);
$result = bsVideoPublisherCryptoHelper::aesDecryptData($response['CreateCustomerResult']['Data'], $adminKey->getPrivateKey(), $adminKey->getIvSalt());
$xml = @simplexml_load_string($result);
if (!$xml) {
    pake_error("Error creating po account for " . $appName);
}
$poCustomerId = (string) $xml->CustomerGuid;
$poCustomerKey = (string) $xml->ApiKey;
//TODO Store this in order to user with deployment
$info = array('po_customer_id' => $poCustomerId, 'po_customer_key' => $poCustomerKey);
pake_echo($appName . ' : ' . serialize($info));
addPillarInformation($appName, "po_customer_id", $poCustomerId);
addPillarInformation($appName, "po_customer_key", $poCustomerKey);
echo "\nDONE\n";
コード例 #2
0
//TODO Store this in order to user with deployment
echo "\nDONE\n";
require_once '../utils.php';
require_once './pm/bsPlayerManagerApi.php';
require_once './create-po-config.php';
$poAccountName = $appName . '-cvc';
$email = $appName . '*****@*****.**';
$firstname = 'cvc';
$lastname = $appName;
$username = $poAccountName;
$plainPassword = md5(uniqid());
$playerManagerApi = new bsPlayerManagerApi($playerManagerUserUid, $playerManagerAccountUid, $playerManagerWebServiceVersion, $playerManagerWebServiceUrl);
//TODO Store this in order to user with deployment
$playerManagerApi->accountCreate($playerManagerSecretKey, $accountName, $packages);
if ($result['status'] !== bsPlayerManagerApi::STATUS_SUCCESS) {
    pake_error("Error creating PM Account");
    exit(1);
}
$accountUid = $result['data']['guid'];
//pad name (can not exist if error on creation)
$url_pad = "";
if (array_key_exists('url_pad', $result['data'])) {
    $url_pad = $result['data']['url_pad'];
}
$playerManagerApi->userCreate($playerManagerSecretKey, $email, $firstname, $lastname, $accounts, $username, $plainPassword);
if ($result['status'] !== bsPlayerManagerApi::STATUS_SUCCESS) {
    bsLogger::err('Player Manager: Failed to create user with email ' . $email . ' and username ' . $username);
    return null;
}
$userUid = $result['data']['guid'];
if (!$userUid) {