<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
static $_processed = NULL;
+ /**
+ * @param $id
+ * @param string $table
+ *
+ * @return array|null
+ */
static function &lastModified($id, $table = 'civicrm_contact') {
$log = new CRM_Core_DAO_Log();
$log->save();
}
+ /**
+ * @param $contactID
+ * @param $tableName
+ * @param $tableID
+ * @param null $userID
+ */
static function register($contactID,
$tableName,
$tableID,
$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;
}
/**
* Function to get log record count for a Contact
*
- * @param int $contactId Contact ID
+ * @param $contactID
+ *
+ * @internal param int $contactId Contact ID
*
* @return int count of log records
* @access public
CRM_Report_BAO_ReportInstance::retrieve($params, $instance);
if (!empty($instance) &&
- (!CRM_Utils_Array::value('permission', $instance) ||
- (CRM_Utils_Array::value('permission', $instance) && CRM_Core_Permission::check($instance['permission']))
+ (empty($instance['permission']) ||
+ (!empty($instance['permission']) && CRM_Core_Permission::check($instance['permission']))
)
) {
return $instance['id'];