#!/usr/bin/perl # # IPFire CGIs # # This code is distributed under the terms of the GPL # # (c) The IPFire Team use strict; # enable only the following on debugging purpose #use warnings; #use CGI::Carp 'fatalsToBrowser'; use File::Copy; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; my %color = (); my %mainsettings = (); my %cgiparams=(); my %checked = (); my $message = ""; my $errormessage = ""; my @backups = `cd /var/ipfire/backup/ && ls *.ipf`; $a = new CGI; &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); $cgiparams{'ACTION'} = ''; $cgiparams{'FILE'} = ''; $cgiparams{'UPLOAD'} = ''; $cgiparams{'BACKUPLOGS'} = ''; &Header::getcgihash(\%cgiparams); ############################################################################################################################ ############################################## System calls ohne Http Header ############################################### if ( $cgiparams{'ACTION'} eq "download" ) { open(DLFILE, "; print "Content-Type:application/x-download\n"; print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n"; print @fileholder; exit (0); } elsif ( $cgiparams{'ACTION'} eq "restore" ) { my $upload = $a->param("UPLOAD"); open UPLOADFILE, ">/tmp/restore.ipf"; binmode $upload; while ( <$upload> ) { print UPLOADFILE; } close UPLOADFILE; system("/usr/local/bin/backupctrl restore >/dev/null"); } &Header::showhttpheaders(); sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "
$Lang::tr{'logs'} | include Logfiles / exclude Logfiles |