#!/usr/bonsaitools/bin/perl # -*- Mode: perl; indent-tabs-mode: nil -*- # # 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. require 'CGI.pl'; require 'adminfuncs.pl'; print "Content-type: text/html\n\n"; CheckPassword(FormData('password')); Lock(); LoadCheckins(); $cmd = FormData('command'); if ($cmd eq 'close') { close_tree(); } elsif ($cmd eq 'open') { open_tree(); } elsif ($cmd eq 'tweaktimes') { edit_tree(); } elsif ($cmd eq 'editmotd') { edit_motd(); } elsif ($cmd eq 'changepassword') { change_passwd(); } else { error_screen('Invalid Command', "Invalid Command '$cmd'"); } PutsTrailer(); WriteCheckins(); Unlock(); exit 0; sub error_screen { my ($title, $err_str) = @_; PutsHeader($title); print "\n
$href about the closure.
"; } sub open_tree { my $sw = Param("software", 1); my $ti = Param("bonsai-treeinterest", 1); my $href = ConstructMailTo(EmailFromUsername($sw), "The tree is now open."); AdminOpenTree(ParseTimeAndCheck(FormData('lastgood')), exists($::FORM{'doclear'})); PutsHeader("The floodgates are open.", "The floodgates are open."); print " Mail has been sent notifying \"the hook\" and anyone subscribed to $ti.
$href about the new status of the tree.
"; } sub edit_tree { $::LastGoodTimeStamp = ParseTimeAndCheck(FormData('lastgood')); $::CloseTimeStamp = ParseTimeAndCheck(FormData('lastclose')); PutsHeader("Let's do the time warp again...", "Times have been tweaked."); Log("Times tweaked: \$::LastGoodTimeStamp is " . MyFmtClock($::LastGoodTimeStamp) . ", closetime is " . MyFmtClock($::CloseTimeStamp)); } sub edit_motd { LoadMOTD(); unless (FormData('origmotd') eq $::MOTD) { error_screen("Oops!", "