]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/backup.cgi
Fixed build and core 11
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / backup.cgi
index 0e29ace5fda2fce8cdc97c5e1d5a40c23b618d4f..552132250d9c3bc34a706808549e6941b63bbe91 100644 (file)
@@ -51,7 +51,7 @@ $cgiparams{'BACKUPLOGS'} = '';
 ############################################################################################################################
 ################################################ Workaround for Directories ################################################
 
-system("/usr/local/bin/backupctrl makedirs >/dev/null 2>&1 ") unless ( -e '/var/ipfire/backup/addons');
+system("/usr/local/bin/backupctrl makedirs >/dev/null 2>&1 ") unless ( -e '/var/ipfire/backup/addons/backup') ;
 
 ############################################################################################################################
 ############################################## System calls ohne Http Header ###############################################
@@ -88,14 +88,17 @@ elsif ( $cgiparams{'ACTION'} eq "restore" )
 }
 elsif ( $cgiparams{'ACTION'} eq "restoreaddon" )
 {
+    chomp($cgiparams{'UPLOAD'});
+    # we need to fix cause IE7 gives the full path and FF only the filename
+    my @temp = split(/\\/,$cgiparams{'UPLOAD'});
                my $upload = $a->param("UPLOAD");
-               open UPLOADFILE, ">/tmp/$cgiparams{'UPLOAD'}";
+               open UPLOADFILE, ">/tmp/".$temp[$#temp];
                binmode $upload;
                while ( <$upload> ) {
                print UPLOADFILE;
                }
                close UPLOADFILE;
-               system("/usr/local/bin/backupctrl restoreaddon $cgiparams{'UPLOAD'} >/dev/null 2>&1");
+               system("/usr/local/bin/backupctrl restoreaddon ".$temp[$#temp]." >/dev/null 2>&1");
 }
 
 &Header::showhttpheaders();
@@ -138,9 +141,9 @@ my @backups = `cd /var/ipfire/backup/ && ls *.ipf 2>/dev/null`;
 print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='95%' cellspacing='0'>
-<tr><td align='left' width='40%'>$Lang::tr{'logs'}</td><td align='left'>include Logfiles
+<tr><td align='left' width='40%'>$Lang::tr{'logs'}</td><td align='left'>$Lang::tr{'include logfiles'}
        <input type='radio' name='BACKUPLOGS' value='include'/>/
-       <input type='radio' name='BACKUPLOGS' value='exclude' checked='checked'/> exclude Logfiles
+       <input type='radio' name='BACKUPLOGS' value='exclude' checked='checked'/>$Lang::tr{'exclude logfiles'}
 </td></tr>
 <tr><td align='center' colspan='2'>
        <input type='hidden' name='ACTION' value='backup' />
@@ -270,8 +273,8 @@ print "</table>";
 print <<END
 <table width='95%' cellspacing='0'>
 <tr><td align='center' colspan='2'><font color='red'><br />$Lang::tr{'backupwarning'}</font><br /><br /></td></tr>
-<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
-<tr><td align='left'>$Lang::tr{'backupaddon'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restoreaddon' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backupaddon'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restoreaddon' /><input type='hidden' name='FILE' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
 </table>
 END
 ;