Exemple #1
0
<?php

require_once "lib/Class.A2Billing.inc.php";
require_once "lib/Misc.inc.php";
require_once "lib/Provi/SpaXml_Provi.inc.php";
require_once "lib/Class.ElemBase.inc.php";
require_once "lib/Class.html.inc.php";
$fp = fopen('php://temp', 'r+');
if (!$fp) {
    if ($FG_DEBUG) {
        echo "Cannot open temp stream.\n";
    }
    return;
}
$dbg_elem = new DbgElem();
$gen = new SpaXmlProvi();
$gen->dbg_elem =& $dbg_elem;
if (!$gen->Init(array(mac => $_GET['m'], sec => $_GET['s'], firsttime => $_GET['firsttime']))) {
    Header("HTTP/1.0 401 Unauthorized");
    echo "Unauthorized!";
    die;
}
header('Content-type: ' . $gen->getMimeType());
$gen->genContent($fp);
rewind($fp);
echo stream_get_contents($fp);
fclose($fp);
Exemple #2
0
$confname = 'test1';
$cli_args = arguments($argv);
if (!empty($cli_args['dry-run']) || !empty($cli_args['n'])) {
    $dry_run = true;
}
if (!empty($cli_args['debug']) || !empty($cli_args['d'])) {
    $verbose = 3;
} else {
    if (!empty($cli_args['verbose']) || !empty($cli_args['v'])) {
        $verbose = 2;
    } else {
        if (!empty($cli_args['silent']) || !empty($cli_args['q'])) {
            $verbose = 0;
        }
    }
}
if (!empty($cli_args['config'])) {
    define('DEFAULT_A2BILLING_CONFIG', $cli_args['config']);
}
// Get the periods
$macs = $cli_args['input'];
if (empty($macs)) {
    echo "No MAC specified!\n";
    exit(1);
}
$res = STDOUT;
$gen = new SpaXmlProvi();
if (!$gen->Init(array(mac => $macs[0]))) {
    exit(2);
}
$gen->genContent($res);