diff options
author | jim-p <jim@pingle.org> | 2010-02-27 15:48:09 -0500 |
---|---|---|
committer | jim-p <jim@pingle.org> | 2010-02-27 15:48:09 -0500 |
commit | 9f9b88e2172994610dd6794057ed5c567ade0a9e (patch) | |
tree | 27287101bafc3b507bb8bb9d75c4ffc75c0faa1e /usr/local/www/diag_confbak.php | |
parent | 85183d57d5330fb33c3f31f498c051d78d8d0cf3 (diff) | |
download | pfsense-9f9b88e2172994610dd6794057ed5c567ade0a9e.zip pfsense-9f9b88e2172994610dd6794057ed5c567ade0a9e.tar.gz |
Add link to download config from backup history. Ticket #268
Diffstat (limited to 'usr/local/www/diag_confbak.php')
-rwxr-xr-x | usr/local/www/diag_confbak.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php index 6ef685c..304714f 100755 --- a/usr/local/www/diag_confbak.php +++ b/usr/local/www/diag_confbak.php @@ -58,6 +58,20 @@ if($_GET['rmver'] != "") { conf_mount_ro(); } +if($_GET['getcfg'] != "") { + $file = $g['conf_path'] . '/backup/config-' . $_GET['getcfg'] . '.xml'; + + $exp_name = urlencode("config-{$config['system']['hostname']}.{$config['system']['domain']}-{$_GET['getcfg']}.xml"); + $exp_data = file_get_contents($file); + $exp_size = strlen($exp_data); + + header("Content-Type: application/octet-stream"); + header("Content-Disposition: attachment; filename={$exp_name}"); + header("Content-Length: $exp_size"); + echo $exp_data; + exit; +} + cleanup_backupcache(); $confvers = get_backups(); unset($confvers['versions']); @@ -119,6 +133,11 @@ include("head.inc"); <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="Remove this backup" title="Remove this backup"> </a> </td> + <td valign="middle" class="list" nowrap> + <a href="diag_confbak.php?getcfg=<?=$version['time'];?>"> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="Download this backup" title="Download this backup"> + </a> + </td> </tr> <?php endforeach; ?> <?php else: ?> |