]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/backup.cgi
Korrekturen im IDS System
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / backup.cgi
1 #!/usr/bin/perl
2 #
3 # IPFire CGIs
4 #
5 # This code is distributed under the terms of the GPL
6 #
7 # (c) The IPFire Team
8
9 use strict;
10 # enable only the following on debugging purpose
11 use warnings;
12 use CGI::Carp 'fatalsToBrowser';
13
14 require '/var/ipfire/general-functions.pl';
15 require "${General::swroot}/lang.pl";
16 require "${General::swroot}/header.pl";
17
18 my %color = ();
19 my %mainsettings = ();
20 my %backupsettings = ();
21 my %checked = ();
22 my $message = "";
23 my $errormessage = "";
24 my @backups = `cd /var/ipfire/backup/ && ls *.ipf`;
25
26
27 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
28 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
29
30 &Header::showhttpheaders();
31 &Header::getcgihash(\%backupsettings);
32
33 &Header::openpage($Lang::tr{'backup'}, 1, "");
34 &Header::openbigbox('100%', 'left', '', $errormessage);
35
36 ############################################################################################################################
37 ######################################## Scanne Verzeichnisse nach Mp3 Dateien #############################################
38
39 if ( $backupsettings{'ACTION'} eq "backup" )
40 {
41 if ( $backupsettings{'BACKUPLOGS'} eq "include" ){system("/usr/local/bin/backupctrl include");}
42 else {system("/usr/local/bin/backupctrl exclude");}
43 }
44
45 ############################################################################################################################
46 ########################################### rekursiv nach neuen Mp3s Scannen ##############################################รค
47
48 if ( $message ne "" ) { print "<font color='red'>$message</font>"; }
49
50 &Header::openbox('100%', 'center', $Lang::tr{'backup'});
51
52 print <<END
53 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
54 <table width='95%' cellspacing='0'>
55 <tr><td align='left' width='40%'>$Lang::tr{'logs'}</td><td align='left'>include Logfiles <input type='radio' name='BACKUPLOGS' value='include' checked='checked'/>/
56 <input type='radio' name='BACKUPLOGS' value='exclude'/> exclude Logfiles</td></tr>
57 <tr><td align='center' colspan='2'><input type='hidden' name='ACTION' value='backup' />
58 <input type='image' alt='$Lang::tr{'Scan for Files'}' title='$Lang::tr{'Scan for Files'}' src='/images/edit-find.png' /></td></tr>
59 </table>
60 </form>
61 END
62 ;
63 &Header::closebox();
64
65 &Header::openbox('100%', 'center', $Lang::tr{'backups'});
66
67 print <<END
68 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
69 <table width='95%' cellspacing='0'>
70 END
71 ;
72 foreach (@backups){
73 print "<tr><td align='left' width='40%'>$Lang::tr{'backup from'}</td><td align='left'>$_</td></tr>";
74 }
75 print <<END
76 </table>
77 </form>
78 END
79 ;
80 &Header::closebox();
81 &Header::closebigbox();
82 &Header::closepage();