summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-14 22:48:45 +0000
committerErmal <eri@pfsense.org>2010-12-14 22:48:45 +0000
commitf5c05fcc613728bc5a18898b4799e8e5a8df7529 (patch)
tree352f38b948993e35d37552b04bef9b02e35d380c /etc/inc/voucher.inc
parent666bc4d16174a67f72e3487f9b125ea890739fc0 (diff)
downloadpfsense-f5c05fcc613728bc5a18898b4799e8e5a8df7529.zip
pfsense-f5c05fcc613728bc5a18898b4799e8e5a8df7529.tar.gz
Make voucher xmlrpc error checking the same as others.
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 59f4a98..f7cd1d5 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -63,14 +63,12 @@ EOF;
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
$cli->setCredentials($username, $password);
$resp = $cli->send($msg, "250");
- if(!$resp) {
+ if(!is_object($resp)) {
$error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
log_error($error);
file_notice("CaptivePortalVoucherSync", $error, "Communications error occurred", "");
return array("timeleft" => "0");
} elseif($resp->faultCode()) {
- $cli->setDebug(1);
- $resp = $cli->send($msg, "250");
$error = "An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
log_error($error);
file_notice("CaptivePortalVoucherSync", $error, "Error code received", "");
@@ -84,7 +82,8 @@ EOF;
write_config("Captive Portal Voucher database synchronized with {$url}");
voucher_configure();
}
- return $toreturn['timeleft'];
+
+ return $toreturn['timeleft'];
}
/*
OpenPOWER on IntegriCloud