Skip to content

Commit

Permalink
minor adjustments to #26
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Mar 21, 2018
1 parent 324b8c2 commit f5d0dc8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
5 changes: 5 additions & 0 deletions proxy/callback.functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/*--------------------------------------------------------+
| SYSTOPIA CiviProxy |
| a simple proxy solution for external access to CiviCRM |
| Author: McAndrews ([email protected]|
+---------------------------------------------------------*/

function civiproxy_callback_validate_request_method($expected, $actual){
if(is_array($expected) && in_array($actual, $expected)){
Expand Down
6 changes: 6 additions & 0 deletions proxy/callback.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/*--------------------------------------------------------+
| SYSTOPIA CiviProxy |
| a simple proxy solution for external access to CiviCRM |
| Author: McAndrews ([email protected]|
+---------------------------------------------------------*/

// Handles callback URLs as follows:
// 1. Validates callback
// 2. Passes to civicrm if the payload passes validation
Expand Down
26 changes: 18 additions & 8 deletions proxy/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
** 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>";
Expand Down Expand Up @@ -118,13 +123,18 @@
),
);

$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'
)
);

0 comments on commit f5d0dc8

Please sign in to comment.