version 1.1.1.31, 2002/05/22 08:16:25 |
version 1.1.1.35, 2002/09/30 19:43:49 |
|
|
# cvsweb - a CGI interface to CVS trees. |
# cvsweb - a CGI interface to CVS trees. |
# |
# |
# Written in their spare time by |
# Written in their spare time by |
# Bill Fenner <fenner@FreeBSD.org> (original work) |
# Bill Fenner <fenner@FreeBSD.org> (original work) |
# extended by Henner Zeller <zeller@think.de>, |
# extended by Henner Zeller <zeller@think.de>, |
# Henrik Nordstrom <hno@hem.passagen.se> |
# Henrik Nordstrom <hno@hem.passagen.se> |
# Ken Coar <coar@Apache.Org> |
# Ken Coar <coar@Apache.Org> |
# Dick Balaska <dick@buckosoft.com> |
# Dick Balaska <dick@buckosoft.com> |
# Akinori MUSHA <knu@FreeBSD.org> |
# Akinori MUSHA <knu@FreeBSD.org> |
# Jens-Uwe Mager <jum@helios.de> |
# Jens-Uwe Mager <jum@helios.de> |
# Ville Skyttä <ville.skytta@iki.fi> (html cleanup) |
# Ville Skyttä <scop@FreeBSD.org> |
|
# Vassilii Khachaturov <vassilii@tarunz.org> |
# |
# |
# Based on: |
# Based on: |
# * Bill Fenners cvsweb.cgi revision 1.28 available from: |
# * Bill Fenners cvsweb.cgi revision 1.28 available from: |
|
|
# |
# |
# Copyright (c) 1996-1998 Bill Fenner |
# Copyright (c) 1996-1998 Bill Fenner |
# (c) 1998-1999 Henner Zeller |
# (c) 1998-1999 Henner Zeller |
# (c) 1999 Henrik Nordstrom |
# (c) 1999 Henrik Nordstrom |
# (c) 2000-2002 Akinori MUSHA |
# (c) 2000-2002 Akinori MUSHA |
|
# (c) 2002 Ville Skyttä |
# All rights reserved. |
# All rights reserved. |
# |
# |
# Redistribution and use in source and binary forms, with or without |
# Redistribution and use in source and binary forms, with or without |
|
|
# 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.104 2002/05/22 08:10:18 knu Exp $ |
# FreeBSD: projects/cvsweb/cvsweb.cgi,v 1.119 2002/07/23 13:58:32 scop Exp |
# $zId: cvsweb.cgi,v 1.112 2001/07/24 13:03:16 hzeller 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 $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.84 2001/10/07 20:50:10 knu Exp $ |
|
# $FreeBSD: www/en/cgi/cvsweb.cgi,v 1.86 2002/09/26 22:18:25 scop Exp $ |
# |
# |
### |
### |
|
|
|
|
$use_moddate $has_zlib $gzip_open |
$use_moddate $has_zlib $gzip_open |
$allow_tar @tar_options @gzip_options @zip_options @cvs_options |
$allow_tar @tar_options @gzip_options @zip_options @cvs_options |
$LOG_FILESEPARATOR $LOG_REVSEPARATOR |
$LOG_FILESEPARATOR $LOG_REVSEPARATOR |
$tmpdir $HTML_DOCTYPE |
$tmpdir $HTML_DOCTYPE $HTML_META |
); |
); |
|
|
sub printDiffSelect($); |
sub printDiffSelect($); |
Line 147 sub forbidden_module($); |
|
Line 150 sub forbidden_module($); |
|
##### Start of Configuration Area ######## |
##### Start of Configuration Area ######## |
delete $ENV{PATH}; |
delete $ENV{PATH}; |
|
|
$cvsweb_revision = '2.0.3'; |
$cvsweb_revision = '2.0.5'; |
|
|
use File::Basename (); |
use File::Basename (); |
|
|
Line 185 $cvstreedefault = $body_tag = $body_tag_for_src = $log |
|
Line 188 $cvstreedefault = $body_tag = $body_tag_for_src = $log |
|
$extern_window_width = $extern_window_height = $edit_option_form = |
$extern_window_width = $extern_window_height = $edit_option_form = |
$show_subdir_lastmod = $show_log_in_markup = $v = $navigationHeaderColor = |
$show_subdir_lastmod = $show_log_in_markup = $v = $navigationHeaderColor = |
$tableBorderColor = $markupLogColor = $tabstop = $use_moddate = $moddate = |
$tableBorderColor = $markupLogColor = $tabstop = $use_moddate = $moddate = |
$gzip_open = $HTML_DOCTYPE = undef; |
$gzip_open = $HTML_DOCTYPE = $HTML_META = undef; |
$tmpdir = defined($ENV{TMPDIR}) ? $ENV{TMPDIR} : "/var/tmp"; |
$tmpdir = defined($ENV{TMPDIR}) ? $ENV{TMPDIR} : "/var/tmp"; |
|
|
$LOG_FILESEPARATOR = q/^={77}$/; |
$LOG_FILESEPARATOR = q/^={77}$/; |
Line 233 $LOG_REVSEPARATOR = q/^-{28}$/; |
|
Line 236 $LOG_REVSEPARATOR = q/^-{28}$/; |
|
}, |
}, |
); |
); |
|
|
|
$cgi_style::hsty_base = 'http://www.FreeBSD.org'; |
|
$_ = q$FreeBSD: www/en/cgi/cvsweb.cgi,v 1.86 2002/09/26 22:18:25 scop Exp $; |
|
@_ = split; |
|
$cgi_style::hsty_date = "@_[3,4]"; |
|
|
|
# warningproof |
|
0 if $cgi_style::hsty_base ne $cgi_style::hsty_date; |
|
|
|
package cgi_style; |
|
require "$main::mydir/cgi-style.pl"; |
|
package main; |
|
|
$HTML_DOCTYPE = |
$HTML_DOCTYPE = |
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'; |
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'; |
|
|
|
$HTML_META = <<EOM; |
|
<meta name="robots" content="nofollow"> |
|
<meta name="generator" content="FreeBSD-CVSweb $cvsweb_revision"> |
|
<meta http-equiv="Content-Script-Type" content="text/javascript"> |
|
<meta http-equiv="Content-Style-Type" content="text/css"> |
|
EOM |
|
|
##### End of configuration variables ##### |
##### End of configuration variables ##### |
|
|
use Time::Local (); |
use Time::Local (); |
Line 335 $input{only_with_tag} = $input{only_on_branch} |
|
Line 357 $input{only_with_tag} = $input{only_on_branch} |
|
|
|
# Prevent cross-site scripting |
# Prevent cross-site scripting |
foreach (@unsafevars) { |
foreach (@unsafevars) { |
if (defined($input{$_}) && $input{$_} =~ /[^\w\-.]/) { |
# Colons are needed in diffs between tags. |
|
if (defined($input{$_}) && $input{$_} =~ /[^\w\-.:]/) { |
fatal("500 Internal Error", |
fatal("500 Internal Error", |
'Malformed query (%s=%s)', |
'Malformed query (%s=%s)', |
$_, $input{$_}); |
$_, $input{$_}); |
Line 630 if (-d $fullname) { |
|
Line 653 if (-d $fullname) { |
|
print $short_instruction; |
print $short_instruction; |
} |
} |
|
|
my $descriptions; |
if ($use_descriptions && open(DESC, "<$cvsroot/CVSROOT/descriptions")) |
if (($use_descriptions) && open(DESC, "<$cvsroot/CVSROOT/descriptions")) |
|
{ |
{ |
while (<DESC>) { |
while (<DESC>) { |
chomp; |
chomp; |
my ($dir, $description) = /(\S+)\s+(.*)/; |
my ($dir, $description) = /(\S+)\s+(.*)/; |
$descriptions{$dir} = $description; |
$descriptions{$dir} = $description; |
} |
} |
|
close(DESC); |
} |
} |
|
|
print "<p><a name=\"dirlist\"></a></p>\n"; |
print "<p><a name=\"dirlist\"></a></p>\n"; |
Line 924 if (-d $fullname) { |
|
Line 947 if (-d $fullname) { |
|
} |
} |
$dirrow++; |
$dirrow++; |
} elsif (s/,v$//) { |
} elsif (s/,v$//) { |
|
|
|
# Skip forbidden files now so we'll give no hint |
|
# about their existence. This should probably have |
|
# been done earlier, but it's straightforward here. |
|
next if forbidden_file("$fullname/$_"); |
|
|
$fileurl = ($attic ? "Attic/" : "") . urlencode($_); |
$fileurl = ($attic ? "Attic/" : "") . urlencode($_); |
$url = './' . $fileurl . $query; |
$url = './' . $fileurl . $query; |
my $rev = ''; |
my $rev = ''; |
Line 1002 if (-d $fullname) { |
|
Line 1031 if (-d $fullname) { |
|
|| $input{$var} ne $DEFAULTVALUE{$var}) |
|| $input{$var} ne $DEFAULTVALUE{$var}) |
&& $input{$var} ne "" && $var ne "only_with_tag"); |
&& $input{$var} ne "" && $var ne "only_with_tag"); |
} |
} |
print "<p>Show only files with tag:\n"; |
print "<p><label for=\"only_with_tag\" accesskey=\"T\">"; |
print "<select name=\"only_with_tag\""; |
print "Show only files with tag:</label>\n"; |
|
print "<select id=\"only_with_tag\" name=\"only_with_tag\""; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print ">"; |
print ">"; |
print "<option value=\"\">All tags / default branch</option>\n"; |
print "<option value=\"\">All tags / default branch</option>\n"; |
Line 1015 if (-d $fullname) { |
|
Line 1045 if (-d $fullname) { |
|
">$tag</option>\n"; |
">$tag</option>\n"; |
} |
} |
print "</select>\n"; |
print "</select>\n"; |
print " Module path or alias:\n"; |
print " <label for=\"path\" accesskey=\"P\">"; |
printf "<input type=\"text\" name=\"path\" value=\"%s\" size=\"15\">\n", |
print "Module path or alias:</label>\n"; |
|
printf "<input type=\"text\" id=\"path\" name=\"path\" value=\"%s\" size=\"15\">\n", |
htmlquote($where); |
htmlquote($where); |
print "<input type=\"submit\" value=\"Go\"></p>\n"; |
print "<input type=\"submit\" value=\"Go\" accesskey=\"G\"></p>\n"; |
print "</form>\n"; |
print "</form>\n"; |
} |
} |
|
|
Line 1056 if (-d $fullname) { |
|
Line 1087 if (-d $fullname) { |
|
print "<center>\n<table cellpadding=\"0\" cellspacing=\"0\">"; |
print "<center>\n<table cellpadding=\"0\" cellspacing=\"0\">"; |
print "\n<tr style=\"background-color: $columnHeaderColorDefault\">\n"; |
print "\n<tr style=\"background-color: $columnHeaderColorDefault\">\n"; |
print "<th colspan=\"2\">Preferences</th>\n</tr>\n"; |
print "<th colspan=\"2\">Preferences</th>\n</tr>\n"; |
print "<tr>\n<td>Sort files by <select name=\"sortby\">\n"; |
print "<tr>\n<td>"; |
|
print "<label for=\"sortby\" accesskey=\"F\">Sort files by "; |
|
print "</label><select id=\"sortby\" name=\"sortby\">\n"; |
print "<option value=\"\">File</option>\n"; |
print "<option value=\"\">File</option>\n"; |
print "<option", $bydate ? " selected" : "", |
print "<option", $bydate ? " selected" : "", |
" value=\"date\">Age</option>\n"; |
" value=\"date\">Age</option>\n"; |
Line 1068 if (-d $fullname) { |
|
Line 1101 if (-d $fullname) { |
|
print "<option", $bylog ? " selected" : "", |
print "<option", $bylog ? " selected" : "", |
" value=\"log\">Log message</option>\n"; |
" value=\"log\">Log message</option>\n"; |
print "</select>\n</td>\n"; |
print "</select>\n</td>\n"; |
print "<td>Sort log by: "; |
print "<td><label for=\"logsort\" accesskey=\"L\">"; |
|
print "Sort log by: </label>"; |
printLogSortSelect(0); |
printLogSortSelect(0); |
print "</td>\n</tr>\n"; |
print "</td>\n</tr>\n"; |
print "<tr>\n<td>Diff format: "; |
print "<tr>\n<td><label for=\"f\" accesskey=\"D\">"; |
|
print "Diff format: </label>"; |
printDiffSelect(0); |
printDiffSelect(0); |
print "</td>\n"; |
print "</td>\n"; |
print "<td><label>Show Attic files: "; |
print "<td><label for=\"hideattic\" accesskey=\"A\">"; |
print "<input name=\"hideattic\" type=\"checkbox\"", |
print "Show Attic files: </label>"; |
|
print "<input id=\"hideattic\" name=\"hideattic\" type=\"checkbox\"", |
$input{'hideattic'} ? " checked" : "", |
$input{'hideattic'} ? " checked" : "", |
"></label></td>\n</tr>\n"; |
"></td>\n</tr>\n"; |
print "<tr>\n<td align=\"center\" colspan=\"2\">"; |
print "<tr>\n<td align=\"center\" colspan=\"2\">"; |
print "<input type=\"submit\" value=\"Change Options\">"; |
print "<input type=\"submit\" value=\"Change Options\" accesskey=\"C\">"; |
print "</td>\n</tr>\n</table>\n</center>\n</form>\n"; |
print "</td>\n</tr>\n</table>\n</center>\n</form>\n"; |
} |
} |
html_footer(); |
html_footer(); |
Line 1089 if (-d $fullname) { |
|
Line 1125 if (-d $fullname) { |
|
# View Files |
# View Files |
############################### |
############################### |
elsif (-f $fullname . ',v') { |
elsif (-f $fullname . ',v') { |
|
|
|
if (forbidden_file($fullname)) { |
|
fatal('403 Forbidden', |
|
'Access forbidden. This file is mentioned in @ForbiddenFiles'); |
|
return; |
|
} |
|
|
if (defined($input{'rev'}) || $doCheckout) { |
if (defined($input{'rev'}) || $doCheckout) { |
&doCheckout($fullname, $input{'rev'}); |
&doCheckout($fullname, $input{'rev'}); |
gzipclose(); |
gzipclose(); |
Line 1184 sub printDiffSelect($) { |
|
Line 1227 sub printDiffSelect($) { |
|
my ($use_java_script) = @_; |
my ($use_java_script) = @_; |
my $f = $input{'f'}; |
my $f = $input{'f'}; |
|
|
print '<select name="f"'; |
print '<select id="f" name="f"'; |
print ' onchange="this.form.submit()"' if $use_java_script; |
print ' onchange="this.form.submit()"' if $use_java_script; |
print ">\n"; |
print ">\n"; |
|
|
Line 1200 sub printDiffSelect($) { |
|
Line 1243 sub printDiffSelect($) { |
|
sub printLogSortSelect($) { |
sub printLogSortSelect($) { |
my ($use_java_script) = @_; |
my ($use_java_script) = @_; |
|
|
print '<select name="logsort"'; |
print '<select id="logsort" name="logsort"'; |
print ' onchange="this.form.submit()"' if $use_java_script; |
print ' onchange="this.form.submit()"' if $use_java_script; |
print ">\n"; |
print ">\n"; |
|
|
Line 1236 sub findLastModifiedSubdirs(@) { |
|
Line 1279 sub findLastModifiedSubdirs(@) { |
|
$filename = "$dirname/$filename"; |
$filename = "$dirname/$filename"; |
my ($file) = "$fullname/$filename"; |
my ($file) = "$fullname/$filename"; |
next if ($filename !~ /,v$/ || !-f $file); |
next if ($filename !~ /,v$/ || !-f $file); |
|
|
|
# Skip forbidden files. |
|
(my $f = $file) =~ s/,v$//; |
|
next if forbidden_file($f); |
|
|
$filename =~ s/,v$//; |
$filename =~ s/,v$//; |
my $modtime = -M $file; |
my $modtime = -M $file; |
|
|
Line 1572 sub doAnnotate($$) { |
|
Line 1620 sub doAnnotate($$) { |
|
$ENV{QUERY_STRING}); |
$ENV{QUERY_STRING}); |
} |
} |
|
|
if (&forbidden_file($fullname)) { |
|
fatal("403 Forbidden", |
|
'Access forbidden. This file is mentioned in @ForbiddenFiles'); |
|
return; |
|
} |
|
|
|
($pathname = $where) =~ s/(Attic\/)?[^\/]*$//; |
($pathname = $where) =~ s/(Attic\/)?[^\/]*$//; |
($filename = $where) =~ s/^.*\///; |
($filename = $where) =~ s/^.*\///; |
|
|
Line 1762 sub doCheckout($$) { |
|
Line 1804 sub doCheckout($$) { |
|
$ENV{QUERY_STRING}); |
$ENV{QUERY_STRING}); |
} |
} |
|
|
if (&forbidden_file($fullname)) { |
|
fatal("403 Forbidden", |
|
'Access forbidden. This file is mentioned in @ForbiddenFiles'); |
|
return; |
|
} |
|
|
|
# get mimetype |
# get mimetype |
if (defined($input{"content-type"}) |
if (defined($input{"content-type"}) |
&& ($input{"content-type"} =~ /\S\/\S/)) |
&& ($input{"content-type"} =~ /\S\/\S/)) |
Line 2763 sub printLog($;$) { |
|
Line 2799 sub printLog($;$) { |
|
printDiffLinks($input{'r1'}, $url); |
printDiffLinks($input{'r1'}, $url); |
} |
} |
|
|
print '<br>' if $diff; |
|
} |
} |
print "\n</p>\n<pre>\n"; |
print "\n</p>\n<pre>\n"; |
print &htmlify($log{$_}, $allow_log_extra); |
print &htmlify($log{$_}, $allow_log_extra); |
|
|
|| $input{$_} ne $DEFAULTVALUE{$_}) && $input{$_} ne "")); |
|| $input{$_} ne $DEFAULTVALUE{$_}) && $input{$_} ne "")); |
} |
} |
print "<table style=\"border: none\">\n<tr>\n"; |
print "<table style=\"border: none\">\n<tr>\n"; |
print "<td align=\"right\">Diffs between \n"; |
print "<td align=\"right\">"; |
print "<select name=\"r1\">\n"; |
print "<label for=\"r1\" accesskey=\"1\">Diffs between </label>\n"; |
|
print "<select id=\"r1\" name=\"r1\">\n"; |
print "<option value=\"text\" selected>Use Text Field</option>\n"; |
print "<option value=\"text\" selected>Use Text Field</option>\n"; |
print $sel; |
print $sel; |
print "</select>\n"; |
print "</select>\n"; |
$diffrev = $revdisplayorder[$#revdisplayorder]; |
$diffrev = $revdisplayorder[$#revdisplayorder]; |
$diffrev = $input{"r1"} if (defined($input{"r1"})); |
$diffrev = $input{"r1"} if (defined($input{"r1"})); |
print |
print |
"<input type=\"text\" size=\"$inputTextSize\" name=\"tr1\" value=\"$diffrev\" onchange=\"document.diff_select.r1.selectedIndex=0\"></td>\n"; |
"<input type=\"text\" size=\"$inputTextSize\" name=\"tr1\" value=\"$diffrev\" onchange=\"this.form.r1.selectedIndex=0\"></td>\n"; |
print "<td><br></td>\n</tr>\n"; |
print "<td><br></td>\n</tr>\n"; |
print "<tr>\n<td align=\"right\">and \n"; |
print "<tr>\n<td align=\"right\">"; |
print "<select name=\"r2\">\n"; |
print "<label for=\"r2\" accesskey=\"2\">and </label>\n"; |
|
print "<select id=\"r2\" name=\"r2\">\n"; |
print "<option value=\"text\" selected>Use Text Field</option>\n"; |
print "<option value=\"text\" selected>Use Text Field</option>\n"; |
print $sel; |
print $sel; |
print "</select>\n"; |
print "</select>\n"; |
$diffrev = $revdisplayorder[0]; |
$diffrev = $revdisplayorder[0]; |
$diffrev = $input{"r2"} if (defined($input{"r2"})); |
$diffrev = $input{"r2"} if (defined($input{"r2"})); |
print |
print |
"<input type=\"text\" size=\"$inputTextSize\" name=\"tr2\" value=\"$diffrev\" onchange=\"document.diff_select.r2.selectedIndex=0\"></td>\n"; |
"<input type=\"text\" size=\"$inputTextSize\" name=\"tr2\" value=\"$diffrev\" onchange=\"this.form.r2.selectedIndex=0\"></td>\n"; |
print "<td><input type=\"submit\" value=\" Get Diffs \"></td>\n"; |
print "<td><input type=\"submit\" value=\" Get Diffs \" accesskey=\"G\"></td>\n"; |
print "</tr>\n</table>\n"; |
print "</tr>\n</table>\n"; |
print "</form>\n"; |
print "</form>\n"; |
print "<hr noshade>\n"; |
print "<hr noshade>\n"; |
print "<form method=\"get\" action=\"$scriptwhere\">\n"; |
print "<form method=\"get\" action=\"$scriptwhere\">\n"; |
print "<table style=\"border: none\">\n"; |
print "<table style=\"border: none\">\n"; |
print "<tr>\n<td align=\"right\">Preferred Diff type:</td>\n"; |
print "<tr>\n<td align=\"right\">"; |
|
print "<label for=\"f\" accesskey=\"D\">Preferred Diff type:"; |
|
print "</label></td>\n"; |
print "<td>"; |
print "<td>"; |
printDiffSelect($use_java_script); |
printDiffSelect($use_java_script); |
print "</td>\n<td></td>\n</tr>\n"; |
print "</td>\n<td></td>\n</tr>\n"; |
|
|
if (@branchnames) { |
if (@branchnames) { |
print "<tr>\n<td align=\"right\">View only Branch:</td>\n"; |
print "<tr>\n<td align=\"right\">"; |
|
print "<label for=\"only_with_tag\" accesskey=\"B\">"; |
|
print "View only Branch:</label></td>\n"; |
print "<td>"; |
print "<td>"; |
print "<a name=\"branch\"></a>\n"; |
print "<a name=\"branch\"></a>\n"; |
print "<select name=\"only_with_tag\""; |
print "<select id=\"only_with_tag\" name=\"only_with_tag\""; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print ">\n"; |
print ">\n"; |
print "<option value=\"\""; |
print "<option value=\"\""; |
|
|
} |
} |
print "<tr>\n<td align=\"right\">"; |
print "<tr>\n<td align=\"right\">"; |
print "<a name=\"logsort\"></a>\n"; |
print "<a name=\"logsort\"></a>\n"; |
print "Sort log by:</td>\n"; |
print "<label for=\"logsort\" accesskey=\"L\">Sort log by:"; |
print "<td>"; |
print "</label></td>\n<td>"; |
printLogSortSelect($use_java_script); |
printLogSortSelect($use_java_script); |
print "</td>\n"; |
print "</td>\n"; |
print "<td><input type=\"submit\" value=\" Set \"></td>\n"; |
print "<td><input type=\"submit\" value=\" Set \" accesskey=\"S\"></td>\n"; |
print "</tr>\n</table>\n"; |
print "</tr>\n</table>\n"; |
print "</form>\n"; |
print "</form>\n"; |
html_footer(); |
html_footer(); |
Line 3146 sub navigateHeader($$$$$) { |
|
Line 3187 sub navigateHeader($$$$$) { |
|
$HTML_DOCTYPE |
$HTML_DOCTYPE |
<html> |
<html> |
<head> |
<head> |
<meta name="robots" content="nofollow"> |
|
<meta http-equiv="Content-Script-Type" content="application/x-javascript"> |
|
<meta http-equiv="Content-Style-Type" content="text/css"> |
|
<!-- FreeBSD-cvsweb $cvsweb_revision --> |
|
<title>$path$filename - $title - $rev</title>$css |
<title>$path$filename - $title - $rev</title>$css |
</head> |
$HTML_META</head> |
$body_tag_for_src |
$body_tag_for_src |
<table width="100%" style="border: none; background-color: $navigationHeaderColor" cellspacing="0" cellpadding="1"> |
<table width="100%" style="border: none; background-color: $navigationHeaderColor" cellspacing="0" cellpadding="1"> |
<tr valign="bottom"><td> |
<tr valign="bottom"><td> |
Line 3281 sub chooseCVSRoot() { |
|
Line 3318 sub chooseCVSRoot() { |
|
# isn't gray and the form elements are not placed |
# isn't gray and the form elements are not placed |
# within a table ... |
# within a table ... |
print "<table style=\"border: none\">\n<tr>\n"; |
print "<table style=\"border: none\">\n<tr>\n"; |
print "<td>CVS Root:</td>\n"; |
print "<td><label for=\"cvsroot\" accesskey=\"C\">CVS Root:</label></td>\n"; |
print "<td>\n<select name=\"cvsroot\""; |
print "<td>\n<select id=\"cvsroot\" name=\"cvsroot\""; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print " onchange=\"this.form.submit()\"" if $use_java_script; |
print ">\n"; |
print ">\n"; |
|
|
Line 3301 sub chooseCVSRoot() { |
|
Line 3338 sub chooseCVSRoot() { |
|
print "CVS Root: <b>[$cvstree]</b>"; |
print "CVS Root: <b>[$cvstree]</b>"; |
} |
} |
|
|
print " Module path or alias:\n"; |
print " <label for=\"mpath\" accesskey=\"M\">Module path or alias:"; |
print "<input type=\"text\" name=\"path\" value=\"\" size=\"15\">\n"; |
print "</label>\n"; |
print "<input type=\"submit\" value=\"Go\">"; |
print "<input type=\"text\" id=\"mpath\" name=\"path\" value=\"\" size=\"15\">\n"; |
|
print "<input type=\"submit\" value=\"Go\" accesskey=\"O\">"; |
|
|
if (2 <= @CVSROOT) { |
if (2 <= @CVSROOT) { |
print "</td>\n</tr>\n</table>"; |
print "</td>\n</tr>\n</table>"; |
Line 3314 sub chooseCVSRoot() { |
|
Line 3352 sub chooseCVSRoot() { |
|
} |
} |
|
|
sub chooseMirror() { |
sub chooseMirror() { |
my ($mirror, $moremirrors); |
|
$moremirrors = 0; |
|
|
|
# This code comes from the original BSD-cvsweb |
# This code comes from the original BSD-cvsweb |
# and may not be useful for your site; If you don't |
# and may not be useful for your site; If you don't |
# set %MIRRORS this won't show up, anyway |
# set %MIRRORS this won't show up, anyway. |
# |
scalar(%MIRRORS) or return; |
# Should perhaps exlude the current site somehow.. |
|
if (keys %MIRRORS) { |
|
print "\nThis cvsweb is mirrored in:\n"; |
|
|
|
foreach $mirror (keys %MIRRORS) { |
# Should perhaps exclude the current site somehow... |
print ", " if ($moremirrors); |
print "\n<p>\nThis CVSweb is mirrored in\n"; |
print &link(htmlquote($mirror), $MIRRORS{$mirror}); |
|
$moremirrors = 1; |
my @tmp = map(&link(htmlquote($_), $MIRRORS{$_}), |
} |
sort keys %MIRRORS); |
print "<p>\n"; |
my $tmp = pop(@tmp); |
|
|
|
if (scalar(@tmp)) { |
|
print join(', ', @tmp), ' and '; |
} |
} |
|
|
|
print "$tmp.\n</p>\n"; |
} |
} |
|
|
sub fileSortCmp() { |
sub fileSortCmp() { |
Line 3359 sub fileSortCmp() { |
|
Line 3397 sub fileSortCmp() { |
|
|
|
if ($comp == 0) { |
if ($comp == 0) { |
|
|
# Directories first, then sorted on name if no other sort critera |
# Directories first, then files under version control, |
# available. |
# then other, "rogue" files. |
my $ad = ((-d "$fullname/$a") ? "D" : "F"); |
# Sort by filename if no other criteria available. |
my $bd = ((-d "$fullname/$b") ? "D" : "F"); |
|
|
my $ad = ((-d "$fullname/$a") ? 'D' |
|
: (defined($fileinfo{$af}) ? 'F' : 'R')); |
|
my $bd = ((-d "$fullname/$b") ? 'D' |
|
: (defined($fileinfo{$bf}) ? 'F' : 'R')); |
($c = $a) =~ s|.*/||; |
($c = $a) =~ s|.*/||; |
($d = $b) =~ s|.*/||; |
($d = $b) =~ s|.*/||; |
$comp = ("$ad$c" cmp "$bd$d"); |
$comp = ("$ad$c" cmp "$bd$d"); |
Line 3422 sub download_link($$$;$) { |
|
Line 3464 sub download_link($$$;$) { |
|
# currently, the best way is to comment out the size parameters |
# currently, the best way is to comment out the size parameters |
# ($extern_window...) in cvsweb.conf. |
# ($extern_window...) in cvsweb.conf. |
if ($use_java_script) { |
if ($use_java_script) { |
my @attr = qw(resizeable scrollbars); |
my @attr = qw(resizable scrollbars); |
|
|
push @attr, qw(status toolbar) |
push @attr, qw(status toolbar) |
if (defined($mimetype) && $mimetype eq "text/html"); |
if (defined($mimetype) && $mimetype eq "text/html"); |
Line 3439 sub download_link($$$;$) { |
|
Line 3481 sub download_link($$$;$) { |
|
# the same window *twice*. |
# the same window *twice*. |
printf |
printf |
q` onclick="window.open('%s','cvs_checkout','%s');return false"`, |
q` onclick="window.open('%s','cvs_checkout','%s');return false"`, |
hrefquote($fullurl), join (',', @attr); |
hrefquote("$fullurl$barequery"), join (',', @attr); |
} |
} |
} |
} |
print "><b>$textlink</b></a>"; |
print "><b>$textlink</b></a>"; |
Line 3590 sub http_header(;$) { |
|
Line 3632 sub http_header(;$) { |
|
sub html_header($) { |
sub html_header($) { |
my ($title) = @_; |
my ($title) = @_; |
http_header("text/html"); |
http_header("text/html"); |
|
|
|
(my $header = &cgi_style::html_header) =~ s,\A.*</head>\n,,s; |
|
|
print <<EOH; |
print <<EOH; |
$HTML_DOCTYPE |
$HTML_DOCTYPE |
<html> |
<html> |
<head> |
<head> |
<meta name="robots" content="nofollow"> |
|
<meta http-equiv="Content-Script-Type" content="application/x-javascript"> |
|
<meta http-equiv="Content-Style-Type" content="text/css"> |
|
<title>$title</title> |
<title>$title</title> |
<!-- FreeBSD-cvsweb $cvsweb_revision --> |
$HTML_META</head> |
</head> |
$header |
$body_tag |
|
$logo <h1 align="center">$title</h1> |
|
EOH |
EOH |
} |
} |
|
|
sub html_footer() { |
sub html_footer() { |
print "<hr noshade>\n<address>$address</address>\n</body>\n</html>\n"; |
return &cgi_style::html_footer; |
} |
} |
|
|
sub link_tags($) { |
sub link_tags($) { |