1999-07-23 22:39:31 +04:00
|
|
|
#!/usr/bonsaitools/bin/perl -w
|
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1998-06-17 01:43:24 +04:00
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Netscape Public License
|
|
|
|
# Version 1.0 (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/
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# The Original Code is the Bonsai CVS tool.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
|
|
|
# Corporation. Portions created by Netscape are Copyright (C) 1998
|
|
|
|
# Netscape Communications Corporation. All Rights Reserved.
|
|
|
|
|
1999-10-19 02:55:01 +04:00
|
|
|
use diagnostics;
|
|
|
|
use strict;
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
require 'CGI.pl';
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
print "Content-type: text/html
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
<HTML>";
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
CheckPassword($::FORM{'password'});
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
Lock();
|
|
|
|
LoadCheckins();
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
my $busted = 0;
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
my $info;
|
|
|
|
|
|
|
|
if (!exists $::FORM{'id'}) {
|
1998-06-17 01:43:24 +04:00
|
|
|
set busted 1
|
|
|
|
} else {
|
1999-07-23 22:39:31 +04:00
|
|
|
$info = eval("\\%" . $::FORM{'id'});
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-10-19 02:55:01 +04:00
|
|
|
if (!exists $info->{'notes'}) {
|
|
|
|
$info->{'notes'} = "";
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
|
1999-10-19 02:55:01 +04:00
|
|
|
foreach my $i (sort(keys(%$info))) {
|
1999-07-23 22:39:31 +04:00
|
|
|
if (FormData("orig$i") ne $info->{$i}) {
|
|
|
|
$busted = 1;
|
|
|
|
last;
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
if ($busted) {
|
|
|
|
Unlock();
|
|
|
|
print "
|
1998-06-17 01:43:24 +04:00
|
|
|
<TITLE>Oops!</TITLE>
|
|
|
|
<H1>Someone else has been here!</H1>
|
|
|
|
|
|
|
|
It looks like somebody else has changed or deleted this checkin.
|
|
|
|
Terry was too lazy to implement anything beyond detecting this
|
|
|
|
condition. You'd best go start over -- go back to the list of
|
|
|
|
checkins, look for this checkin again, and decide if you still want to
|
1999-07-23 22:39:31 +04:00
|
|
|
make your edits.";
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
PutsTrailer();
|
|
|
|
exit();
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
if (exists $::FORM{'nukeit'}) {
|
|
|
|
Log("A checkin for $info->{person} has been nuked.");
|
1998-06-17 01:43:24 +04:00
|
|
|
} else {
|
1999-07-23 22:39:31 +04:00
|
|
|
Log("A checkin for $info->{person} has been modified.");
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
$info->{date} = ParseTimeAndCheck(FormData('datestring'));
|
|
|
|
foreach my $i ('person', 'dir', 'files', 'notes', 'treeopen', 'log') {
|
|
|
|
$info->{$i} = FormData($i);
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
if (exists $::FORM{'nukeit'}) {
|
|
|
|
my $w = lsearch(\@::CheckInList, $::FORM{'id'});
|
|
|
|
if ($w >= 0) {
|
|
|
|
splice(@::CheckInList, $w, 1);
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
WriteCheckins();
|
|
|
|
|
|
|
|
print "OK, the checkin has been changed.";
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
PutsTrailer();
|
1998-06-17 01:43:24 +04:00
|
|
|
|