| version 1.9, 2002/11/22 16:50:49 |
version 1.10, 2002/11/22 18:01:45 |
| Line 358 foreach (@unsafevars) { |
|
| Line 358 foreach (@unsafevars) { |
|
| |
|
| # Colons are needed in diffs between tags. |
# Colons are needed in diffs between tags. |
| if (defined($input{$_}) && $input{$_} =~ /[^\w\-.:]/) { |
if (defined($input{$_}) && $input{$_} =~ /[^\w\-.:]/) { |
| fatal("500 Internal Error", 'Malformed query (%s=%s)', $_, $input{$_}); |
fatal("500 Internal Error", _('Malformed query (%s=%s)'), $_, $input{$_}); |
| } |
} |
| } |
} |
| |
|
| if (defined($input{"content-type"})) { |
if (defined($input{"content-type"})) { |
| fatal("500 Internal Error", "Unsupported content-type") |
fatal("500 Internal Error", _("Unsupported content-type")) |
| if ($input{"content-type"} !~ /^[-0-9A-Za-z]+\/[-0-9A-Za-z]+$/); |
if ($input{"content-type"} !~ /^[-0-9A-Za-z]+\/[-0-9A-Za-z]+$/); |
| } |
} |
| |
|
| Line 459 $logsort = $input{'logsort'}; |
|
| Line 459 $logsort = $input{'logsort'}; |
|
| ## Default CVS-Tree |
## Default CVS-Tree |
| if (!defined($CVSROOT{$cvstreedefault})) { |
if (!defined($CVSROOT{$cvstreedefault})) { |
| fatal("500 Internal Error", |
fatal("500 Internal Error", |
| '<code>$cvstreedefault</code> points to a repository (%s) not defined in <code>%%CVSROOT</code> (edit your configuration file %s)', |
_('<code>$cvstreedefault</code> points to a repository (%s) not defined in <code>%%CVSROOT</code> (edit your configuration file %s)'), |
| $cvstreedefault, |
$cvstreedefault, |
| $config); |
$config); |
| } |
} |
| Line 492 my $config_cvstree = "$config-$cvstree"; |
|
| Line 492 my $config_cvstree = "$config-$cvstree"; |
|
| if (-f $config_cvstree) { |
if (-f $config_cvstree) { |
| do "$config_cvstree" |
do "$config_cvstree" |
| or fatal("500 Internal Error", |
or fatal("500 Internal Error", |
| 'Error in loading configuration file: %s<br><br>%s<br>', |
_('Error in loading configuration file: %s<br><br>%s<br>'), |
| $config_cvstree, $@); |
$config_cvstree, $@); |
| } |
} |
| undef $config_cvstree; |
undef $config_cvstree; |
|
|
| |
|
| if (!-d $cvsroot) { |
if (!-d $cvsroot) { |
| fatal("500 Internal Error", |
fatal("500 Internal Error", |
| '$CVSROOT not found!<p>The server on which the CVS tree lives is probably down. Please try again in a few minutes.'); |
_('$CVSROOT not found!<p>The server on which the CVS tree lives is probably down. Please try again in a few minutes.')); |
| } |
} |
| |
|
| # |
# |
| Line 542 if (!-d $cvsroot) { |
|
| Line 542 if (!-d $cvsroot) { |
|
| $where =~ m:([^/]*):; |
$where =~ m:([^/]*):; |
| $module = $1; |
$module = $1; |
| if ($module && &forbidden_module($module)) { |
if ($module && &forbidden_module($module)) { |
| fatal("403 Forbidden", 'Access to %s forbidden.', $where); |
fatal("403 Forbidden", _('Access to %s forbidden.'), $where); |
| } |
} |
| |
|
| # |
# |
| # Handle tarball downloads before any headers are output. |
# Handle tarball downloads before any headers are output. |
| # |
# |
| if ($input{tarball}) { |
if ($input{tarball}) { |
| fatal('403 Forbidden', 'Downloading tarballs is prohibited.') |
fatal('403 Forbidden', _('Downloading tarballs is prohibited.')) |
| unless $allow_tar; |
unless $allow_tar; |
| my ($module) = ($where =~ m,^/?(.*),); # untaint |
my ($module) = ($where =~ m,^/?(.*),); # untaint |
| $module =~ s,/([^/]*)$,,; |
$module =~ s,/([^/]*)$,,; |
| Line 558 if ($input{tarball}) { |
|
| Line 558 if ($input{tarball}) { |
|
| |
|
| if ($basedir eq '' || $module eq '') { |
if ($basedir eq '' || $module eq '') { |
| fatal('500 Internal Error', |
fatal('500 Internal Error', |
| 'You cannot download the top level directory.'); |
_('You cannot download the top level directory.')); |
| } |
} |
| |
|
| my $tmpexportdir = "$tmpdir/.cvsweb.$$." . int(time); |
my $tmpexportdir = "$tmpdir/.cvsweb.$$." . int(time); |
| |
|
| mkdir($tmpexportdir, 0700) or |
mkdir($tmpexportdir, 0700) or |
| fatal('500 Internal Error', 'Unable to make temporary directory: %s', $!); |
fatal('500 Internal Error', _('Unable to make temporary directory: %s'), $!); |
| |
|
| my @fatal; |
my @fatal; |
| |
|
| Line 579 if ($input{tarball}) { |
|
| Line 579 if ($input{tarball}) { |
|
| @cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', |
@cvs_options, '-Qd', $cvsroot, 'export', '-r', $tag, '-d', |
| "$tmpexportdir/$basedir", $module)) |
"$tmpexportdir/$basedir", $module)) |
| { |
{ |
| @fatal = ('500 Internal Error', 'cvs co failure: %s: %s', $!, $module); |
@fatal = ('500 Internal Error', _('cvs co failure: %s: %s'), $!, $module); |
| } else { |
} else { |
| $| = 1; # Essential to get the buffering right. |
$| = 1; # Essential to get the buffering right. |
| |
|
| Line 588 if ($input{tarball}) { |
|
| Line 588 if ($input{tarball}) { |
|
| |
|
| system("$CMD{tar} @tar_options -cf - -C $tmpexportdir $basedir | $CMD{gzip} @gzip_options -c") |
system("$CMD{tar} @tar_options -cf - -C $tmpexportdir $basedir | $CMD{gzip} @gzip_options -c") |
| and @fatal = |
and @fatal = |
| ('500 Internal Error', 'tar zc failure: %s: %s', $!, $basedir); |
('500 Internal Error', _('tar zc failure: %s: %s'), $!, $basedir); |
| } elsif ($ext eq '.zip' && $CMD{zip}) { |
} elsif ($ext eq '.zip' && $CMD{zip}) { |
| print "Content-Type: application/zip\r\n\r\n"; |
print "Content-Type: application/zip\r\n\r\n"; |
| |
|
| system("cd $tmpexportdir && $CMD{zip} @zip_options -r - $basedir") |
system("cd $tmpexportdir && $CMD{zip} @zip_options -r - $basedir") |
| and @fatal = |
and @fatal = |
| ('500 Internal Error', 'zip failure: %s: %s', $!, $basedir); |
('500 Internal Error', _('zip failure: %s: %s'), $!, $basedir); |
| } else { |
} else { |
| @fatal = ('500 Internal Error', 'unsupported file type'); |
@fatal = ('500 Internal Error', _('unsupported file type')); |
| } |
} |
| } |
} |
| |
|
| Line 644 if (-d $fullname) { |
|
| Line 644 if (-d $fullname) { |
|
| chooseMirror(); |
chooseMirror(); |
| chooseCVSRoot(); |
chooseCVSRoot(); |
| } else { |
} else { |
| print "<p>Current directory: <b>", &clickablePath($where, 0), "</b></p>\n"; |
print "<p>", _("Current directory: "), "<b>", &clickablePath($where, 0), "</b></p>\n"; |
| |
|
| print "<p>Current tag: <b>", $input{only_with_tag}, "</b></p>\n" |
print "<p>", _("Current tag: "), "<b>", $input{only_with_tag}, "</b></p>\n" |
| if $input{only_with_tag}; |
if $input{only_with_tag}; |
| |
|
| } |
} |
| Line 661 if (-d $fullname) { |
|
| Line 661 if (-d $fullname) { |
|
| $byfile ? '-sorted' : ''; |
$byfile ? '-sorted' : ''; |
| |
|
| if ($byfile) { |
if ($byfile) { |
| print 'File'; |
print _('File'); |
| } else { |
} else { |
| print &link('File', |
print &link(_('File'), |
| sprintf('./%s#dirlist', toggleQuery('sortby', 'file'))); |
sprintf('./%s#dirlist', toggleQuery('sortby', 'file'))); |
| } |
} |
| print "</th>\n"; |
print "</th>\n"; |
| Line 675 if (-d $fullname) { |
|
| Line 675 if (-d $fullname) { |
|
| printf '<th class="dir-header%s">', $byrev ? '-sorted' : ''; |
printf '<th class="dir-header%s">', $byrev ? '-sorted' : ''; |
| |
|
| if ($byrev) { |
if ($byrev) { |
| print 'Rev.'; |
print _('Rev.'); |
| } else { |
} else { |
| print &link('Rev.', |
print &link(_('Rev.'), |
| sprintf('./%s#dirlist', toggleQuery('sortby', 'rev'))); |
sprintf('./%s#dirlist', toggleQuery('sortby', 'rev'))); |
| } |
} |
| print "</th>\n"; |
print "</th>\n"; |
| Line 685 if (-d $fullname) { |
|
| Line 685 if (-d $fullname) { |
|
| printf '<th class="dir-header%s">', $bydate ? '-sorted' : ''; |
printf '<th class="dir-header%s">', $bydate ? '-sorted' : ''; |
| |
|
| if ($bydate) { |
if ($bydate) { |
| print 'Age'; |
print _('Age'); |
| } else { |
} else { |
| print &link('Age', |
print &link(_('Age'), |
| sprintf('./%s#dirlist', toggleQuery('sortby', 'date'))); |
sprintf('./%s#dirlist', toggleQuery('sortby', 'date'))); |
| } |
} |
| print "</th>\n"; |
print "</th>\n"; |
| Line 697 if (-d $fullname) { |
|
| Line 697 if (-d $fullname) { |
|
| printf '<th class="dir-header%s">', $byauthor ? '-sorted' : ''; |
printf '<th class="dir-header%s">', $byauthor ? '-sorted' : ''; |
| |
|
| if ($byauthor) { |
if ($byauthor) { |
| print 'Author'; |
print _('Author'); |
| } else { |
} else { |
| print |
print |
| &link('Author', |
&link(_('Author'), |
| sprintf('./%s#dirlist', toggleQuery('sortby', 'author'))); |
sprintf('./%s#dirlist', toggleQuery('sortby', 'author'))); |
| } |
} |
| print "</th>\n"; |
print "</th>\n"; |
| Line 709 if (-d $fullname) { |
|
| Line 709 if (-d $fullname) { |
|
| printf '<th class="dir-header%s">', $bylog ? '-sorted' : ''; |
printf '<th class="dir-header%s">', $bylog ? '-sorted' : ''; |
| |
|
| if ($bylog) { |
if ($bylog) { |
| print 'Last log entry'; |
print _('Last log entry'); |
| } else { |
} else { |
| print &link('Last log entry', |
print &link(_('Last log entry'), |
| sprintf('./%s#dirlist', toggleQuery('sortby', 'log'))); |
sprintf('./%s#dirlist', toggleQuery('sortby', 'log'))); |
| } |
} |
| print "</th>\n"; |
print "</th>\n"; |
| Line 742 if (-d $fullname) { |
|
| Line 742 if (-d $fullname) { |
|
| my $hideAtticToggleLink = |
my $hideAtticToggleLink = |
| $input{'hideattic'} |
$input{'hideattic'} |
| ? '' |
? '' |
| : &link('[Hide]', sprintf('./%s#dirlist', &toggleQuery('hideattic'))); |
: &link(_('[Hide]'), sprintf('./%s#dirlist', &toggleQuery('hideattic'))); |
| |
|
| # Sort without the Attic/ pathname. |
# Sort without the Attic/ pathname. |
| # place directories first |
# place directories first |
| Line 770 if (-d $fullname) { |
|
| Line 770 if (-d $fullname) { |
|
| next if ($input{'hidenonreadable'} && !(-r "$fullname/$file")); |
next if ($input{'hidenonreadable'} && !(-r "$fullname/$file")); |
| |
|
| if ($file =~ s|^Attic/||) { |
if ($file =~ s|^Attic/||) { |
| $attic = ' (in the Attic) ' . $hideAtticToggleLink; |
$attic = _(' (in the Attic) ') . $hideAtticToggleLink; |
| } else { |
} else { |
| $attic = ''; |
$attic = ''; |
| } |
} |
| Line 780 if (-d $fullname) { |
|
| Line 780 if (-d $fullname) { |
|
| my ($rev, $date, $log, $author, $filename) = @{$fileinfo{$file}} |
my ($rev, $date, $log, $author, $filename) = @{$fileinfo{$file}} |
| if (defined($fileinfo{$file})); |
if (defined($fileinfo{$file})); |
| printf "<tr class=\"dir-row-%s\">\n<td colspan=\"2\">", |
printf "<tr class=\"dir-row-%s\">\n<td colspan=\"2\">", |
| ($dirrow % 2) ? 'even' : 'odd'; |
($dirrow % 2) ? _('even') : _('odd'); |
| |
|
| if ($file eq '..') { |
if ($file eq '..') { |
| $url = "../$query"; |
$url = "../$query"; |
| Line 789 if (-d $fullname) { |
|
| Line 789 if (-d $fullname) { |
|
| } else { |
} else { |
| print &link($backicon, $url); |
print &link($backicon, $url); |
| } |
} |
| print ' ', &link("Parent Directory", $url); |
print ' ', &link(_("Parent Directory"), $url); |
| } else { |
} else { |
| $url = './' . urlencode($file) . "/$query"; |
$url = './' . urlencode($file) . "/$query"; |
| print '<a name="', hrefquote($file), '"></a>'; |
print '<a name="', hrefquote($file), '"></a>'; |
| Line 803 if (-d $fullname) { |
|
| Line 803 if (-d $fullname) { |
|
| |
|
| if ($file eq "Attic") { |
if ($file eq "Attic") { |
| print " "; |
print " "; |
| print &link('[Don\'t hide]', |
print &link(_('[Don\'t hide]'), |
| sprintf('./%s#dirlist', &toggleQuery('hideattic'))); |
sprintf('./%s#dirlist', &toggleQuery('hideattic'))); |
| } |
} |
| } |
} |
| Line 907 if (-d $fullname) { |
|
| Line 907 if (-d $fullname) { |
|
| |
|
| if ($filesexists && !$filesfound) { |
if ($filesexists && !$filesfound) { |
| print |
print |
| "<p><b>NOTE:</b> There are $filesexists files, but none matches the current tag ($input{only_with_tag}).</p>\n"; |
"<p><b>", _("NOTE:"), "</b> ", |
| |
sprintf( _("There are %s files, but none matches the current tag (%s)."), |
| |
$filesexists, |
| |
$input{only_with_tag}), |
| |
"</p>\n"; |
| } |
} |
| |
|
| if ($input{only_with_tag} && (!%tags || !$tags{$input{only_with_tag}})) { |
if ($input{only_with_tag} && (!%tags || !$tags{$input{only_with_tag}})) { |
| Line 933 if (-d $fullname) { |
|
| Line 937 if (-d $fullname) { |
|
| && $var ne 'only_with_tag'); |
&& $var ne 'only_with_tag'); |
| } |
} |
| print "<p><label for=\"only_with_tag\" accesskey=\"T\">"; |
print "<p><label for=\"only_with_tag\" accesskey=\"T\">"; |
| print "Show only files with tag:</label>\n"; |
print _("Show only files with tag:"), "</label>\n"; |
| print "<select id=\"only_with_tag\" 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 ">"; |
print ">"; |
| print "<option value=\"\">All tags / default branch</option>\n"; |
print "<option value=\"\">", _("All tags / default branch"), "</option>\n"; |
| |
|
| foreach my $tag (reverse sort { lc $a cmp lc $b } keys %tags) { |
foreach my $tag (reverse sort { lc $a cmp lc $b } keys %tags) { |
| my $selected = |
my $selected = |
| Line 948 if (-d $fullname) { |
|
| Line 952 if (-d $fullname) { |
|
| } |
} |
| print "</select>\n"; |
print "</select>\n"; |
| print " <label for=\"path\" accesskey=\"P\">"; |
print " <label for=\"path\" accesskey=\"P\">"; |
| print "Module path or alias:</label>\n"; |
print _("Module path or alias:"), "</label>\n"; |
| printf "<input type=\"text\" id=\"path\" name=\"path\" value=\"%s\" size=\"15\">\n", htmlquote($where); |
printf "<input type=\"text\" id=\"path\" name=\"path\" value=\"%s\" size=\"15\">\n", htmlquote($where); |
| print "<input type=\"submit\" value=\"Go\" accesskey=\"G\"></p>\n"; |
print "<input type=\"submit\" value=\"", _("Go"), "\" accesskey=\"G\"></p>\n"; |
| print "</form>\n"; |
print "</form>\n"; |
| } |
} |
| |
|
| Line 959 if (-d $fullname) { |
|
| Line 963 if (-d $fullname) { |
|
| |
|
| if (defined($basefile) && $basefile ne '') { |
if (defined($basefile) && $basefile ne '') { |
| print "<hr noshade>\n", |
print "<hr noshade>\n", |
| "<div align=\"center\">Download this directory in "; |
"<div align=\"center\">", _("Download this directory in "); |
| |
|
| # Mangle the filename so browsers show a reasonable |
# Mangle the filename so browsers show a reasonable |
| # filename to download. |
# filename to download. |
| print |
print |
| &link("tarball", |
&link(_("tarball"), |
| "./$basefile.tar.gz$query" . ($query ? "&" : "?") . "tarball=1"); |
"./$basefile.tar.gz$query" . ($query ? "&" : "?") . "tarball=1"); |
| if ($CMD{zip}) { |
if ($CMD{zip}) { |
| print " or ", |
print " or ", |
| &link("zip archive", |
&link(_("zip archive"), |
| "./$basefile.zip$query" . ($query ? "&" : "?") . "tarball=1"); |
"./$basefile.zip$query" . ($query ? "&" : "?") . "tarball=1"); |
| } |
} |
| print "</div>\n"; |
print "</div>\n"; |
| Line 987 if (-d $fullname) { |
|
| Line 991 if (-d $fullname) { |
|
| } |
} |
| print "<center>\n<table cellpadding=\"0\" cellspacing=\"0\">"; |
print "<center>\n<table cellpadding=\"0\" cellspacing=\"0\">"; |
| print "\n<tr class=\"dir-header\">\n"; |
print "\n<tr class=\"dir-header\">\n"; |
| print "<th style=\"text-align: center\" colspan=\"2\">Preferences</th>\n</tr>\n"; |
print "<th style=\"text-align: center\" colspan=\"2\">", _("Preferences"), "</th>\n</tr>\n"; |
| print "<tr>\n<td>"; |
print "<tr>\n<td>"; |
| print "<label for=\"sortby\" accesskey=\"F\">Sort files by "; |
print "<label for=\"sortby\" accesskey=\"F\">", _("Sort files by "); |
| print "</label><select id=\"sortby\" name=\"sortby\">\n"; |
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"; |
| print "<option", $byauthor ? " selected" : "", |
print "<option", $byauthor ? " selected" : "", |
| " value=\"author\">Author</option>\n" |
" value=\"author\">", _("Author"), "</option>\n" |
| if ($show_author); |
if ($show_author); |
| print "<option", $byrev ? " selected" : "", |
print "<option", $byrev ? " selected" : "", |
| " value=\"rev\">Revision</option>\n"; |
" value=\"rev\">", _("Revision"), "</option>\n"; |
| 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><label for=\"logsort\" accesskey=\"L\">"; |
print "<td><label for=\"logsort\" accesskey=\"L\">"; |
| print "Sort log by: </label>"; |
print _("Sort log by: "), "</label>"; |
| printLogSortSelect(0); |
printLogSortSelect(0); |
| print "</td>\n</tr>\n"; |
print "</td>\n</tr>\n"; |
| print "<tr>\n<td><label for=\"f\" accesskey=\"D\">"; |
print "<tr>\n<td><label for=\"f\" accesskey=\"D\">"; |
| print "Diff format: </label>"; |
print _("Diff format: "), "</label>"; |
| printDiffSelect(0); |
printDiffSelect(0); |
| print "</td>\n"; |
print "</td>\n"; |
| print "<td><label for=\"hideattic\" accesskey=\"A\">"; |
print "<td><label for=\"hideattic\" accesskey=\"A\">"; |
| print "Show Attic files: </label>"; |
print _("Show Attic files: "), "</label>"; |
| print "<input id=\"hideattic\" name=\"hideattic\" type=\"checkbox\"", |
print "<input id=\"hideattic\" name=\"hideattic\" type=\"checkbox\"", |
| $input{'hideattic'} ? " checked" : "", "></td>\n</tr>\n"; |
$input{'hideattic'} ? " checked" : "", "></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\" accesskey=\"C\">"; |
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 1028 elsif (-f $fullname . ',v') { |
|
| Line 1032 elsif (-f $fullname . ',v') { |
|
| |
|
| if (forbidden_file($fullname)) { |
if (forbidden_file($fullname)) { |
| fatal('403 Forbidden', |
fatal('403 Forbidden', |
| 'Access forbidden. This file is mentioned in @ForbiddenFiles'); |
_('Access forbidden. This file is mentioned in @ForbiddenFiles')); |
| return; |
return; |
| } |
} |
| |
|
| Line 1061 elsif (-f $fullname . ',v') { |
|
| Line 1065 elsif (-f $fullname . ',v') { |
|
| exit; |
exit; |
| } |
} |
| |
|
| print("going to dolog($fullname)\n") if ($verbose); |
print(_("going to dolog"), "($fullname)\n") if ($verbose); |
| &doLog($fullname); |
&doLog($fullname); |
| |
|
| ############################## |
############################## |
| Line 1101 elsif (-f $fullname . ',v') { |
|
| Line 1105 elsif (-f $fullname . ',v') { |
|
| exit; |
exit; |
| } elsif (0 && (my @files = &safeglob($fullname . ",v"))) { |
} elsif (0 && (my @files = &safeglob($fullname . ",v"))) { |
| http_header("text/plain"); |
http_header("text/plain"); |
| print "You matched the following files:\n"; |
print _("You matched the following files:"), "\n"; |
| print join ("\n", @files); |
print join ("\n", @files); |
| |
|
| # Find the tags from each file |
# Find the tags from each file |
| Line 1125 elsif (-f $fullname . ',v') { |
|
| Line 1129 elsif (-f $fullname . ',v') { |
|
| } |
} |
| } |
} |
| } |
} |
| fatal("404 Not Found", '%s: no such file or directory', $where); |
fatal("404 Not Found", _('%s: no such file or directory'), $where); |
| } |
} |
| |
|
| gzipclose(); |
gzipclose(); |
|
|
| print "Status: $errcode\r\n"; |
print "Status: $errcode\r\n"; |
| } |
} |
| html_header('Error'); |
html_header('Error'); |
| print "<p>Error: ", sprintf($format, map(htmlquote($_), @args)), "</p>\n"; |
print "<p>", _("Error: "), sprintf($format, map(htmlquote($_), @args)), "</p>\n"; |
| html_footer(); |
html_footer(); |
| exit(1); |
exit(1); |
| } |
} |
| Line 1394 sub redirect($) |
|
| Line 1398 sub redirect($) |
|
| print "Location: $url\r\n"; |
print "Location: $url\r\n"; |
| } |
} |
| html_header('Moved'); |
html_header('Moved'); |
| print "<p>This document is located ", &link('here', $url), "</p>\n"; |
print "<p>", _("This document is located "), &link('here', $url), "</p>\n"; |
| html_footer(); |
html_footer(); |
| exit(1); |
exit(1); |
| } |
} |
| Line 1536 sub doAnnotate($) |
|
| Line 1540 sub doAnnotate($) |
|
| # make sure the revisions are wellformed, for security |
# make sure the revisions are wellformed, for security |
| # reasons .. |
# reasons .. |
| if ($rev =~ /[^\w.]/) { |
if ($rev =~ /[^\w.]/) { |
| fatal("404 Not Found", 'Malformed query "%s"', $ENV{QUERY_STRING}); |
fatal("404 Not Found", _('Malformed query "%s"'), $ENV{QUERY_STRING}); |
| } |
} |
| |
|
| ($pathname = $where) =~ s/(Attic\/)?[^\/]*$//; |
($pathname = $where) =~ s/(Attic\/)?[^\/]*$//; |
| Line 1562 sub doAnnotate($) |
|
| Line 1566 sub doAnnotate($) |
|
| # the cvsserver in a similiar way one day (..after rewrite) |
# the cvsserver in a similiar way one day (..after rewrite) |
| $pid = open2($reader, $writer, $CMD{cvs}, @annotate_options, 'server') |
$pid = open2($reader, $writer, $CMD{cvs}, @annotate_options, 'server') |
| or fatal("500 Internal Error", |
or fatal("500 Internal Error", |
| 'Fatal Error - unable to open cvs for annotation'); |
_('Fatal Error - unable to open cvs for annotation')); |
| |
|
| # Re-tie STDIN if we fiddled around with it earlier, just to be sure. |
# Re-tie STDIN if we fiddled around with it earlier, just to be sure. |
| tie(*STDIN, ref($old_stdin), $old_stdin) if ($old_stdin && !tied(*STDIN)); |
tie(*STDIN, ref($old_stdin), $old_stdin) if ($old_stdin && !tied(*STDIN)); |
| Line 1619 sub doAnnotate($) |
|
| Line 1623 sub doAnnotate($) |
|
| # OK, we've sent our command to the server. Thing to do is to |
# OK, we've sent our command to the server. Thing to do is to |
| # close the writer side and get all the responses. If "cvs server" |
# close the writer side and get all the responses. If "cvs server" |
| # were nicer about buffering, then we could just leave it open, I think. |
# were nicer about buffering, then we could just leave it open, I think. |
| close($writer) or die "cannot close: $!"; |
close($writer) or die _("cannot close:"), " $!"; |
| |
|
| navigateHeader($scriptwhere, $pathname, $filename, $rev, 'annotate'); |
navigateHeader($scriptwhere, $pathname, $filename, $rev, 'annotate'); |
| |
|
| print '<h3 style="text-align: center">Annotation of ', |
print '<h3 style="text-align: center">', _('Annotation of '), |
| htmlquote("$pathname$filename"), ", revision $rev</h3>\n"; |
htmlquote("$pathname$filename"), ", ", _("revision"), " $rev</h3>\n"; |
| |
|
| # Ready to get the responses from the server. |
# Ready to get the responses from the server. |
| # For example: |
# For example: |
| Line 1698 sub doAnnotate($) |
|
| Line 1702 sub doAnnotate($) |
|
| # CVS command line client. But for simplicity, we don't. |
# CVS command line client. But for simplicity, we don't. |
| } elsif ($words[0] eq "error") { |
} elsif ($words[0] eq "error") { |
| fatal("500 Internal Error", |
fatal("500 Internal Error", |
| 'Error occured during annotate: <b>%s</b>', $_); |
_('Error occured during annotate: <b>%s</b>'), $_); |
| } |
} |
| } |
} |
| |
|
| Line 1709 sub doAnnotate($) |
|
| Line 1713 sub doAnnotate($) |
|
| } |
} |
| html_footer(); |
html_footer(); |
| |
|
| close($reader) or warn "cannot close: $!"; |
close($reader) or warn _("cannot close:"), " $!"; |
| wait; |
wait; |
| } |
} |
| |
|
| Line 1729 sub doCheckout($$) |
|
| Line 1733 sub doCheckout($$) |
|
| # make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
| # reasons .. |
# reasons .. |
| if (defined($rev) && $rev =~ /[^\w.]/) { |
if (defined($rev) && $rev =~ /[^\w.]/) { |
| fatal("404 Not Found", 'Malformed query "%s"', $ENV{QUERY_STRING}); |
fatal("404 Not Found", _('Malformed query "%s"'), $ENV{QUERY_STRING}); |
| } |
} |
| |
|
| # get mimetype |
# get mimetype |
| Line 1774 sub doCheckout($$) |
|
| Line 1778 sub doCheckout($$) |
|
| } |
} |
| |
|
| if (eof($fh)) { |
if (eof($fh)) { |
| fatal("404 Not Found", '%s is not (any longer) pertinent', $where); |
fatal("404 Not Found", _('%s is not (any longer) pertinent'), $where); |
| } |
} |
| |
|
| #=================================================================== |
#=================================================================== |
| Line 1799 sub doCheckout($$) |
|
| Line 1803 sub doCheckout($$) |
|
| |
|
| if ($filename ne $where) { |
if ($filename ne $where) { |
| fatal("500 Internal Error", |
fatal("500 Internal Error", |
| 'Unexpected output from cvs co: %s', $cvsheader); |
_('Unexpected output from cvs co: %s'), $cvsheader); |
| } |
} |
| $| = 1; |
$| = 1; |
| |
|