- md5
- 27afeb5c4f121980f201338e639dcd22
- sha1
- bb0531730891e560a1892b9ecf6834d9a2164892
- sha256
- b60cb67fc478863b5b3e5c0b8b8fb85e59208e9b4eb4a0fa28fe8e4267972add
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
<?php
/**
* @package Joomla.Plugin
* @subpackage Privacy.actionlogs
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\User\User;
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Component\Privacy\Administrator\Plugin\PrivacyPlugin;
use Joomla\Component\Privacy\Administrator\Table\RequestTable;
use Joomla\Database\ParameterType;
/**
* Privacy plugin managing Joomla actionlogs data
*
* @since 3.9.0
*/
class PlgPrivacyActionlogs extends PrivacyPlugin
{
/**
* Processes an export request for Joomla core actionlog data
*
* @param RequestTable $request The request record being processed
* @param User $user The user account associated with this request if available
*
* @return \Joomla\Component\Privacy\Administrator\Export\Domain[]
*
* @since 3.9.0
*/
public function onPrivacyExportRequest(RequestTable $request, User $user = null)
{
if (!$user)
{
return array();
}
$domain = $this->createDomain('user_action_logs', 'joomla_user_action_logs_data');
$db = $this->db;
$query = $db->getQuery(true)
->select(['a.*', $db->quoteName('u.name')])
->from($db->quoteName('#__action_logs', 'a'))
->join('INNER', $db->quoteName('#__users', 'u'), $db->quoteName('a.user_id') . ' = ' . $db->quoteName('u.id'))
->where($db->quoteName('a.user_id') . ' = :id')
->bind(':id', $user->id, ParameterType::INTEGER);
$db->setQuery($query);
$data = $db->loadObjectList();
if (!count($data))
{
return array();
}
$data = ActionlogsHelper::getCsvData($data);
$isFirst = true;
foreach ($data as $item)
{
if ($isFirst)
{
$isFirst = false;
continue;
}
$domain->addItem($this->createItemFromArray($item));
}
return array($domain);
}
}
The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.