From: Colby Warkentin Date: Tue, 23 Apr 2013 23:21:46 +0000 (-0700) Subject: CRM-12413 - Return an error when api-key does not have an associated CMS user X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e6da1b37a622d6120633c051224dbf1e24a4dd65;p=civicrm-core.git 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 --- 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(); + } } }