web backup scheduler

This commit is contained in:
Serghey Rodin 2013-03-13 16:07:49 +02:00
commit bbba9aeb34
13 changed files with 278 additions and 80 deletions

View file

@ -145,6 +145,7 @@ $LANG['en'] = array(
'SSH Access' => 'SSH Access',
'IP Addresses' => 'IP Addresses',
'Backups' => 'Backups',
'Backup System' => 'Backup System',
'template' => 'template',
'SSL Support' => 'SSL Support',
'SSL Home Directory' => 'SSL Home',
@ -362,6 +363,8 @@ $LANG['en'] = array(
'Error code:' => 'Error code: %s',
'SERVICE_ACTION_FAILED' => '"%s" "%s" failed',
'IP address is in use' => 'IP address is in use',
'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.',
'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.',
'Welcome to Vesta Control Panel' => 'Welcome to Vesta Control Panel',
'MAIL_FROM' => 'Vesta Control Panel <noreply@%s>',

View file

@ -144,6 +144,7 @@ $LANG['es'] = array(
'SSH Access' => 'Acceso SSH',
'IP Addresses' => 'Dirección IP',
'Backups' => 'Respaldos',
'Backup System' => 'Sistema de Respaldo',
'template' => 'plantilla',
'SSL Support' => 'Soporte SSL',
'SSL Home Directory' => 'SSL Home',
@ -361,6 +362,8 @@ $LANG['es'] = array(
'Error code:' => 'Código de Error:',
'SERVICE_ACTION_FAILED' => '"%s" "%s" fallo',
'IP address is in use' => 'La IP esta en uso',
'BACKUP_SCHEDULED' => 'Task has been added to the queue. You will receive an email notification when your backup is ready for download.',
'BACKUP_EXISTS' => 'An existing backup is already running. Please wait for that backup to finish.',
'Welcome to Vesta Control Panel' => 'Bienvenido al Panel de Control Vesta',
'MAIL_FROM' => 'Panel de Control Vesta <noreply@%s>',

View file

@ -146,6 +146,7 @@ $LANG['ru'] = array(
'SSH Access' => 'Доступ по SSH',
'IP Addresses' => 'IP адреса',
'Backups' => 'Резервные копии',
'Backup System' => 'Система резервного копирования',
'template' => 'шаблон',
'SSL Support' => 'Поддержка SSL',
'SSL Home Directory' => 'Директория SSL',
@ -363,6 +364,8 @@ $LANG['ru'] = array(
'Error code:' => 'Код ошибки: %s',
'SERVICE_ACTION_FAILED' => 'Не удалось "%s" "%s"',
'IP address is in use' => 'IP адрес используется',
'BACKUP_SCHEDULED' => 'Задание успешно добавлено в очередь. После завершения вы получите полный отчет по почте.',
'BACKUP_EXISTS' => 'Резервное копирование уже выполняется, полжалуйста дождитесь окончания.',
'Welcome to Vesta Control Panel' => 'Добро пожаловать в панель управления Vesta',
'MAIL_FROM' => 'Vesta Control Panel <noreply@%s>',

36
web/inc/mail-wrapper.php Executable file
View file

@ -0,0 +1,36 @@
#!/usr/local/vesta/php/bin/php
<?php
if (empty($argv[1])) {
echo "Error: not enough arguments\n";
exit(3);
}
$options = getopt("s:f:");
define('NO_AUTH_REQUIRED',true);
include("/usr/local/vesta/web/inc/main.php");
// Set system language
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
$data = json_decode(implode('', $output), true);
if (!empty( $data['config']['LANGUAGE'])) {
$_SESSION['language'] = $data['config']['LANGUAGE'];
} else {
$_SESSION['language'] = 'en';
}
require_once('/usr/local/vesta/web/inc/i18n/'.$_SESSION['language'].'.php');
// Define vars
$from = 'Vesta Control Panel <vesta@'.$_SERVER["HOSTNAME"].'>';
$to = $argv[3]."\n";
$subject = $argv[2]."\n";
$mailtext = file_get_contents("php://stdin");
// Send email
if ((!empty($to)) && (!empty($subject))) {
send_email($to,$subject,$mailtext,$from);
}
?>