CoreFiles by mySites.guru
controller.php49 lines, 1,338 bytes, from Joomla_3.9.0-Stable-Full_Package.zip
Raw History Compare with 3.8.13
md5
96e59b9ee565234350d1bc7ba2022a4f
sha1
d9b3191a09800716b131e004aded6620b2fc62e8
sha256
f99a84e1a2b51045e18f0383ee2902e915c499caf128221fa95a9ff93c69d358
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_privacy
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Privacy Controller
 *
 * @since  3.9.0
 */
class PrivacyController extends JControllerLegacy
{
	/**
	 * 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 = array())
	{
		$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' && JFactory::getUser()->guest)
		{
			$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));

			return $this;
		}

		// Set a Referrer-Policy header for views which require it
		if (in_array($view, array('confirm', 'remind')))
		{
			JFactory::getApplication()->setHeader('Referrer-Policy', 'no-referrer', true);
		}

		return parent::display($cachable, $urlparams);
	}
}

The same content is in 2 releases, Joomla 3.9.0-rc2 to 3.9.0. See them all, or every version of this file.