diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-20 15:35:16 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-20 15:35:16 +0000 |
commit | 9c72b993542a48fe3b1e65fb1e5544f66b1dc164 (patch) | |
tree | ff832956e28a8ec4c78609b37ee18c93192e32c2 | |
parent | afc4d0b798b6803bb6749fde220388bf8a61065e (diff) | |
download | pfsense-9c72b993542a48fe3b1e65fb1e5544f66b1dc164.zip pfsense-9c72b993542a48fe3b1e65fb1e5544f66b1dc164.tar.gz |
Do not restore a full configuration if there is no pfsense or m0n0wall tag
-rwxr-xr-x | usr/local/www/diag_backup.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index d3dc3f7..51f87f5 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -140,16 +140,21 @@ if ($_POST) { $savemsg = "The configuration area has been restored."; } } else { - /* restore the entire configuration */ - if (config_install($_FILES['conffile']['tmp_name']) == 0) { - /* this will be picked up by /index.php */ - conf_mount_rw(); - touch("/needs_package_sync"); - conf_mount_ro(); - $reloadall = true; - $savemsg = "The configuration has been restored. The firewall is now reloading the settings."; + $rules = file_get_contents($_FILES['conffile']['tmp_name']); + if(stristr($rules, "pfsense") == false) { + $input_errors[] = "You have selected to restore the full configuration but we could not locate a pfsense tag."; } else { - $input_errors[] = "The configuration could not be restored."; + /* restore the entire configuration */ + if (config_install($_FILES['conffile']['tmp_name']) == 0) { + /* this will be picked up by /index.php */ + conf_mount_rw(); + touch("/needs_package_sync"); + conf_mount_ro(); + $reloadall = true; + $savemsg = "The configuration has been restored. The firewall is now reloading the settings."; + } else { + $input_errors[] = "The configuration could not be restored."; + } } } } else { |