- md5
- 9434f9d24fbbf59e2eef3173535a6d7e
- sha1
- cb1a5ca75d71604ec7cd9a8d4c3bf2ad42ec8ad4
- sha256
- d2868f387882f74c338c8a1aaa96f0f802886ce5496c9969ba73324434649a87
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
<?php
/**
* @package Joomla.Administrator
* @subpackage com_privacy
*
* @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;
/**
* Consents management controller class.
*
* @since 3.9.0
*/
class PrivacyControllerConsents extends JControllerForm
{
/**
* Method to invalidate specific consents.
*
* @return boolean
*
* @since 3.9.0
*/
public function invalidate($key = null, $urlVar = null)
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$ids = $this->input->get('cid', array(), 'array');
if (empty($ids))
{
$this->setError(JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
/** @var PrivacyModelConsents $model */
$model = $this->getModel();
// Publish the items.
if (!$model->invalidate($ids))
{
$this->setError($model->getError());
}
$message = JText::plural('COM_PRIVACY_N_CONSENTS_INVALIDATED', count($ids));
}
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=consents', false), $message);
}
/**
* Method to invalidate all consents of a specific subject.
*
* @return boolean
*
* @since 3.9.0
*/
public function invalidateAll()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$filters = $this->input->get('filter', array(), 'array');
if (isset($filters['subject']) && $filters['subject'] != '')
{
$subject = $filters['subject'];
}
else
{
$this->setError(JText::_('JERROR_NO_ITEMS_SELECTED'));
}
// Get the model.
/** @var PrivacyModelConsents $model */
$model = $this->getModel();
// Publish the items.
if (!$model->invalidateAll($subject))
{
$this->setError($model->getError());
}
$message = JText::_('COM_PRIVACY_CONSENTS_INVALIDATED_ALL');
$this->setRedirect(JRoute::_('index.php?option=com_privacy&view=consents', false), $message);
}
}
The same content is in 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.