version 1.1.1.22, 2001/01/14 08:49:27 |
version 1.1.1.26, 2001/06/05 10:56:15 |
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
# $zId: cvsweb.cgi,v 1.105 2000/11/26 01:51:04 jumager Exp $ |
# $zId: cvsweb.cgi,v 1.106 2001/03/10 01:16:27 hnordstrom Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.64 2001/01/13 07:48:09 knu Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.74 2001/06/05 04:46:21 knu Exp $ |
# |
# |
### |
### |
|
|
Line 139 sub forbidden_module($); |
|
Line 139 sub forbidden_module($); |
|
##### Start of Configuration Area ######## |
##### Start of Configuration Area ######## |
delete $ENV{PATH}; |
delete $ENV{PATH}; |
|
|
$cvsweb_revision = join('.', '1.105', (split(/ /, |
$cvsweb_revision = '1.106' . '.' . (split(/ /, |
q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.64 2001/01/13 07:48:09 knu Exp $ |
q$Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.74 2001/06/05 04:46:21 knu Exp $ |
))[2]); |
))[2]; |
|
|
use File::Basename; |
use File::Basename; |
|
|
Line 309 if (-f $config) { |
|
Line 309 if (-f $config) { |
|
} else { |
} else { |
&fatal("500 Internal Error", |
&fatal("500 Internal Error", |
'Configuration not found. Set the variable <code>$config</code> ' |
'Configuration not found. Set the variable <code>$config</code> ' |
. 'in cvsweb.cgi, or the environment variable ' |
. 'in cvsweb.cgi to your <b>cvsweb.conf</b> configuration file first.'); |
. '<code>CVSWEB_CONFIG</code>, to your <b>cvsweb.conf</b> ' |
|
. 'configuration file first.'); |
|
} |
} |
|
|
undef %input; |
undef %input; |
Line 750 if (-d $fullname) { |
|
Line 748 if (-d $fullname) { |
|
else { |
else { |
print &link($backicon, $url); |
print &link($backicon, $url); |
} |
} |
print " ", &link("Previous Directory", $url); |
print " ", &link("Parent Directory", $url); |
} |
} |
else { |
else { |
$url = urlencode($_) . "/$query"; |
$url = './' . urlencode($_) . "/$query"; |
print "<A NAME=\"$_\"></A>"; |
print "<A NAME=\"$_\"></A>"; |
if ($nofilelinks) { |
if ($nofilelinks) { |
print $diricon; |
print $diricon; |
Line 816 if (-d $fullname) { |
|
Line 814 if (-d $fullname) { |
|
} |
} |
elsif (s/,v$//) { |
elsif (s/,v$//) { |
$fileurl = ($attic ? "Attic/" : "") . urlencode($_); |
$fileurl = ($attic ? "Attic/" : "") . urlencode($_); |
$url = $fileurl . $query; |
$url = './' . $fileurl . $query; |
my $rev = ''; |
my $rev = ''; |
my $date = ''; |
my $date = ''; |
my $log = ''; |
my $log = ''; |
Line 914 if (-d $fullname) { |
|
Line 912 if (-d $fullname) { |
|
&link("Download this directory in tarball", |
&link("Download this directory in tarball", |
# Mangle the filename so browsers show a reasonable |
# Mangle the filename so browsers show a reasonable |
# filename to download. |
# filename to download. |
"$basefile.tar.gz$query". |
"./$basefile.tar.gz$query". |
($query ? "&" : "?")."tarball=1"), |
($query ? "&" : "?")."tarball=1"), |
"</DIV>"; |
"</DIV>"; |
} |
} |
Line 1108 sub findLastModifiedSubdirs(@) { |
|
Line 1106 sub findLastModifiedSubdirs(@) { |
|
|
|
sub htmlify_sub(&$) { |
sub htmlify_sub(&$) { |
(my $proc, local $_) = @_; |
(my $proc, local $_) = @_; |
local @_ = split(m`(<a [^>]+>[^<]*</a>)`i); |
my @a = split(m`(<a [^>]+>[^<]*</a>)`i); |
my $linked; |
my $linked; |
my $result = ''; |
my $result = ''; |
|
|
while (($_, $linked) = splice(@_, 0, 2)) { |
while (($_, $linked) = splice(@a, 0, 2)) { |
&$proc(); |
&$proc(); |
$result .= $_ if defined($_); |
$result .= $_ if defined($_); |
$result .= $linked if defined($linked); |
$result .= $linked if defined($linked); |
Line 1228 sub spacedHtmlText($;$) { |
|
Line 1226 sub spacedHtmlText($;$) { |
|
sub link($$) { |
sub link($$) { |
my($name, $url) = @_; |
my($name, $url) = @_; |
|
|
|
$url =~ s/:/sprintf("%%%02x", ord($&))/eg if $url =~ /^[^a-z]/; # relative |
|
|
sprintf '<A HREF="%s">%s</A>', hrefquote($url), $name; |
sprintf '<A HREF="%s">%s</A>', hrefquote($url), $name; |
} |
} |
|
|
Line 1305 sub safeglob($) { |
|
Line 1305 sub safeglob($) { |
|
push(@results, "$dirname/" .$_); |
push(@results, "$dirname/" .$_); |
} |
} |
} |
} |
|
closedir($dh); |
} |
} |
|
|
@results; |
@results; |
Line 1413 sub doAnnotate($$) { |
|
Line 1414 sub doAnnotate($$) { |
|
# the public domain. |
# the public domain. |
# we could abandon the use of rlog, rcsdiff and co using |
# we could abandon the use of rlog, rcsdiff and co using |
# the cvsserver in a similiar way one day (..after rewrite) |
# the cvsserver in a similiar way one day (..after rewrite) |
$pid = open2($reader, $writer, "cvs", @cvs_options, "server") |
$pid = open2($reader, $writer, $CMD{cvs}, @cvs_options, "server") |
|| fatal ("500 Internal Error", "Fatal Error - unable to open cvs for annotation"); |
|| fatal ("500 Internal Error", "Fatal Error - unable to open cvs for annotation"); |
|
|
# OK, first send the request to the server. A simplified example is: |
# OK, first send the request to the server. A simplified example is: |
Line 1704 sub cvswebMarkup($$$) { |
|
Line 1705 sub cvswebMarkup($$$) { |
|
print "</PRE>"; |
print "</PRE>"; |
} |
} |
else { |
else { |
print "<PLAINTEXT>\n", <$filehandle>; |
print "<PRE>"; |
|
while (<$filehandle>) { |
|
print htmlquote($_); |
|
} |
|
print "</PRE>"; |
} |
} |
} |
} |
|
|
Line 1771 sub doDiff($$$$$$) { |
|
Line 1776 sub doDiff($$$$$$) { |
|
|
|
while (($re1, $re2) = each %funcline_regexp) { |
while (($re1, $re2) = each %funcline_regexp) { |
if ($fullname =~ /$re1/) { |
if ($fullname =~ /$re1/) { |
push @difftype, '-F', '$re2'; |
push @difftype, '-F', $re2; |
last; |
last; |
} |
} |
} |
} |
Line 2640 sub human_readable_diff($){ |
|
Line 2645 sub human_readable_diff($){ |
|
print "<br>Tag: $sym2\n" if ($sym1); |
print "<br>Tag: $sym2\n" if ($sym1); |
print "</th>\n"; |
print "</th>\n"; |
|
|
my $fs = "<font face=\"$difffontface\" size=\"$difffontsize\">"; |
my $fs = "<font face=\"$difffontface\" size=\"$difffontsize\"><tt>"; |
my $fe = "</font>"; |
my $fe = "</tt></font>"; |
|
|
my $leftRow = 0; |
my $leftRow = 0; |
my $rightRow = 0; |
my $rightRow = 0; |
Line 2663 sub human_readable_diff($){ |
|
Line 2668 sub human_readable_diff($){ |
|
|
|
if ($difftxt =~ /^@@/) { |
if ($difftxt =~ /^@@/) { |
($oldline,$newline,$funname) = $difftxt =~ /@@ \-([0-9]+).*\+([0-9]+).*@@(.*)/; |
($oldline,$newline,$funname) = $difftxt =~ /@@ \-([0-9]+).*\+([0-9]+).*@@(.*)/; |
|
$funname = htmlquote($funname); |
print "<tr bgcolor=\"$diffcolorHeading\"><td width=\"50%\">"; |
print "<tr bgcolor=\"$diffcolorHeading\"><td width=\"50%\">"; |
print "<table width=\"100%\" border=1 cellpadding=5><tr><td><b>Line $oldline</b>"; |
print "<table width=\"100%\" border=1 cellpadding=5><tr><td><b>Line $oldline</b>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
Line 2757 sub human_readable_diff($){ |
|
Line 2763 sub human_readable_diff($){ |
|
sub navigateHeader($$$$$) { |
sub navigateHeader($$$$$) { |
my ($swhere,$path,$filename,$rev,$title) = @_; |
my ($swhere,$path,$filename,$rev,$title) = @_; |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = urlencode($filename) if ($swhere eq ""); |
$swhere = './' . urlencode($filename) if ($swhere eq ""); |
|
|
print <<EOF; |
print <<EOF; |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
Line 2772 $body_tag_for_src |
|
Line 2778 $body_tag_for_src |
|
EOF |
EOF |
|
|
print &link($backicon, "$swhere$query#rev$rev"); |
print &link($backicon, "$swhere$query#rev$rev"); |
print "</a> <b>Return to ", &link("$filename","$swhere$query#rev$rev")," CVS log"; |
print "<b>Return to ", &link($filename,"$swhere$query#rev$rev")," CVS log"; |
print "</b> $fileicon</td>"; |
print "</b> $fileicon</td>"; |
|
|
print "<td align=right>$diricon <b>Up to ", &clickablePath($path, 1), "</b></td>"; |
print "<td align=right>$diricon <b>Up to ", &clickablePath($path, 1), "</b></td>"; |
Line 2990 sub download_link($$$;$) { |
|
Line 2996 sub download_link($$$;$) { |
|
my ($url, $revision, $textlink, $mimetype) = @_; |
my ($url, $revision, $textlink, $mimetype) = @_; |
my ($fullurl) = download_url($url, $revision, $mimetype); |
my ($fullurl) = download_url($url, $revision, $mimetype); |
|
|
|
$fullurl =~ s/:/sprintf("%%%02x", ord($&))/eg; |
|
|
printf '<A HREF="%s"', hrefquote("$fullurl$barequery"); |
printf '<A HREF="%s"', hrefquote("$fullurl$barequery"); |
|
|
if ($open_extern_window && (!defined($mimetype) || $mimetype ne "text/x-cvsweb-markup")) { |
if ($open_extern_window && (!defined($mimetype) || $mimetype ne "text/x-cvsweb-markup")) { |
Line 3186 sub link_tags($) { |
|
Line 3194 sub link_tags($) { |
|
my ($fileurl,$filename); |
my ($fileurl,$filename); |
|
|
($filename = $where) =~ s/^.*\///; |
($filename = $where) =~ s/^.*\///; |
$fileurl = urlencode($filename); |
$fileurl = './' . urlencode($filename); |
|
|
foreach my $sym (split(", ", $tags)) { |
foreach my $sym (split(", ", $tags)) { |
$ret .= ",\n" if ($ret ne ""); |
$ret .= ",\n" if ($ret ne ""); |