X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FLib.pm;h=9d89b0d5480a877959598d85f5d0127b4c2d697a;hb=3a173f3feb7dad79150eabf07bc8f304e13cdfe7;hp=40950f8c18d74aeae519189d23f62e08936f9e32;hpb=8f5625f9cdf47f8e04be654c4954838b2df3e26d;p=BackupPC.git diff --git a/lib/BackupPC/CGI/Lib.pm b/lib/BackupPC/CGI/Lib.pm index 40950f8..9d89b0d 100644 --- a/lib/BackupPC/CGI/Lib.pm +++ b/lib/BackupPC/CGI/Lib.pm @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.1.0beta0, released 20 Mar 2004. +# Version 2.1.0, released 20 Jun 2004. # # See http://backuppc.sourceforge.net. # @@ -102,8 +102,10 @@ sub NewRequest $Lang = $bpc->Lang(); $ConfigMTime = $bpc->ConfigMTime(); } elsif ( $bpc->ConfigMTime() != $ConfigMTime ) { - $bpc->ServerMesg("log Re-read config file because mtime changed"); - $bpc->ServerMesg("server reload"); + $bpc->ConfigRead(); + %Conf = $bpc->Conf(); + $Lang = $bpc->Lang(); + $ConfigMTime = $bpc->ConfigMTime(); } # @@ -154,6 +156,15 @@ EOF {map {$_, 1} split(",", $Hosts->{$host}{moreUsers}) } } } + + # + # Untaint the host name + # + if ( $In{host} =~ /^([\w.\s-]+)$/ ) { + $In{host} = $1; + } else { + delete($In{host}); + } } sub timeStamp2 @@ -283,7 +294,9 @@ sub GetStatusInfo eval($reply); # ignore status related to admin and trashClean jobs if ( $status =~ /\bhosts\b/ ) { - delete($Status{$bpc->adminJob}); + foreach my $host ( grep(/admin/, keys(%Status)) ) { + delete($Status{$host}) if ( $bpc->isAdminJob($host) ); + } delete($Status{$bpc->trashJob}); } } @@ -390,23 +403,23 @@ sub Header { my($title, $content, $noBrowse, $contentSub, $contentPost) = @_; my @adminLinks = ( - { link => "", name => $Lang->{Status}, + { link => "", name => $Lang->{Status}}, + { link => "?action=adminOpts", name => $Lang->{Admin_Options}, priv => 1}, - { link => "?action=adminOpts", name => $Lang->{Admin_Options} }, - { link => "?action=summary", name => $Lang->{PC_Summary}, + { link => "?action=summary", name => $Lang->{PC_Summary}}, + { link => "?action=view&type=LOG", name => $Lang->{LOG_file}, priv => 1}, - { link => "?action=view&type=LOG", name => $Lang->{LOG_file} }, - { link => "?action=LOGlist", name => $Lang->{Old_LOGs} }, - { link => "?action=emailSummary", name => $Lang->{Email_summary} }, - { link => "?action=view&type=config", name => $Lang->{Config_file} }, - { link => "?action=view&type=hosts", name => $Lang->{Hosts_file} }, - { link => "?action=queue", name => $Lang->{Current_queues} }, - { link => "?action=view&type=docs", name => $Lang->{Documentation}, + { link => "?action=LOGlist", name => $Lang->{Old_LOGs}, priv => 1}, - { link => "http://backuppc.sourceforge.net/faq", name => "FAQ", + { link => "?action=emailSummary", name => $Lang->{Email_summary}, priv => 1}, - { link => "http://backuppc.sourceforge.net", name => "SourceForge", + { link => "?action=view&type=config", name => $Lang->{Config_file}, priv => 1}, + { link => "?action=view&type=hosts", name => $Lang->{Hosts_file}, + priv => 1}, + { link => "?action=queue", name => $Lang->{Current_queues}, + priv => 1}, + @{$Conf{CgiNavBarLinks} || []}, ); my $host = $In{host}; @@ -418,12 +431,12 @@ sub Header $Conf{CgiHeaders} -
+
EOF if ( defined($Hosts) && defined($host) && defined($Hosts->{$host}) ) { print "
"; - NavSectionTitle("${EscURI($host)}"); + NavSectionTitle("${EscHTML($host)}"); print < EOF