aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup/autoconfigbackup.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-10-06 21:38:26 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-10-06 21:38:26 +0000
commit41144767c5c34deab860e807a4f1d4075f817dbd (patch)
tree9fb3cb21597fbed9a55c0d78bebdc9789546cca9 /packages/autoconfigbackup/autoconfigbackup.php
parentb926fd176e311640031720351b7d6ea0d90d7636 (diff)
downloadpfsense-packages-41144767c5c34deab860e807a4f1d4075f817dbd.tar.gz
pfsense-packages-41144767c5c34deab860e807a4f1d4075f817dbd.tar.bz2
pfsense-packages-41144767c5c34deab860e807a4f1d4075f817dbd.zip
Correctly POST data to server
Diffstat (limited to 'packages/autoconfigbackup/autoconfigbackup.php')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index acd5568d..ae027c4a 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -38,9 +38,6 @@ $pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
// Seperator used during client / server communications
$oper_sep = "\|\|";
-// URL to restore.php
-$get_url = "https://portal.pfsense.org/pfSconfigbackups/restore.php";
-
// Encryption password
$decrypt_password = $config['installedpackages']['autoconfigbackup']['config'][0]['decrypt_password'];
@@ -50,6 +47,9 @@ $username = $config['installedpackages']['autoconfigbackup']['config'][0]['usern
// Defined password
$password = $config['installedpackages']['autoconfigbackup']['config'][0]['password'];
+// URL to restore.php
+$get_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/restore.php?";
+
if(!$username) {
Header("Location: /pkg_edit.php?xml=autoconfigbackup.xml&id=0");
exit;
@@ -59,7 +59,7 @@ if($_GET['newver'] != "") {
// Phone home and obtain backups
$curl_Session = curl_init($get_url);
curl_setopt($curl_Session, CURLOPT_POST, 1);
- curl_setopt($curl_Session, CURLOPT_POSTFIELDS, "action=restore&username={$username}&password={$password}&revision={$_GET['newver']}");
+ curl_setopt($curl_Session, CURLOPT_POSTFIELDS, "action=restore&revision={$_GET['newver']}");
curl_setopt($curl_Session, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($curl_Session);
if (!tagfile_deformat($data, $data, "config.xml"))
@@ -82,7 +82,7 @@ if($_GET['newver'] != "") {
// Phone home and obtain backups
$curl_Session = curl_init($get_url);
curl_setopt($curl_Session, CURLOPT_POST, 1);
- curl_setopt($curl_Session, CURLOPT_POSTFIELDS, "action=showbackups&username={$username}&password={$password}");
+ curl_setopt($curl_Session, CURLOPT_POSTFIELDS, "action=showbackups");
curl_setopt($curl_Session, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($curl_Session);
curl_close($curl_Session);