diff options
author | Bill Marquette <billm@pfsense.org> | 2005-03-20 03:52:39 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-03-20 03:52:39 +0000 |
commit | 6a1e66513954db1241a23b8363e134526c962899 (patch) | |
tree | 686f4f346765b3d5e6fef6d42498204803ea6456 /usr/local/www | |
parent | 814d54bba7b6d49b062f3b8b32ad29dc5d04477c (diff) | |
download | pfsense-6a1e66513954db1241a23b8363e134526c962899.zip pfsense-6a1e66513954db1241a23b8363e134526c962899.tar.gz |
Initial commit of onbox version control (broken).
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/diag_backup.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index d048d00..3cc4a8d 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -100,6 +100,27 @@ if ($_POST) { } } } + + +/* XXX - billm: begginnings of version control code + * This code sucks and is really more of a PoC - it needs cleanup (and doesn't work) + * don't set system/version_control :) + */ +if (isset($config['system']['version_control'])) { + $dir="{$g['cf_conf_path']}/bak"; + $old_versions = array(); + if (is_dir($dir)) { + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + if ($file != "." && $file != "..") { + array_push(&$old_versions, $file); + } + } + closedir($dh); + } + } +} + ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> @@ -164,6 +185,29 @@ if ($_POST) { </tr> </table> </form> +<?php + /* XXX - billm: begginnings of version control code + * This code sucks and is really more of a PoC - it needs cleanup (and doesn't work) + * don't set system/version_control :) + */ + if (isset($config['system']['version_control'])) { +?> + <br> + <form action="diag_backup.php" method="post" name="version_control" id="version_control"> + <table width="100%" border="0" cellspacing="0" cellpadding="6"> + <tr> + <td colspan="3" class="listtopic">Config backups</td> + </tr> +<?php foreach ($old_versions as $ver): ?> + <tr> + <td width="22%" valign="baseline" class="vncell">Filename</td> + <td width="56%" class="vtable"><? echo $ver; ?></td + <td width="22%" class="vtable"><input name="restore" type="submit" class="formbtn" id="restore" value="Restore version"></td> + </tr> +<?php endforeach; ?> + </table> + </form> +<?php }; ?> <?php include("fend.inc"); ?> </body> </html> |