From e6da1b37a622d6120633c051224dbf1e24a4dd65 Mon Sep 17 00:00:00 2001 From: Colby Warkentin Date: Tue, 23 Apr 2013 16:21:46 -0700 Subject: [PATCH] CRM-12413 - Return an error when api-key does not have an associated CMS user ---------------------------------------- * CRM-12413: CiviCRM does not error on an api-key given through the REST interface that is not connected to a CMS user http://issues.civicrm.org/jira/browse/CRM-12413 --- CRM/Utils/REST.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index a55ca67d66..3fa52d2ddf 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -679,6 +679,11 @@ class CRM_Utils_REST { if ($uid) { CRM_Utils_System::loadBootStrap(array('uid' => $uid), TRUE, FALSE); } + else { + $err = array('error_message' => 'no CMS user associated with given api-key', 'is_error' => 1); + echo self::output($err); + CRM_Utils_System::civiExit(); + } } } -- 2.25.1