- md5
- 277a97ac6be25af148fb7e53e1825f7b
- sha1
- 8b5127647641f3de1c47cb19225b09d1b01fd1b4
- sha256
- ec4a85f7bb61182970c4b91130254c6e741a548aa4cdf2482dbc4b2b9634ee29
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
<?php
/**
* @package Joomla.Site
* @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
*/
namespace Joomla\Component\Privacy\Site\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
/**
* Privacy Controller
*
* @since 3.9.0
*/
class DisplayController extends BaseController
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return $this
*
* @since 3.9.0
*/
public function display($cachable = false, $urlparams = [])
{
$view = $this->input->get('view', $this->default_view);
// Submitting information requests through the frontend is restricted to authenticated users at this time
if ($view === 'request' && Factory::getUser()->guest)
{
$this->setRedirect(
Route::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=request'), false)
);
return $this;
}
// Set a Referrer-Policy header for views which require it
if (in_array($view, ['confirm', 'remind']))
{
Factory::getApplication()->setHeader('Referrer-Policy', 'no-referrer', true);
}
return parent::display($cachable, $urlparams);
}
}
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.