[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_config/src/Controller/ -> DisplayController.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_config
   6   *
   7   * @copyright   (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Config\Administrator\Controller;
  12  
  13  use Joomla\CMS\Language\Text;
  14  use Joomla\CMS\MVC\Controller\BaseController;
  15  use Joomla\CMS\Router\Route;
  16  
  17  // phpcs:disable PSR1.Files.SideEffects
  18  \defined('_JEXEC') or die;
  19  // phpcs:enable PSR1.Files.SideEffects
  20  
  21  /**
  22   * Controller for global configuration
  23   *
  24   * @since  1.5
  25   */
  26  class DisplayController extends BaseController
  27  {
  28      /**
  29       * The default view.
  30       *
  31       * @var    string
  32       * @since  1.6
  33       */
  34      protected $default_view = 'application';
  35  
  36  
  37      /**
  38       * Typical view method for MVC based architecture
  39       *
  40       * This function is provide as a default implementation, in most cases
  41       * you will need to override it in your own controllers.
  42       *
  43       * @param   boolean  $cachable   If true, the view output will be cached
  44       * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link InputFilter::clean()}.
  45       *
  46       * @return  static  A \JControllerLegacy object to support chaining.
  47       *
  48       * @since   3.0
  49       * @throws  \Exception
  50       */
  51      public function display($cachable = false, $urlparams = array())
  52      {
  53          $component = $this->input->get('component', '');
  54  
  55          // Make sure com_joomlaupdate and com_privacy can only be accessed by SuperUser
  56          if (
  57              in_array(strtolower($component), array('com_joomlaupdate', 'com_privacy'))
  58              && !$this->app->getIdentity()->authorise('core.admin')
  59          ) {
  60              $this->setRedirect(Route::_('index.php'), Text::_('JERROR_ALERTNOAUTHOR'), 'error');
  61          }
  62  
  63          return parent::display($cachable, $urlparams);
  64      }
  65  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer