minor adjustments to #26

This commit is contained in:
systopia 2018-03-21 11:31:51 +01:00
parent 324b8c2e96
commit f5d0dc8311
3 changed files with 29 additions and 8 deletions

View File

@ -1,4 +1,9 @@
<?php
/*--------------------------------------------------------+
| SYSTOPIA CiviProxy |
| a simple proxy solution for external access to CiviCRM |
| Author: McAndrews (michaelmcandrew@thirdsectordesign.org|
+---------------------------------------------------------*/
function civiproxy_callback_validate_request_method($expected, $actual){
if(is_array($expected) && in_array($actual, $expected)){

View File

@ -1,4 +1,10 @@
<?php
/*--------------------------------------------------------+
| SYSTOPIA CiviProxy |
| a simple proxy solution for external access to CiviCRM |
| Author: McAndrews (michaelmcandrew@thirdsectordesign.org|
+---------------------------------------------------------*/
// Handles callback URLs as follows:
// 1. Validates callback
// 2. Passes to civicrm if the payload passes validation

View File

@ -36,6 +36,11 @@ $target_mail_view = $target_civicrm . '/civicrm/mailing/view';
** GENERAL OPTIONS **
****************************************************************/
// Set this option to enable or disable callback processing
// The individual callbacks still have to be defined
// by the $callbacks variable, see below
$callbacks_enabled = FALSE;
// This logo is shown if the proxy server is address with a web browser
// add your own logo here
$civiproxy_logo = "<img src='{$proxy_base}/static/images/proxy-logo.png' alt='SYSTOPIA Organisationsberatung'></img>";
@ -118,13 +123,18 @@ $rest_allowed_actions = array(
),
);
$callbacks_enabled = false;
$callbacks = [
'sparkpost' => [
'secret' => '85c573b980c3c248f083f9ca6a175659',
/****************************************************************
** ALLOWED CALLBACKS **
****************************************************************/
// defines the callbacks that are to be forwarded to the target system
// make sure $callbacks_enabled is TRUE for this to work
$callbacks = array(
'sparkpost_example' => array(
'secret' => '85c573b980c3c248f083f9ca6a175659',
'request_method' => 'POST', // single value or array
'content_type' => 'application/json',
'target_path' => 'civicrm/sparkpost/callback'
]
];
'content_type' => 'application/json',
'target_path' => 'civicrm/sparkpost/callback'
)
);