]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - html/cgi-bin/backup.cgi
Uploads.cgi entfernt. Die war noch ueber.
[people/teissler/ipfire-2.x.git] / html / cgi-bin / backup.cgi
CommitLineData
cf29614f
CS
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
9use strict;
10# enable only the following on debugging purpose
11use warnings;
12use CGI::Carp 'fatalsToBrowser';
13
14require '/var/ipfire/general-functions.pl';
15require "${General::swroot}/lang.pl";
16require "${General::swroot}/header.pl";
17
18my %color = ();
19my %mainsettings = ();
20my %backupsettings = ();
21my %checked = ();
22my $message = "";
23my $errormessage = "";
24my @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
39if ( $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
48if ( $message ne "" ) { print "<font color='red'>$message</font>"; }
49
50&Header::openbox('100%', 'center', $Lang::tr{'backup'});
51
52print <<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>
61END
62;
63&Header::closebox();
64
65&Header::openbox('100%', 'center', $Lang::tr{'backups'});
66
67print <<END
68<form method='post' action='$ENV{'SCRIPT_NAME'}'>
69<table width='95%' cellspacing='0'>
70END
71;
72foreach (@backups){
73print "<tr><td align='left' width='40%'>$Lang::tr{'backup from'}</td><td align='left'>$_</td></tr>";
74}
75print <<END
76</table>
77</form>
78END
79;
80&Header::closebox();
81&Header::closebigbox();
82&Header::closepage();