X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FLib.pm;h=b67be9178d8866cb1252ba328f381490e5f8c034;hp=baa168f7431a1ba476a53efd1894f84087e285a9;hb=79e0593c501fd58046feeca20c315cc4ac283435;hpb=329e870f56fb6572fa697998d33676588034c149
diff --git a/lib/BackupPC/CGI/Lib.pm b/lib/BackupPC/CGI/Lib.pm
index baa168f..b67be91 100644
--- a/lib/BackupPC/CGI/Lib.pm
+++ b/lib/BackupPC/CGI/Lib.pm
@@ -29,7 +29,7 @@
#
#========================================================================
#
-# Version 2.1.0_CVS, released 3 Jul 2003.
+# Version 2.1.0beta2, released 23 May 2004.
#
# See http://backuppc.sourceforge.net.
#
@@ -48,7 +48,7 @@ use vars qw($Cgi %In $MyURL $User %Conf $TopDir $BinDir $bpc);
use vars qw(%Status %Info %Jobs @BgQueue @UserQueue @CmdQueue
%QueueLen %StatusHost);
use vars qw($Hosts $HostsMTime $ConfigMTime $PrivAdmin);
-use vars qw(%UserEmailInfo $UserEmailInfoMTime %RestoreReq);
+use vars qw(%UserEmailInfo $UserEmailInfoMTime %RestoreReq %ArchiveReq);
use vars qw($Lang);
@ISA = qw(Exporter);
@@ -80,7 +80,7 @@ use vars qw($Lang);
%Status %Info %Jobs @BgQueue @UserQueue @CmdQueue
%QueueLen %StatusHost
$Hosts $HostsMTime $ConfigMTime $PrivAdmin
- %UserEmailInfo $UserEmailInfoMTime %RestoreReq
+ %UserEmailInfo $UserEmailInfoMTime %RestoreReq %ArchiveReq
$Lang
);
@@ -93,15 +93,6 @@ sub NewRequest
$Cgi = new CGI;
%In = $Cgi->Vars;
- #
- # We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
- # The latter requires .ht_access style authentication. Replace this
- # code if you are using some other type of authentication, and have
- # a different way of getting the user name.
- #
- $MyURL = $ENV{SCRIPT_NAME};
- $User = $ENV{REMOTE_USER};
-
if ( !defined($bpc) ) {
ErrorExit($Lang->{BackupPC__Lib__new_failed__check_apache_error_log})
if ( !($bpc = BackupPC::Lib->new(undef, undef, 1)) );
@@ -111,12 +102,25 @@ sub NewRequest
$Lang = $bpc->Lang();
$ConfigMTime = $bpc->ConfigMTime();
} elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
- $bpc->ConfigRead();
- %Conf = $bpc->Conf();
- $ConfigMTime = $bpc->ConfigMTime();
- $Lang = $bpc->Lang();
+ $bpc->ServerMesg("log Re-read config file because mtime changed");
+ $bpc->ServerMesg("server reload");
}
+ #
+ # Default REMOTE_USER so in a miminal installation the user
+ # has a sensible default.
+ #
+ $ENV{REMOTE_USER} = $Conf{BackupPCUser} if ( $ENV{REMOTE_USER} eq "" );
+
+ #
+ # We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
+ # The latter requires .ht_access style authentication. Replace this
+ # code if you are using some other type of authentication, and have
+ # a different way of getting the user name.
+ #
+ $MyURL = $ENV{SCRIPT_NAME};
+ $User = $ENV{REMOTE_USER};
+
#
# Clean up %ENV for taint checking
#
@@ -156,7 +160,6 @@ sub timeStamp2
{
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= localtime($_[0] == 0 ? time : $_[0] );
- $year += 1900;
$mon++;
if ( $Conf{CgiDateFormatMMDD} ) {
return sprintf("$mon/$mday %02d:%02d", $hour, $min);
@@ -218,10 +221,6 @@ sub ErrorExit
my(@mesg) = @_;
my($head) = shift(@mesg);
my($mesg) = join("