summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-05-28 08:26:25 +0000
committerErmal <eri@pfsense.org>2013-05-28 08:26:51 +0000
commit368d34c31aed69fe5f0c44814367a2658f4b4bc0 (patch)
treed1393a447b2b0c4a657c30f1d8b10a220d1b5b22 /etc/inc/voucher.inc
parent5bf53285961945e8168b54fada99bbd206a9e764 (diff)
downloadpfsense-368d34c31aed69fe5f0c44814367a2658f4b4bc0.zip
pfsense-368d34c31aed69fe5f0c44814367a2658f4b4bc0.tar.gz
Fixes #3001, Check the protocol of the webgui to determine if https is being used for custom ports.
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc21
1 files changed, 18 insertions, 3 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 5b392bb..e19e121 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -40,7 +40,12 @@ if(!function_exists('captiveportal_syslog'))
function xmlrpc_sync_voucher_expire($vouchers, $syncip, $port, $password, $username) {
global $g, $config, $cpzone;
require_once("xmlrpc.inc");
- if ($port == "443")
+
+ $protocol = "http";
+ if (is_array($config['system']) && is_array($config['system']['webgui']) && !empty($config['system']['webgui']['protocol']) &&
+ $config['system']['webgui']['protocol'] == "https")
+ $protocol = "https";
+ if ($protocol == "https" || $port == "443")
$url = "https://{$syncip}";
else
$url = "http://{$syncip}";
@@ -88,7 +93,12 @@ EOF;
function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $username, $term_cause = 1, $stop_time = null) {
global $g, $config, $cpzone;
require_once("xmlrpc.inc");
- if ($port == "443")
+
+ $protocol = "http";
+ if (is_array($config['system']) && is_array($config['system']['webgui']) && !empty($config['system']['webgui']['protocol']) &&
+ $config['system']['webgui']['protocol'] == "https")
+ $protocol = "https";
+ if ($protocol == "https" || $port == "443")
$url = "https://{$syncip}";
else
$url = "http://{$syncip}";
@@ -140,7 +150,12 @@ EOF;
function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password, $username) {
global $g, $config, $cpzone;
require_once("xmlrpc.inc");
- if ($port == "443")
+
+ $protocol = "http";
+ if (is_array($config['system']) && is_array($config['system']['webgui']) && !empty($config['system']['webgui']['protocol']) &&
+ $config['system']['webgui']['protocol'] == "https")
+ $protocol = "https";
+ if ($protocol == "https" || $port == "443")
$url = "https://{$syncip}";
else
$url = "http://{$syncip}";
OpenPOWER on IntegriCloud