|
|
@ -21,12 +21,25 @@ function fulcrm_webhook_menu() {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$items[ 'admin/config/services/fulcrm/webhook' ] = array( 'page callback' => 'fulcrm_webhook_admin',
|
|
|
|
$items[ 'admin/config/services/fulcrm/webhook' ] = array( 'page callback' => 'fulcrm_webhook_admin',
|
|
|
|
'file' => 'fulcrm_webhook.admin.inc',
|
|
|
|
'file' => 'fulcrm_webhook.admin.inc',
|
|
|
|
'title' => 'fulcrm webhook',
|
|
|
|
'title' => 'fulcrm webhooks',
|
|
|
|
'description' => 'Configuring webhooks for fulcrm.org.',
|
|
|
|
'description' => 'Configure webhooks for fulcrm.org.',
|
|
|
|
'access callback' => 'user_access',
|
|
|
|
'access callback' => 'user_access',
|
|
|
|
'access arguments' => array('administer fulcrm webhooks'),
|
|
|
|
'access arguments' => array('administer fulcrm webhooks'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
$items[ 'services/fulcrm/webhook/%' ] = array( 'page callback' => 'fulcrm_webhook_webhook',
|
|
|
|
|
|
|
|
'page arguments' => array(3),
|
|
|
|
|
|
|
|
'type' => MENU_CALLBACK,
|
|
|
|
|
|
|
|
'access callback' => 'user_access',
|
|
|
|
|
|
|
|
'access arguments' => array('access content'),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function fulcrm_webhook_webhook( $uuid ) {
|
|
|
|
|
|
|
|
if ( $uuid === variable_get( 'fulcrm_webhook_url' ) ) {
|
|
|
|
|
|
|
|
drupal_json_output( array( 'status' => 'ok' ) );
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
drupal_json_output( array( 'error' => 'incorrect webhook UUID' ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|