Encrypt backup after rrd data is added, it fixes #2836

This commit is contained in:
Renato Botelho 2013-02-24 10:50:48 -03:00
parent 73ed069b8a
commit 4cfd23901d

View File

@ -306,11 +306,6 @@ if ($_POST) {
//unlock($lockbckp);
if ($_POST['encrypt']) {
$data = encrypt_data($data, $_POST['encrypt_password']);
tagfile_reformat($data, $data, "config.xml");
}
/*
* Backup RRD Data
*/
@ -320,6 +315,11 @@ if ($_POST) {
$data = str_replace($closing_tag, $rrd_data_xml . $closing_tag, $data);
}
if ($_POST['encrypt']) {
$data = encrypt_data($data, $_POST['encrypt_password']);
tagfile_reformat($data, $data, "config.xml");
}
$size = strlen($data);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename={$name}");