From d3c7d74ce7d9c370b270bcdbc19bcfd193222db9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 23 Aug 2016 07:48:09 +0200 Subject: [PATCH] system: backup corrections, no hay root tag --- src/www/diag_backup.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/www/diag_backup.php b/src/www/diag_backup.php index 48d5c0ddf..d848b55fb 100644 --- a/src/www/diag_backup.php +++ b/src/www/diag_backup.php @@ -51,18 +51,15 @@ function restore_config_section($section_name, $new_contents) $xml = load_config_from_file($tmpxml); @unlink($tmpxml); - if (!is_array($xml) || !isset($xml[0])) { - return false; - } - - $xml = $xml[0]; - - if (!isset($xml[$section_name])) { + if (!is_array($xml) || !isset($xml[$section_name])) { return false; } $config[$section_name] = $xml[$section_name]; + write_config(sprintf(gettext("Restored %s of config file"), $section_name)); + convert_config(); + disable_security_checks(); return true; @@ -159,7 +156,7 @@ $areas = array( 'igmpproxy' => gettext('IGMP Proxy'), 'installedpackages' => gettext('Universal Plug and Play'), /* XXX only one, reduce depth! */ 'interfaces' => gettext('Interfaces'), - 'ipsec' => gettext('IPSEC'), + 'ipsec' => gettext('IPsec'), 'laggs' => gettext('LAGG Devices'), 'load_balancer' => gettext('Load Balancer'), 'nat' => gettext('Network Address Translation'),