Merge remote-tracking branch 'origin/master' into dns-editor

This commit is contained in:
Michael Kaufmann (d00p) 2016-05-23 15:55:24 +02:00
commit 151d8f8c5c
6 changed files with 70 additions and 3 deletions

View File

@ -522,17 +522,29 @@ if ($page == 'overview') {
if (Settings::Get('system.backupenabled') == 1)
{
if ($action == 'abort' && isset($_POST['send']) && $_POST['send'] == 'send') {
$log->logAction(USR_ACTION, LOG_NOTICE, "customer_extras::backup - aborted scheduled backupjob");
$entry = isset($_POST['backup_job_entry']) ? (int)$_POST['backup_job_entry'] : 0;
if ($entry > 0) {
$del_stmt = Database::prepare("DELETE FROM `".TABLE_PANEL_TASKS."` WHERE `id` = :tid");
Database::pexecute($del_stmt, array('tid' => $entry));
standard_success('backupaborted');
}
redirectTo($filename, array('page' => $page, 'action' => '', 's' => $s));
}
if ($action == '') {
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::backup");
// check whether there is a backup-job for this customer
$sel_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_TASKS."` WHERE `type` = '20'");
Database::pexecute($sel_stmt);
$existing_backupJob = null;
while ($entry = $sel_stmt->fetch())
{
$data = unserialize($entry['data']);
if ($data['customerid'] == $userinfo['customerid']) {
standard_error('customerhasongoingbackupjob');
$existing_backupJob = $entry;
break;
}
}
@ -577,11 +589,24 @@ if ($page == 'overview') {
standard_success('backupscheduled');
} else {
if (!empty($existing_backupJob)) {
$action = "abort";
$row = unserialize($entry['data']);
$row['path'] = makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['destdir']));
$row['backup_web'] = ($row['backup_web'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no'];
$row['backup_mail'] = ($row['backup_mail'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no'];
$row['backup_dbs'] = ($row['backup_dbs'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no'];
}
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
$backup_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.backup.php';
$backup_form = htmlform::genHTMLForm($backup_data);
$title = $backup_data['backup']['title'];
$image = $backup_data['backup']['image'];
if (!empty($existing_backupJob)) {
// overwrite backup_form after we took everything from it we needed
eval("\$backup_form = \"" . getTemplate("extras/backup_listexisting") . "\";");
}
eval("echo \"" . getTemplate("extras/backup") . "\";");
}
}

View File

@ -113,7 +113,11 @@ class phpinterface_fpm {
'session.gc_probability',
'variables_order',
'opcache.log_verbosity_level',
'opcache.restrict_api'
'opcache.restrict_api',
'opcache.revalidate_freq',
'opcache.max_accelerated_files',
'opcache.memory_consumption',
'opcache.interned_strings_buffer'
),
'php_admin_flag' => array(
'allow_call_time_pass_reference',
@ -137,7 +141,8 @@ class phpinterface_fpm {
'opcache.revalidate_path',
'opcache.save_comments',
'opcache.use_cwd',
'opcache.validate_timestamps'
'opcache.validate_timestamps',
'opcache.fast_shutdown'
)
);

View File

@ -1981,6 +1981,7 @@ $lng['extras']['backup_mail'] = 'Backup mail-data';
$lng['extras']['backup_dbs'] = 'Backup databases';
$lng['error']['customerhasongoingbackupjob'] = 'There is already a backup job waiting to be processed, please be patient.';
$lng['success']['backupscheduled'] = 'Your backup job has been scheduled. Please wait for it to be processed';
$lng['success']['backupaborted'] = 'Your scheduled backup has been cancelled';
$lng['crondesc']['cron_backup'] = 'Process backup jobs';
$lng['error']['backupfunctionnotenabled'] = 'The backup function is not enabled';
$lng['serversettings']['backupenabled']['title'] = "Enable backup for customers";

View File

@ -1634,6 +1634,7 @@ $lng['extras']['backup_mail'] = 'E-Mail Daten sichern';
$lng['extras']['backup_dbs'] = 'Datenbanken sichern';
$lng['error']['customerhasongoingbackupjob'] = 'Es gibt noch einen austehenden Backup-Job. Bitte haben Sie etwas Geduld.';
$lng['success']['backupscheduled'] = 'Ihre Sicherung wurde erfolgreich geplant. Bitte warten Sie nun, bis diese abgearbeitet wurde.';
$lng['success']['backupaborted'] = 'Die geplante Sicherung wurde abgebrochen';
$lng['crondesc']['cron_backup'] = 'Ausstehende Sicherungen erstellen';
$lng['error']['backupfunctionnotenabled'] = 'Die Sicherungs-Funktion is nicht aktiviert';
$lng['serversettings']['backupenabled']['title'] = "Backup für Kunden aktivieren";

View File

@ -7,6 +7,15 @@ $header
</h2>
</header>
<if !empty($existing_backupJob)>
<div class="messagewrapperfull">
<div class="warningcontainer bradius">
<div class="warningtitle">{$lng['admin']['warning']}</div>
<div class="warning">{$lng['error']['customerhasongoingbackupjob']}</div>
</div>
</div>
</if>
<section>
<form action="{$linker->getLink(array('section' => 'extras'))}" method="post" enctype="application/x-www-form-urlencoded">

View File

@ -0,0 +1,26 @@
<thead>
<tr>
<th>{$lng['panel']['path']}</th>
<th>{$lng['extras']['backup_web']}</th>
<th>{$lng['extras']['backup_mail']}</th>
<th>{$lng['extras']['backup_dbs']}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{$row['path']}</td>
<td>{$row['backup_web']}</td>
<td>{$row['backup_mail']}</td>
<td>{$row['backup_dbs']}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4">
<p>
<input type="hidden" name="backup_job_entry" value="{$existing_backupJob['id']}" />
<input type="submit" value="{$lng['panel']['abort']}" class="nobutton" />
</p>
</td>
</tr>
</tfoot>