1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

45 lines
1.3 KiB
PHP
Raw Normal View History

2013-03-28 01:12:57 +02:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
$backup = escapeshellarg($_GET['backup']);
2013-03-28 01:12:57 +02:00
$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']);
2013-03-28 01:12:57 +02:00
if ($_GET['type'] == 'cron') $cron = 'yes';
if ($_GET['type'] == 'udir') $udir = escapeshellarg($_GET['object']);
2013-03-28 01:12:57 +02:00
if (!empty($_GET['type'])) {
$restore_cmd = VESTA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir;
2013-10-21 17:47:24 +03:00
} else {
$restore_cmd = VESTA_CMD."v-schedule-user-restore ".$user." ".$backup;
2013-10-21 17:47:24 +03:00
}
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: vesta did not return any output.');
}
if ($return_var == 4) {
2013-11-02 16:43:40 +02:00
$_SESSION['error_msg'] = __('RESTORE_EXISTS');
}
2013-03-28 01:12:57 +02:00
}
header("Location: /list/backup/?backup=" . $_GET['backup']);