2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
switch ( filter ( 'op' )) {
case 'getfile' :
$file = filter ( 'file' );
force_download ( $file , file_get_contents ( $backup_dir . $file ));
break ;
case 'del' :
$file = filter ( 'file' );
2017-09-08 13:24:48 +02:00
deltree ( $backup_dir . $file );
2017-08-04 16:28:16 +02:00
2017-09-08 13:24:48 +02:00
if ( ! file_exists ( $backup_dir . $file )) {
2017-09-10 14:35:41 +02:00
$_SESSION [ 'infos' ][] = tr ( 'Backup _FILE_ eliminato!' , [
'_FILE_' => '"' . $file . '"' ,
]);
2017-08-04 16:28:16 +02:00
} else {
2017-09-10 14:35:41 +02:00
$_SESSION [ 'errors' ][] = tr ( " Errore durante l'eliminazione del backup _FILE_! " , [
'_FILE_' => '"' . $file . '"' ,
]);
2017-08-04 16:28:16 +02:00
}
break ;
case 'backup' :
if ( ! do_backup ()) {
2017-09-04 12:02:29 +02:00
$_SESSION [ 'errors' ][] = tr ( 'Errore durante la creazione del backup!' ) . ' ' . tr_replace ( '_DIR_' , '"' . $backup_dir . '"' , tr ( 'Verifica che la cartella _DIR_ abbia i permessi di scrittura!' ));
2017-08-04 16:28:16 +02:00
}
break ;
}