aboutsummaryrefslogtreecommitdiffstats
path: root/config/autoconfigbackup/autoconfigbackup_stats.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/autoconfigbackup/autoconfigbackup_stats.php')
-rw-r--r--config/autoconfigbackup/autoconfigbackup_stats.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/config/autoconfigbackup/autoconfigbackup_stats.php b/config/autoconfigbackup/autoconfigbackup_stats.php
index c024d689..b991e3d3 100644
--- a/config/autoconfigbackup/autoconfigbackup_stats.php
+++ b/config/autoconfigbackup/autoconfigbackup_stats.php
@@ -31,8 +31,8 @@ require("globals.inc");
require("guiconfig.inc");
require("/usr/local/pkg/autoconfigbackup.inc");
-$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
-if(strstr($pfSversion, "1.2"))
+$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+if ($pf_version < 2.0)
require("crypt_acb.php");
// Seperator used during client / server communications
@@ -48,13 +48,13 @@ $username = $config['installedpackages']['autoconfigbackup']['config'][0]['use
$password = $config['installedpackages']['autoconfigbackup']['config'][0]['password'];
// URL to restore.php
-$get_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/restore.php";
+$get_url = "https://portal.pfsense.org/pfSconfigbackups/restore.php";
// URL to delete.php
-$del_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/delete.php";
+$del_url = "https://portal.pfsense.org/pfSconfigbackups/delete.php";
// URL to stats.php
-$stats_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/showstats.php";
+$stats_url = "https://portal.pfsense.org/pfSconfigbackups/showstats.php";
// Set hostname
$hostname = $config['system']['hostname'] . "." . $config['system']['domain'];
@@ -67,6 +67,7 @@ if(!$username) {
if($_REQUEST['delhostname']) {
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL, $del_url);
+ curl_setopt($curl_session, CURLOPT_HTTPHEADER, array("Authorization: Basic " . base64_encode("{$username}:{$password}")));
curl_setopt($curl_session, CURLOPT_POST, 2);
curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
@@ -96,7 +97,7 @@ include("head.inc");
<div id='maincontent'>
<?php
include("fbegin.inc");
- if(strstr($pfSversion, "1.2"))
+ if ($pf_version < 2.0)
echo "<p class=\"pgtitle\">{$pgtitle}</p>";
if($savemsg) {
print_info_box($savemsg);
@@ -138,6 +139,7 @@ include("head.inc");
// Populate available backups
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL, $stats_url);
+ curl_setopt($curl_session, CURLOPT_HTTPHEADER, array("Authorization: Basic " . base64_encode("{$username}:{$password}")));
curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl_session, CURLOPT_POST, 1);
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);