/* Some basic checks are in place */
isset($r) || die("CVSroot must be set\n");
$m) || die("CVSmodule must be set\n");
$f) || die("File must be set\n");
strchr($r"'") || strchr($m"'") || strchr($f"'"))
"Invalid characters in arguments\n");
    <title> <?php echo "CvsGraph of '$f'\n"?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="generator" content="handcrafted">
<body bgcolor="#f0f0f0">
/* I'll be paranoid, set root and module here so no one can get access elsewhere */
    /* Remove this or change it to suit your needs */
//    $r = "/home/cvsgraph";
//    $m = "cvsgraph";

    /* Shell escape, PHP4 has functions for this, use them */
$sr "'" $r "'";
$sm "'" $m "'";
$sf "'" $f ",v'";

/* Image references must be encoded properly */
$ur urlencode($r);
$um urlencode($m);
$uf urlencode($f);
$cvsroot) && $cvsroot != "")
$ucr"&cvsroot=" urlencode($cvsroot);    /* The cvsweb.cgi root */
$ucr "";

/* I expose the paths here (accessible via the server). */
    /* Set this to a private place to make it secure. */
$cvsgraph "/home/bertho/public_html/cvsgraph/cvsgraph";
$cvsgraph_conf "/home/bertho/public_html/cvsgraph/conf/cvsgraph.conf";

/* Print a head line */
echo "<h1>CvsGraph of '$f'</h1>\n";

/* Generate an imagemap */
$mapname "CvsGraphMap";
$arg9 "-9 '/~bertho/cvsgraph/'";
$arg8 "-8 '$ucr'";
$arg0 "-0 'Branch:'";
$arg1 "-1 'Revision:'";
$arg2 "-2 'Diff:'";
$argM "-M '$mapname'";
passthru("$cvsgraph $arg0 $arg1 $arg2 $arg8 $arg9 $argM -i -c $cvsgraph_conf -r $sr -m $sm $sf");

/* Link a CvsGraph image */
echo "<img border=\"0\" usemap=\"#$mapname\" src=\"/~bertho/cvsgraph/mkimage.php3?r=$ur&m=$um&f=$uf\" alt=\"CvsGraph of '$f'\">\n";
"<p>\nClick on the revisions/branches to display them\n";
"<br>\nClick between the revisions to display the diffs\n";
Created with <a href="/~bertho/cvsgraph">CvsGraph</a> version 1.1.2