summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/diag_backup.php38
1 files changed, 35 insertions, 3 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 9b6c484..2470be4 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -40,13 +40,43 @@
/* Allow additional execution time 0 = no limit. */
-ini_set('max_execution_time', '3600');
-ini_set('max_input_time', '3600');
+ini_set('max_execution_time', '0');
+ini_set('max_input_time', '0');
/* omit no-cache headers because it confuses IE with file downloads */
$omit_nocacheheaders = true;
require("guiconfig.inc");
+function add_base_packages_menu_items() {
+ global $g, $config;
+ $base_packages = split($g['base_packages'], ",");
+ $modified_config = false;
+ foreach($base_packages as $bp) {
+ $basepkg_path = "/usr/local/pkg/";
+ if(file_exists($basepkg_path . $configfile)) {
+ $pkg_config = parse_xml_config_pkg($basepkg_path . $bp, "packagegui");
+ if($pkg_config['menu'] != "") {
+ if(is_array($pkg_config['menu'])) {
+ foreach($pkg_config['menu'] as $menu) {
+ if(is_array($config['installedpackages']['menu']))
+ foreach($config['installedpackages']['menu'] as $amenu)
+ if($amenu['name'] == $menu['name'])
+ continue;
+ $config['installedpackages']['menu'][] = $menu;
+ $modified_config = true;
+ }
+ }
+ $static_output .= "done.\n";
+ update_output_window($static_output);
+ }
+ }
+ }
+ if($modified_config) {
+ write_confg("Restored base_package menus after configuration restore.");
+ $config = parse_config(true);
+ }
+}
+
function remove_bad_chars($string) {
return preg_replace('/[^a-z|_|0-9]/i','',$string);
}
@@ -259,6 +289,7 @@ if ($_POST) {
unset($config['rrddata']);
unlink_if_exists("/tmp/config.cache");
write_config();
+ add_base_packages_menu_items();
conf_mount_ro();
}
if($m0n0wall_upgrade == true) {
@@ -273,6 +304,7 @@ if ($_POST) {
$config['interfaces'][$iface]['descr'] = remove_bad_chars($config['interfaces'][$iface]['descr']);
unlink_if_exists("/tmp/config.cache");
write_config();
+ add_base_packages_menu_items();
conf_mount_ro();
$savemsg = "The m0n0wall configuration has been restored and upgraded to pfSense.<p>The firewall is now rebooting.";
$reboot_needed = true;
@@ -516,4 +548,4 @@ if($reboot_needed == true) {
exit;
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud