diff --git a/proxy/file.php b/proxy/file.php index 946d32f..5c1c6ce 100644 --- a/proxy/file.php +++ b/proxy/file.php @@ -10,6 +10,8 @@ require_once "config.php"; require_once "proxy.php"; +if (!$target_file) civiproxy_http_error("Feature disabled", 405); + // basic check civiproxy_security_check('file'); diff --git a/proxy/open.php b/proxy/open.php index 0c9501b..9ed172a 100644 --- a/proxy/open.php +++ b/proxy/open.php @@ -10,6 +10,10 @@ require_once "config.php"; require_once "proxy.php"; +// see if mail open tracking is enabled +if (!$target_open) civiproxy_http_error("Feature disabled", 405); + + // basic check civiproxy_security_check('open'); diff --git a/proxy/proxy.php b/proxy/proxy.php index 93d33bc..100e509 100644 --- a/proxy/proxy.php +++ b/proxy/proxy.php @@ -160,6 +160,6 @@ function civiproxy_get_parameters($valid_parameters) { * and ends processing */ function civiproxy_http_error($message, $code = 404) { - header("HTTP/1.1 $code $message"); + header("HTTP/1.1 $code $message (CiviProxy $civiproxy_version)"); exit(); } diff --git a/proxy/rest.php b/proxy/rest.php index 2d588df..21bdc97 100644 --- a/proxy/rest.php +++ b/proxy/rest.php @@ -10,6 +10,9 @@ require_once "config.php"; require_once "proxy.php"; +// see if REST API is enabled +if (!$target_rest) civiproxy_http_error("Feature disabled", 405); + // basic check if (!civiproxy_security_check('rest')) { diff --git a/proxy/url.php b/proxy/url.php index e4fb355..a1ca659 100644 --- a/proxy/url.php +++ b/proxy/url.php @@ -10,6 +10,9 @@ require_once "config.php"; require_once "proxy.php"; +// see if URL tracking is enabled +if (!$target_url) civiproxy_http_error("Feature disabled", 405); + // basic check civiproxy_security_check('url');