/[CvsGraph]/cvsgraph/contrib/cvsgraphwrapper.php.in
ViewVC logotype

Annotate of /cvsgraph/contrib/cvsgraphwrapper.php.in

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations)
Wed May 21 13:33:35 2008 UTC (9 years, 6 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_7_0, merge_automake_dev1_20080521, HEAD
Changes since 1.1: +69 -0 lines
Merge automake into head
1 bertho 1.2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
2     <?php
3     /* Some basic checks are in place */
4     isset($r) || die("CVSroot must be set\n");
5     isset($m) || die("CVSmodule must be set\n");
6     isset($f) || die("File must be set\n");
7     if(strchr($r, "'") || strchr($m, "'") || strchr($f, "'"))
8     die("Invalid characters in arguments\n");
9     ?>
10     <html>
11     <head>
12     <title> <?php echo "CvsGraph of '$f'\n"; ?></title>
13     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
14     <meta name="generator" content="handcrafted">
15     </head>
16     <body bgcolor="#f0f0f0">
17     <center>
18     <?php
19     /* I'll be paranoid, set root and module here so no one can get access elsewhere */
20     /* Remove this or change it to suit your needs */
21     // $r = "/home/cvsgraph";
22     // $m = "cvsgraph";
23    
24     /* Shell escape, PHP4 has functions for this, use them */
25     $sr = "'" . $r . "'";
26     $sm = "'" . $m . "'";
27     $sf = "'" . $f . ",v'";
28    
29     /* Image references must be encoded properly */
30     $ur = urlencode($r);
31     $um = urlencode($m);
32     $uf = urlencode($f);
33     if(isset($cvsroot) && $cvsroot != "")
34     $ucr= "&cvsroot=" . urlencode($cvsroot); /* The cvsweb.cgi root */
35     else
36     $ucr = "";
37    
38     /* I expose the paths here (accessible via the server). */
39     /* Set this to a private place to make it secure. */
40     $prefix = "@prefix@";
41     $exec_prefix = "@exec_prefix@";
42     $cvsgraph = "@bindir@/cvsgraph";
43     $cvsgraph_conf = "@sysconfdir@/cvsgraph.conf";
44    
45     /* Print a head line */
46     echo "<h1>CvsGraph of '$f'</h1>\n";
47    
48     /* Generate an imagemap */
49     $mapname = "CvsGraphMap";
50     $arg9 = "-9 './'";
51     $arg8 = "-8 '$ucr'";
52     $arg0 = "-0 'Branch:'";
53     $arg1 = "-1 'Revision:'";
54     $arg2 = "-2 'Diff:'";
55     $argM = "-M '$mapname'";
56     passthru("$cvsgraph $arg0 $arg1 $arg2 $arg8 $arg9 $argM -i -c $cvsgraph_conf -r $sr -m $sm $sf");
57    
58     /* Link a CvsGraph image */
59     echo "<img border=\"0\" usemap=\"#$mapname\" src=\"./mkimage.php?r=$ur&amp;m=$um&amp;f=$uf\" alt=\"CvsGraph of '$f'\">\n";
60     echo "<p>\nClick on the revisions/branches to display them\n";
61     echo "<br>\nClick between the revisions to display the diffs\n";
62     ?>
63     <hr>
64     </center>
65     <address>
66     Created with <a href="http://www.akhphd.au.dk/~bertho/cvsgraph/">CvsGraph</a>
67     </address>
68     </body>
69     </html>

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0