[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_users/src/Controller/ -> GroupsController.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_users
   6   *
   7   * @copyright   (C) 2009 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\Users\Administrator\Controller;
  12  
  13  use Joomla\CMS\Access\Exception\NotAllowed;
  14  use Joomla\CMS\Language\Text;
  15  use Joomla\CMS\MVC\Controller\AdminController;
  16  
  17  // phpcs:disable PSR1.Files.SideEffects
  18  \defined('_JEXEC') or die;
  19  // phpcs:enable PSR1.Files.SideEffects
  20  
  21  /**
  22   * User groups list controller class.
  23   *
  24   * @since  1.6
  25   */
  26  class GroupsController extends AdminController
  27  {
  28      /**
  29       * @var     string  The prefix to use with controller messages.
  30       * @since   1.6
  31       */
  32      protected $text_prefix = 'COM_USERS_GROUPS';
  33  
  34      /**
  35       * Proxy for getModel.
  36       *
  37       * @param   string  $name    The model name. Optional.
  38       * @param   string  $prefix  The class prefix. Optional.
  39       * @param   array   $config  Configuration array for model. Optional.
  40       *
  41       * @return  object  The model.
  42       *
  43       * @since   1.6
  44       */
  45      public function getModel($name = 'Group', $prefix = 'Administrator', $config = array('ignore_request' => true))
  46      {
  47          return parent::getModel($name, $prefix, $config);
  48      }
  49  
  50      /**
  51       * Removes an item.
  52       *
  53       * Overrides Joomla\CMS\MVC\Controller\AdminController::delete to check the core.admin permission.
  54       *
  55       * @return  void
  56       *
  57       * @since   1.6
  58       */
  59      public function delete()
  60      {
  61          if (!$this->app->getIdentity()->authorise('core.admin', $this->option)) {
  62              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
  63          }
  64  
  65          parent::delete();
  66      }
  67  
  68      /**
  69       * Method to publish a list of records.
  70       *
  71       * Overrides Joomla\CMS\MVC\Controller\AdminController::publish to check the core.admin permission.
  72       *
  73       * @return  void
  74       *
  75       * @since   1.6
  76       */
  77      public function publish()
  78      {
  79          if (!$this->app->getIdentity()->authorise('core.admin', $this->option)) {
  80              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
  81          }
  82  
  83          parent::publish();
  84      }
  85  
  86      /**
  87       * Changes the order of one or more records.
  88       *
  89       * Overrides Joomla\CMS\MVC\Controller\AdminController::reorder to check the core.admin permission.
  90       *
  91       * @return  boolean  True on success
  92       *
  93       * @since   1.6
  94       */
  95      public function reorder()
  96      {
  97          if (!$this->app->getIdentity()->authorise('core.admin', $this->option)) {
  98              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
  99          }
 100  
 101          return parent::reorder();
 102      }
 103  
 104      /**
 105       * Method to save the submitted ordering values for records.
 106       *
 107       * Overrides Joomla\CMS\MVC\Controller\AdminController::saveorder to check the core.admin permission.
 108       *
 109       * @return  boolean  True on success
 110       *
 111       * @since   1.6
 112       */
 113      public function saveorder()
 114      {
 115          if (!$this->app->getIdentity()->authorise('core.admin', $this->option)) {
 116              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
 117          }
 118  
 119          return parent::saveorder();
 120      }
 121  
 122      /**
 123       * Check in of one or more records.
 124       *
 125       * Overrides Joomla\CMS\MVC\Controller\AdminController::checkin to check the core.admin permission.
 126       *
 127       * @return  boolean  True on success
 128       *
 129       * @since   1.6
 130       */
 131      public function checkin()
 132      {
 133          if (!$this->app->getIdentity()->authorise('core.admin', $this->option)) {
 134              throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
 135          }
 136  
 137          return parent::checkin();
 138      }
 139  }


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