CoreFiles by mySites.guru
Dispatcher.php48 lines, 1,212 bytes, from Joomla_5.4.2-Stable-Full_Package.zip
Raw History Compare with 5.4.1
md5
aaa3f0e8594b748b9cefd566e8ce0d95
sha1
16d07bade9e76997e506569639bcee5c45efae6d
sha256
d297219a9cf2cc48d294ac5c06092ae917ee52ca4773cd845f6062285175a9c3
<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Contact\Site\Dispatcher;

use Joomla\CMS\Dispatcher\ComponentDispatcher;
use Joomla\CMS\Language\Text;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * ComponentDispatcher class for com_contact
 *
 * @since  4.0.0
 */
class Dispatcher extends ComponentDispatcher
{
    /**
     * Dispatch a controller task. Redirecting the user if appropriate.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function dispatch()
    {
        if ($this->input->get('view') === 'contacts' && $this->input->get('layout') === 'modal') {
            if (!$this->app->getIdentity()->authorise('core.create', 'com_contact')) {
                $this->app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'warning');

                return;
            }

            $this->app->getLanguage()->load('com_contact', JPATH_ADMINISTRATOR);
        }

        parent::dispatch();
    }
}

The same content is in 204 releases, Joomla 4.3.0-rc1 to 6.2.1-rc1. See them all, or every version of this file.