version 1.1.1.37, 2007/03/17 21:52:33 |
version 4.1, 2019/11/08 21:08:26 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
|
# $Id$ |
|
# $knu: cvsweb.cgi,v 1.299 2010/11/13 16:37:18 simon |
# |
# |
# cvsweb - a CGI interface to CVS trees. |
# cvsweb - a CGI interface to CVS trees. |
# |
# |
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
# 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. |
# |
|
# $FreeBSD: projects/cvsweb/cvsweb.cgi,v 1.295 2005/09/25 20:28:51 scop Exp $ |
|
# $zId: cvsweb.cgi,v 1.112 2001/07/24 13:03:16 hzeller Exp $ |
|
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.84 2001/10/07 20:50:10 knu Exp $ |
|
# |
|
### |
|
|
|
require 5.006; |
require 5.006; |
|
|
Line 883 if (-d $fullname) { |
|
Line 879 if (-d $fullname) { |
|
|
|
my $infocols = 1; |
my $infocols = 1; |
|
|
printf(<<EOF, 'Directory index of ' . htmlquote($where)); |
printf(<<EOF, $tablepadding, 'Directory index of ' . htmlquote($where)); |
<table class="dir" width="100%%" cellspacing="0" cellpadding="$tablepadding" summary="%s"> |
<table class="dir" width="100%%" cellspacing="0" cellpadding="%s" summary="%s"> |
<tr> |
<tr> |
EOF |
EOF |
printf('<th colspan="2"%s>', ($byfile ? ' class="sorted"' : '')); |
printf('<th colspan="2"%s>', ($byfile ? ' class="sorted"' : '')); |
|
|
|
|
# Show last change in dir |
# Show last change in dir |
if ($filename) { |
if ($filename) { |
print "</td>\n<td> </td>\n<td class=\"age\">"; |
my $ageclass = 'age'; |
print readableTime(time() - $date, 0) if $date; |
my $age = ''; |
|
if ($date) { |
|
$age = readableTime(time() - $date, 0); |
|
$ageclass .= " $1" if ($age =~ /^\d+ ([a-z]+)/); |
|
} |
|
print "</td>\n<td> </td>\n<td class=\"$ageclass\">$age"; |
print "</td>\n<td class=\"author\">", htmlquote($author) |
print "</td>\n<td class=\"author\">", htmlquote($author) |
if $show_author; |
if $show_author; |
print "</td>\n<td class=\"log\">"; |
print "</td>\n<td class=\"log\">"; |
|
|
print ' ', &link(htmlquote($file), $url), $attic; |
print ' ', &link(htmlquote($file), $url), $attic; |
print '</td><td class="graph">', graph_link($fileurl) if $allow_cvsgraph; |
print '</td><td class="graph">', graph_link($fileurl) if $allow_cvsgraph; |
print "</td>\n<td width=\"30\">", display_link($fileurl, $rev); |
print "</td>\n<td width=\"30\">", display_link($fileurl, $rev); |
print "</td>\n<td class=\"age\">"; |
my $ageclass = 'age'; |
print readableTime(time() - $date, 0) if $date; |
my $age = ''; |
|
if ($date) { |
|
$age = readableTime(time() - $date, 0); |
|
$ageclass .= " $1" if ($age =~ /^\d+ ([a-z]+)/); |
|
} |
|
print "</td>\n<td class=\"$ageclass\">$age"; |
print "</td>\n<td class=\"author\">", htmlquote($author) if $show_author; |
print "</td>\n<td class=\"author\">", htmlquote($author) if $show_author; |
print "</td>\n<td class=\"log\">"; |
print "</td>\n<td class=\"log\">"; |
|
|
|
|
if (scalar %tags || $input{only_with_tag}) { |
if (scalar %tags || $input{only_with_tag}) { |
print "<form method=\"get\" action=\"./\">\n<p>\n"; |
print "<form method=\"get\" action=\"./\">\n<p>\n"; |
foreach my $var (@stickyvars) { |
foreach my $var (@stickyvars) { |
printf("<input type=\"hidden\" name=\"$var\" value=\"%s\" />\n", |
printf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n", |
htmlquote($input{$var})) |
$var, htmlquote($input{$var})) |
if (defined($input{$var}) |
if (defined($input{$var}) |
&& (!defined($DEFAULTVALUE{$var}) |
&& (!defined($DEFAULTVALUE{$var}) |
|| $input{$var} ne $DEFAULTVALUE{$var}) |
|| $input{$var} ne $DEFAULTVALUE{$var}) |
Line 1521 sub htmlify($;$) |
|
Line 1527 sub htmlify($;$) |
|
|
|
do { |
do { |
$prev = $_; |
$prev = $_; |
|
|
$_ = htmlify_sub { |
$_ = htmlify_sub { |
s{ |
s{ |
(\b$re_prkeyword[:\#]?\s* |
(\b$re_prkeyword[:\#]?\s* |
|
|
next if ($_ eq "f"); |
next if ($_ eq "f"); |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "logsort"); |
next if ($_ eq "logsort"); |
printf("<input type=\"hidden\" name=\"$_\" value=\"%s\" />\n", |
printf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n", |
htmlquote($input{$_})) |
$_, htmlquote($input{$_})) |
if (defined($input{$_}) |
if (defined($input{$_}) |
&& (!defined($DEFAULTVALUE{$_}) || $input{$_} ne $DEFAULTVALUE{$_})); |
&& (!defined($DEFAULTVALUE{$_}) || $input{$_} ne $DEFAULTVALUE{$_})); |
} |
} |
Line 3840 sub navigateHeader($$$$$;$) |
|
Line 3845 sub navigateHeader($$$$$;$) |
|
my $qpath = htmlquote($path); |
my $qpath = htmlquote($path); |
my $trev = $rev ? " - " . htmlquote($rev) : ''; |
my $trev = $rev ? " - " . htmlquote($rev) : ''; |
|
|
http_header('', $moddate); |
http_header('text/html', $moddate); |
|
|
print <<EOF; |
print <<EOF; |
$HTML_DOCTYPE |
$HTML_DOCTYPE |
Line 4272 sub http_header(;$$) |
|
Line 4277 sub http_header(;$$) |
|
|| (defined($CMD{gzip}) && open(GZIP, "| $CMD{gzip} -1 -c"))) |
|| (defined($CMD{gzip}) && open(GZIP, "| $CMD{gzip} -1 -c"))) |
{ |
{ |
|
|
push(@headers, 'Content-Encoding: x-gzip'); |
push(@headers, 'Content-Encoding: gzip'); |
push(@headers, 'Vary: Accept-Encoding'); # RFC 2616, 14.44 |
push(@headers, 'Vary: Accept-Encoding'); # RFC 2616, 14.44 |
print join("\r\n", @headers) . "\r\n\r\n"; |
print join("\r\n", @headers) . "\r\n\r\n"; |
|
|