Example #1
0
function getFuzeClient($url)
{
    if (!$_SESSION['has_partner']) {
        throw new Fuze_Exception("Partner key pair unavailable");
    }
    $partnerKey = $_SESSION['partner_key'];
    $encryptionKey = $_SESSION['encryption_key'];
    $client = new Fuze_Client($url, $partnerKey, $encryptionKey);
    if ($_SESSION['has_user']) {
        $client->setUserSession($_SESSION['user_token']);
    }
    return $client;
}
Example #2
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']);
}
Example #3
0
}
if (count($missing)) {
    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;
Example #4
0
    if (!isset($opts[$k]) || !$opts[$k]) {
        $missing[] = $k;
    }
}
if (count($missing)) {
    bail('Missing options: ' . implode(', ', $missing));
}
try {
    if (isset($opts['url']) && $opts['url']) {
        $url = $opts['url'];
    } else {
        $url = API_ENDPOINT_URL;
    }
    echo "Using {$url}\n";
    echo "Instantiating client ... \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);
    }
    $invstr = 'Nino S <nsegreto@gmail.com, Tony S <*****@*****.**';
Example #5
0
    if (!isset($opts[$k]) || !$opts[$k]) {
        $missing[] = $k;
    }
}
if (count($missing)) {
    bail('Missing options: ' . implode(', ', $missing));
}
try {
    if (isset($opts['url']) && $opts['url']) {
        $url = $opts['url'];
    } else {
        $url = API_ENDPOINT_URL;
    }
    echo "Using {$url}\n";
    echo "Instantiating client ... \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);
    }
    echo "Delete a meeting ... \n";