X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FREST.php;h=bd88f4202714681c10023630e54dd0cd59193c12;hb=1e1ed556e29f820a3834d8b1d45e979bca8c720f;hp=35e4e9b1235eca952686494fdac5b436becf3389;hpb=4a0eaf5b01e02c8c3e4504648f5312485d202653;p=civicrm-core.git diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 35e4e9b123..bd88f42027 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.7 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2016 | + | Copyright CiviCRM LLC (c) 2004-2017 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -29,7 +29,7 @@ * This class handles all REST client requests. * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2016 + * @copyright CiviCRM LLC (c) 2004-2017 */ class CRM_Utils_REST { @@ -676,6 +676,7 @@ class CRM_Utils_REST { // Proceed with bootstrap for "?q=civicrm/X/Y" but not "?q=civicrm/ping" if (!empty($q)) { if (count($args) == 2 && $args[1] == 'ping') { + CRM_Utils_System::loadBootStrap(array(), FALSE, FALSE); return NULL; // this is pretty wonky but maybe there's some reason I can't see } if (count($args) != 3) { @@ -691,6 +692,7 @@ class CRM_Utils_REST { // FIXME: At time of writing, this doesn't actually do anything because // authenticateKey abends, but that's a bad behavior which sends a // malformed response. + CRM_Utils_System::loadBootStrap(array(), FALSE, FALSE); return self::error('Failed to authenticate key'); } @@ -699,6 +701,7 @@ class CRM_Utils_REST { $store = NULL; $api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST'); if (empty($api_key)) { + CRM_Utils_System::loadBootStrap(array(), FALSE, FALSE); return self::error("FATAL: mandatory param 'api_key' (user key) missing"); } $contact_id = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key'); @@ -718,6 +721,7 @@ class CRM_Utils_REST { return NULL; } else { + CRM_Utils_System::loadBootStrap(array(), FALSE, FALSE); return self::error('ERROR: No CMS user associated with given api-key'); } }