aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup/autoconfigbackup.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-12-07 03:26:27 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-12-07 03:26:27 +0000
commitea608de3e71e1fcd86a311d387b25792e9e17227 (patch)
tree695a0886e35a98f4e81a1dc2b4c9d9a49f84e781 /packages/autoconfigbackup/autoconfigbackup.php
parent94479025b3b6f5cc8dff2e869f1853f411a3d222 (diff)
downloadpfsense-packages-ea608de3e71e1fcd86a311d387b25792e9e17227.tar.gz
pfsense-packages-ea608de3e71e1fcd86a311d387b25792e9e17227.tar.bz2
pfsense-packages-ea608de3e71e1fcd86a311d387b25792e9e17227.zip
Add delete option
Diffstat (limited to 'packages/autoconfigbackup/autoconfigbackup.php')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php59
1 files changed, 42 insertions, 17 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index 403bd6f6..f3966fa4 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -52,6 +52,9 @@ $password = $config['installedpackages']['autoconfigbackup']['config'][0]['pas
// URL to restore.php
$get_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/restore.php";
+// URL to delete.php
+$del_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/delete.php";
+
// Set hostname
$hostname = $config['system']['hostname'] . "." . $config['system']['domain'];
@@ -174,7 +177,19 @@ if (curl_errno($curl_session)) {
}
if($_REQUEST['rmver'] != "") {
- // XXX: delete revision, or all backups from server.
+ $curl_session = curl_init();
+ curl_setopt($curl_session, CURLOPT_URL, $del_url);
+ curl_setopt($curl_session, CURLOPT_POST, 3);
+ curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=delete" .
+ "&hostname=" . urlencode($hostname) .
+ "&revision=" . urlencode($_REQUEST['rmver']));
+ $data = curl_exec($curl_session);
+ if (curl_errno($curl_session)) {
+ } else {
+ curl_close($curl_session);
+ }
}
// Loop through and create new confvers
@@ -245,26 +260,36 @@ include("head.inc");
<tr>
<td>
<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="30%" class="listhdrr">Date</td>
- <td width="70%" class="listhdrr">Configuration Change</td>
- </tr>
+ <tr>
+ <td colspan="2" align="left">
+ <form method="post" action="autoconfigbackup.php">
+ <input type="button" onClick='backupnow()' name="backup" value="Backup Now">
+ </form>
+ </td>
+ </tr>
+ <tr>
+ <td width="30%" class="listhdrr">Date</td>
+ <td width="70%" class="listhdrr">Configuration Change</td>
+ </tr>
<?php
$counter = 0;
foreach($confvers as $cv):
?>
- <tr valign="top">
- <td class="listlr"> <?= $cv['time']; ?></td>
- <td class="listbg"> <?= $cv['reason']; ?></td>
- <td colspan="2" valign="middle" class="list" nowrap>
- <a onClick="return confirm('Are you sure you want to restore <?= $cv['time']; ?>?')" href="autoconfigbackup.php?newver=<?=urlencode($cv['time']);?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0">
- </a>
- <a href="autoconfigbackup.php?download=<?=urlencode($cv['time']);?>">
- <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0">
- </a>
- </td>
- </tr>
+ <tr valign="top">
+ <td class="listlr"> <?= $cv['time']; ?></td>
+ <td class="listbg"> <?= $cv['reason']; ?></td>
+ <td colspan="2" valign="middle" class="list" nowrap>
+ <a onClick="return confirm('Are you sure you want to restore <?= $cv['time']; ?>?')" href="autoconfigbackup.php?newver=<?=urlencode($cv['time']);?>">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0">
+ </a>
+ <a href="autoconfigbackup.php?download=<?=urlencode($cv['time']);?>">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0">
+ </a>
+ <a onClick="return confirm('Are you sure you want to delete <?= $cv['time']; ?>?')"href="autoconfigbackup.php?rmver=<?=urlencode($cv['time']);?>">
+ <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_del.gif" width="17" height="17" border="0">
+ </a>
+ </td>
+ </tr>
<?php
$counter++;
endforeach;