Пример #1
0
function ajax_signinpartner()
{
    global $config;
    $client = new Fuze_Client($config['fuze.url'], $_POST['partner_key'], $_POST['encryption_key']);
    if (!$client->checkKeys()) {
        return array('error' => 'Keys are invalid');
    }
    // Store the keys in the session
    $_SESSION['has_partner'] = true;
    $_SESSION['partner_key'] = $_POST['partner_key'];
    $_SESSION['encryption_key'] = $_POST['encryption_key'];
    return array('success' => True, 'message' => 'Key pair appears valid', 'pk' => $_POST['partner_key']);
}
Пример #2
0
    bail('Missing options: ' . implode(', ', $missing));
}
$filePathName = @realpath($opts['f']);
if (!is_readable($filePathName)) {
    bail("File {$filePathName} missing or not readable");
}
try {
    if (isset($opts['url']) && $opts['url']) {
        $url = $opts['url'];
    } else {
        $url = API_ENDPOINT_URL;
    }
    echo "Instantiating client ({$url})... \n";
    $fuze = new Fuze_Client($url, $opts['pkey'], $opts['ekey']);
    echo "Checking keys ... ";
    $keysOk = $fuze->checkKeys();
    echo ($keysOk ? 'passed.' : 'failed!') . "\n";
    if (!$keysOk) {
        exit(1);
    }
    echo "Signing in with user account ... \n";
    $result = $fuze->signin(array('email' => $opts['email'], 'password' => $opts['password']));
    // The client should be signed in here, $fuze->isSignedIn() must be true
    if (!$fuze->isSignedIn()) {
        echo "Signing in failed! See signin result below:\n";
        var_dump($result);
        exit(1);
    }
    $fname = isset($opts['file-name']) && $opts['file-name'] ? $opts['file-name'] : null;
    $meeting_id = isset($opts['meeting-id']) && $opts['meeting-id'] ? $opts['meeting-id'] : null;
    $res = $fuze->uploadMedia($filePathName, $fname, $meeting_id);