/*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ ini_set('include_path', dirname(dirname(__FILE__))); require_once "proxy.php"; // see if mailing subscribe feature is enabled if (empty($mail_subscription_user_key)) { civiproxy_http_error("Feature disabled", 405); } // basic check civiproxy_security_check('mail-subscribe'); // LOAD VISIBLE GROUPS $group_query = civicrm_api3('Group', 'get', array('visibility' => 'Public Pages', 'is_hidden' => 0, 'is_active' => 1, 'api_key' => $mail_subscription_user_key)); if (!empty($group_query['is_error'])) { civiproxy_http_error($group_query['error_message'], 500); } else { $groups = $group_query['values']; if (empty($groups)) { civiproxy_http_error("No newsletter groups found!", 500); } } // VERIFY / CHECK PARAMETERS $parameter_errors = array(); if (!empty($_REQUEST['email'])) { // get parameters $email = $_REQUEST['email'];
/*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ ini_set('include_path', dirname(dirname(__FILE__))); require_once "proxy.php"; // see if mail open tracking is enabled if (!$mail_subscription_user_key) { civiproxy_http_error("Feature disabled", 405); } // basic check civiproxy_security_check('mail-confirm'); // basic restraints $valid_parameters = array('sid' => 'int', 'cid' => 'int', 'h' => 'hex'); $parameters = civiproxy_get_parameters($valid_parameters); // check if parameters specified if (empty($parameters['sid'])) { civiproxy_http_error("Missing/invalid parameter 'sid'."); } if (empty($parameters['cid'])) { civiproxy_http_error("Missing/invalid parameter 'cid'."); } if (empty($parameters['h'])) { civiproxy_http_error("Missing/invalid parameter 'h'."); } // PERFORM UNSUBSCRIBE $group_query = civicrm_api3('MailingEventConfirm', 'create', array('subscribe_id' => $parameters['sid'], 'contact_id' => $parameters['cid'], 'hash' => $parameters['h'], 'api_key' => $mail_subscription_user_key));
<?php /*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ 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'); // basic restraints $valid_parameters = array('u' => 'int', 'q' => 'int', 'qid' => 'int'); $parameters = civiproxy_get_parameters($valid_parameters); civiproxy_redirect($target_url, $parameters);
<?php /*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ 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'); // basic restraints $valid_parameters = array('q' => 'int'); $parameters = civiproxy_get_parameters($valid_parameters); civiproxy_redirect($target_open, $parameters);
<?php /*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ ini_set('include_path', dirname(dirname(__FILE__))); require_once "proxy.php"; // see if mail open tracking is enabled if (!$mail_subscription_user_key) { civiproxy_http_error("Feature disabled", 405); } // basic check civiproxy_security_check('mail-optout'); civiproxy_http_error("Sorry, opt-out not yet implemented", 405);
<?php /*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ ini_set('include_path', dirname(dirname(__FILE__))); require_once "proxy.php"; // see if mail open tracking is enabled if (!$target_mail_view) { civiproxy_http_error("Feature disabled", 405); } // basic check civiproxy_security_check('mail-view'); // basic restraints $valid_parameters = array('id' => 'int'); $parameters = civiproxy_get_parameters($valid_parameters); // check if id specified if (empty($parameters['id'])) { civiproxy_http_error("Resource not found"); } civiproxy_redirect($target_mail_view, $parameters);
/*--------------------------------------------------------+ | SYSTOPIA CiviProxy | | a simple proxy solution for external access to CiviCRM | | Copyright (C) 2015 SYSTOPIA | | Author: B. Endres (endres -at- systopia.de) | | http://www.systopia.de/ | +---------------------------------------------------------*/ require_once "config.php"; require_once "proxy.php"; // see if file caching is enabled if (!$target_file) { civiproxy_http_error("Feature disabled", 405); } // basic check civiproxy_security_check('file'); // basic restraints $valid_parameters = array('id' => 'string'); $parameters = civiproxy_get_parameters($valid_parameters); // check if id specified if (empty($parameters['id'])) { civiproxy_http_error("Resource not found"); } // check restrictions if (!empty($file_cache_exclude)) { foreach ($file_cache_exclude as $pattern) { if (preg_match($pattern, $parameters['id'])) { civiproxy_http_error("Invalid Resource", 403); } } }