Source for file user.php

Documentation is available at user.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_users
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * User controller class.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_users
  17.  * @since       1.6
  18.  */
  19. {
  20.     /**
  21.      * @var    string  The prefix to use with controller messages.
  22.      * @since  1.6
  23.      */
  24.     protected $text_prefix = 'COM_USERS_USER';
  25.  
  26.     /**
  27.      * Overrides JControllerForm::allowEdit
  28.      *
  29.      * Checks that non-Super Admins are not editing Super Admins.
  30.      *
  31.      * @param   array   $data  An array of input data.
  32.      * @param   string  $key   The name of the key for the primary key.
  33.      *
  34.      * @return  boolean  True if allowed, false otherwise.
  35.      *
  36.      * @since   1.6
  37.      */
  38.     protected function allowEdit($data array()$key 'id')
  39.     {
  40.         // Check if this person is a Super Admin
  41.         if (JAccess::check($data[$key]'core.admin'))
  42.         {
  43.             // If I'm not a Super Admin, then disallow the edit.
  44.             if (!JFactory::getUser()->authorise('core.admin'))
  45.             {
  46.                 return false;
  47.             }
  48.         }
  49.  
  50.         return parent::allowEdit($data$key);
  51.     }
  52.  
  53.     /**
  54.      * Method to run batch operations.
  55.      *
  56.      * @param   object  $model  The model.
  57.      *
  58.      * @return  boolean  True on success, false on failure
  59.      *
  60.      * @since   2.5
  61.      */
  62.     public function batch($model null)
  63.     {
  64.         JSession::checkToken(or jexit(JText::_('JINVALID_TOKEN'));
  65.  
  66.         // Set the model
  67.         $model $this->getModel('User'''array());
  68.  
  69.         // Preset the redirect
  70.         $this->setRedirect(JRoute::_('index.php?option=com_users&view=users' $this->getRedirectToListAppend()false));
  71.  
  72.         return parent::batch($model);
  73.     }
  74.  
  75.     /**
  76.      * Function that allows child controller access to model data after the data has been saved.
  77.      *
  78.      * @param   JModelLegacy  $model      The data model object.
  79.      * @param   array         $validData  The validated data.
  80.      *
  81.      * @return  void 
  82.      *
  83.      * @since   3.1
  84.      */
  85.     protected function postSaveHook(JModelLegacy $model$validData array())
  86.     {
  87.         return;
  88.     }
  89. }

Documentation generated on Tue, 19 Nov 2013 15:16:22 +0100 by phpDocumentor 1.4.3