From: Capo Date: Mon, 7 Oct 2013 16:57:03 +0000 (+0200) Subject: Change assignation in log of changes made via API (CRM-13549) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5bd56e68464d87279c6f7262bc3d2318b539559f;p=civicrm-core.git Change assignation in log of changes made via API (CRM-13549) --- diff --git a/CRM/Core/BAO/Log.php b/CRM/Core/BAO/Log.php index 081826474a..4c949445ed 100644 --- a/CRM/Core/BAO/Log.php +++ b/CRM/Core/BAO/Log.php @@ -88,6 +88,14 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { $userID = $session->get('userID'); } + if (!$userID) { + $api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST'); + + if ($api_key && strtolower($api_key) != 'null') { + $userID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key'); + } + } + if (!$userID) { $userID = $contactID; }