| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- ob_start();
- include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
- // Check token
- verify_csrf($_GET);
- $backup = escapeshellarg($_GET['backup']);
- $web = 'no';
- $dns = 'no';
- $mail = 'no';
- $db = 'no';
- $cron = 'no';
- $udir = 'no';
- if ($_GET['type'] == 'web') {
- $web = escapeshellarg($_GET['object']);
- }
- if ($_GET['type'] == 'dns') {
- $dns = escapeshellarg($_GET['object']);
- }
- if ($_GET['type'] == 'mail') {
- $mail = escapeshellarg($_GET['object']);
- }
- if ($_GET['type'] == 'db') {
- $db = escapeshellarg($_GET['object']);
- }
- if ($_GET['type'] == 'cron') {
- $cron = 'yes';
- }
- if ($_GET['type'] == 'udir') {
- $udir = escapeshellarg($_GET['object']);
- }
- if (!empty($_GET['type'])) {
- $restore_cmd = HESTIA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir;
- } else {
- $restore_cmd = HESTIA_CMD."v-schedule-user-restore ".$user." ".$backup;
- }
- exec($restore_cmd, $output, $return_var);
- if ($return_var == 0) {
- $_SESSION['error_msg'] = _('RESTORE_SCHEDULED');
- } else {
- $_SESSION['error_msg'] = implode('<br>', $output);
- if (empty($_SESSION['error_msg'])) {
- $_SESSION['error_msg'] = _('Error: Hestia did not return any output.');
- }
- if ($return_var == 4) {
- $_SESSION['error_msg'] = _('RESTORE_EXISTS');
- }
- }
- header("Location: /list/backup/?backup=" . $_GET['backup']);
|