index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. $backup = escapeshellarg($_GET['backup']);
  8. $web = 'no';
  9. $dns = 'no';
  10. $mail = 'no';
  11. $db = 'no';
  12. $cron = 'no';
  13. $udir = 'no';
  14. if ($_GET['type'] == 'web') $web = escapeshellarg($_GET['object']);
  15. if ($_GET['type'] == 'dns') $dns = escapeshellarg($_GET['object']);
  16. if ($_GET['type'] == 'mail') $mail = escapeshellarg($_GET['object']);
  17. if ($_GET['type'] == 'db') $db = escapeshellarg($_GET['object']);
  18. if ($_GET['type'] == 'cron') $cron = 'yes';
  19. if ($_GET['type'] == 'udir') $udir = escapeshellarg($_GET['object']);
  20. if (!empty($_GET['type'])) {
  21. exec (VESTA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir, $output, $return_var);
  22. if ($return_var == 0) {
  23. $_SESSION['restore_msg'] = __('RESTORE_SCHEDULED');
  24. } else {
  25. $_SESSION['restore_msg'] = implode('<br>', $output);
  26. if (empty($_SESSION['restore_msg'])) {
  27. $_SESSION['restore_msg'] = __('Error: vesta did not return any output.');
  28. }
  29. if ($return_var == 4) {
  30. $_SESSION['restore_msg'] = __('RESTORE_EXISTS');
  31. }
  32. }
  33. }
  34. header("Location: /list/backup/?backup=" . $_GET['backup']);