added switches

This commit is contained in:
systopia 2015-02-13 10:09:21 +01:00
parent 6e471c71b8
commit 1c21ed90fe
5 changed files with 13 additions and 1 deletions

View File

@ -10,6 +10,8 @@
require_once "config.php"; require_once "config.php";
require_once "proxy.php"; require_once "proxy.php";
if (!$target_file) civiproxy_http_error("Feature disabled", 405);
// basic check // basic check
civiproxy_security_check('file'); civiproxy_security_check('file');

View File

@ -10,6 +10,10 @@
require_once "config.php"; require_once "config.php";
require_once "proxy.php"; require_once "proxy.php";
// see if mail open tracking is enabled
if (!$target_open) civiproxy_http_error("Feature disabled", 405);
// basic check // basic check
civiproxy_security_check('open'); civiproxy_security_check('open');

View File

@ -160,6 +160,6 @@ function civiproxy_get_parameters($valid_parameters) {
* and ends processing * and ends processing
*/ */
function civiproxy_http_error($message, $code = 404) { function civiproxy_http_error($message, $code = 404) {
header("HTTP/1.1 $code $message"); header("HTTP/1.1 $code $message (CiviProxy $civiproxy_version)");
exit(); exit();
} }

View File

@ -10,6 +10,9 @@
require_once "config.php"; require_once "config.php";
require_once "proxy.php"; require_once "proxy.php";
// see if REST API is enabled
if (!$target_rest) civiproxy_http_error("Feature disabled", 405);
// basic check // basic check
if (!civiproxy_security_check('rest')) { if (!civiproxy_security_check('rest')) {

View File

@ -10,6 +10,9 @@
require_once "config.php"; require_once "config.php";
require_once "proxy.php"; require_once "proxy.php";
// see if URL tracking is enabled
if (!$target_url) civiproxy_http_error("Feature disabled", 405);
// basic check // basic check
civiproxy_security_check('url'); civiproxy_security_check('url');