Skip to content

Commit a91d3e3

Browse files
committed
fix backup download
1 parent 97ae412 commit a91d3e3

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

web/download/backup/index.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,25 @@
44
ob_start();
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
7-
87
// Check token
98
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
109
header('Location: /login/');
1110
exit();
1211
}
1312

13+
$backup = $_GET['backup'];
14+
1415
if(!file_exists('/backup/'.$backup)){
1516
$v_username = escapeshellarg($user);
16-
exec (HESTIA_CMD."v-schedule-user-backup ".$v_username, $output, $return_var);
17+
$backup = escapeshellarg($_GET['backup']);
18+
exec (HESTIA_CMD."v-schedule-user-backup-download ".$v_username." ".$backup , $output, $return_var);
1719
if ($return_var == 0) {
18-
$_SESSION['error_msg'] = __('BACKUP_SCHEDULED');
20+
$_SESSION['error_msg'] = __('BACKUP_DOWNLOAD_SCHEDULED');
1921
} else {
2022
$_SESSION['error_msg'] = implode('<br>', $output);
2123
if (empty($_SESSION['error_msg'])) {
2224
$_SESSION['error_msg'] = __('Error: hestia did not return any output.');
23-
}
24-
25-
if ($return_var == 4) {
26-
$_SESSION['error_msg'] = __('BACKUP_EXISTS');
27-
}
28-
25+
}
2926
}
3027
unset($output);
3128
header("Location: /list/backup/");

0 commit comments

Comments
 (0)