gecko-dev/webtools/bonsai/editcheckin.cgi

116 строки
2.9 KiB
Plaintext
Исходник Обычный вид История

#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
1998-06-17 01:43:24 +04:00
#
1999-11-02 02:33:56 +03:00
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
1998-06-17 01:43:24 +04:00
#
1999-11-02 02:33:56 +03:00
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
1998-06-17 01:43:24 +04:00
#
# The Original Code is the Bonsai CVS tool.
#
# The Initial Developer of the Original Code is Netscape Communications
1999-11-02 02:33:56 +03:00
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
1998-06-17 01:43:24 +04:00
use strict;
# Shut up misguided -w warnings about "used only once". "use vars" just
# doesn't work for me.
sub sillyness {
my $zz;
$zz = $::TreeID;
$zz = $::FORM{'id'};
}
require 'CGI.pl';
1998-06-17 01:43:24 +04:00
&LoadCheckins();
my $form_id = &ExpectCheckinId($::FORM{'id'});
my $info = eval("\\%" . $form_id);
1998-06-17 01:43:24 +04:00
print "Content-type: text/html
1998-06-17 01:43:24 +04:00
<HTML>
<TITLE>Say the magic word.</TITLE>
<H1>Edit a checkin.</H1>
Congratulations, you have found the hidden edit-a-checkin feature. Of course,
you need to know the magic word to do anything from here.
<P>
<FORM method=get action=\"doeditcheckin.cgi\">
<TABLE>
<tr>
<td align=right><B>Password:</B></td>
<td><INPUT NAME=password TYPE=password></td>
</tr><tr>
<td align=right><B>When:</B></td>
<td><INPUT NAME=datestring VALUE=\"" .
value_quote(MyFmtClock($info->{'date'})) . "\">
1998-06-17 01:43:24 +04:00
</td></tr>
";
1998-06-17 01:43:24 +04:00
if (!exists $info->{'notes'}) {
$info->{'notes'} = "";
1998-06-17 01:43:24 +04:00
}
foreach my $i ('person', 'dir', 'files', 'notes') {
print "<tr><td align=right><B>$i:</B></td>";
print "<td><INPUT NAME=$i VALUE=\"" . &value_quote($info->{$i}) .
"\"></td></tr>";
1998-06-17 01:43:24 +04:00
}
sub CheckString {
my ($value) = (@_);
if ($value) {
return "CHECKED";
1998-06-17 01:43:24 +04:00
} else {
return "";
1998-06-17 01:43:24 +04:00
}
}
my $isopen = CheckString($info->{'treeopen'});
my $isclosed = CheckString(!$info->{'treeopen'});
my $infolog = $info->{'log'} || "";
print qq{
1998-06-17 01:43:24 +04:00
<tr><td align=right><b>Tree state:</b></td>
<td><INPUT TYPE=radio NAME=treeopen VALUE=1 $isopen>Open
1998-06-17 01:43:24 +04:00
</td></tr><tr><td></td>
<td><INPUT TYPE=radio NAME=treeopen VALUE=0 $isclosed>Closed
1998-06-17 01:43:24 +04:00
</td></tr><tr>
<td align=right valign=top><B>Log message:</B></td>
<td><TEXTAREA NAME=log ROWS=10 COLS=80>$infolog</TEXTAREA></td></tr>
1998-06-17 01:43:24 +04:00
</table>
<INPUT TYPE=CHECKBOX NAME=nukeit>Check this box to blow away this checkin entirely.<br>
<INPUT TYPE=SUBMIT VALUE=Submit>
};
1998-06-17 01:43:24 +04:00
foreach my $i (sort(keys(%$info))) {
my $q = &url_quote($info->{$i});
print qq{<INPUT TYPE=HIDDEN NAME=orig$i VALUE="$q">\n};
1998-06-17 01:43:24 +04:00
}
print "<INPUT TYPE=HIDDEN NAME=id VALUE=\"$form_id\">";
print "<INPUT TYPE=HIDDEN NAME=treeid VALUE=\"$::TreeID\">";
1998-06-17 01:43:24 +04:00
print "</TABLE></FORM>";
1998-06-17 01:43:24 +04:00
PutsTrailer();
1998-06-17 01:43:24 +04:00