<?

include ("conf.php");

session_start();

/* 
 * Generate graph 
 */
$AvailableProgs = array ( 'GenGraph.pl', 'GenPortGraph.pl' );

$prognum = urldecode($_GET['prog']);
if ( !is_numeric($prognum) || $prognum < 0 || $prognum > count($AvailableProgs) ) {
	header("Content-type: image/gif");
	return;
}
$prog = $AvailableProgs[$prognum];

$arg = urldecode($_GET['arg']);

header("Content-type: image/gif");
passthru("$LIBEXECDIR/$prog $arg");

?>
