From b3277798e5f6f3e02468f58e315e37362d932d02 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 30 Aug 2008 03:49:07 +0000 Subject: Only show areas that have data in them in the backup selection screen. Noticed-by: mgrooms --- usr/local/www/diag_backup.php | 51 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index 29d5474..22494a4 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -51,25 +51,40 @@ function remove_bad_chars($string) { return preg_replace('/[^a-z|_|0-9]/i','',$string); } +function check_and_returnif_section_exists($section) { + global $config; + if(is_array($config[$section])) + return true; + return false; +} + function spit_out_select_items($area) { - $select = << - - - - - - - - - - - - - - - -EOD; + global $config; + + $areas = array("aliases" => "Aliases", + "shaper" => "Traffic Shaper", + "filter" => "Firewall Rules", + "nat" => "NAT", + "pptpd" => "PPTP Server", + "ipsec" => "IPSEC", + "captiveportal" => "Captive Portal", + "installedpackages" => "Package Manager", + "interfaces" => "Interfaces", + "dhcpd" => "DHCP Server", + "syslog" => "Syslog", + "system" => "System", + "staticroutes" => "Static routes" + ); + + $select .= "\n"; + echo $select; } -- cgit v1.1