- md5
- c188d1c9da633c0231440885b0633565
- sha1
- 1cea7154db4c0fd241c4713dc0a1252cd70a1a74
- sha256
- b033af59a1db864f2467c29797ec0f54ebb7eb955a49a68e74d3213eea71398f
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
<?php
/**
* @version $Id: group.php 21320 2011-05-11 01:01:37Z dextercowley $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
jimport('joomla.application.component.controllerform');
/**
* User view level controller class.
*
* @package Joomla.Administrator
* @subpackage com_users
* @since 1.6
*/
class UsersControllerGroup extends JControllerForm
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_USERS_GROUP';
/**
* Method to check if you can save a new or existing record.
*
* Overrides JControllerForm::allowSave to check the core.admin permission.
*
* @param array An array of input data.
* @param string The name of the key for the primary key.
*
* @return boolean
* @since 1.6
*/
protected function allowSave($data, $key = 'id')
{
return (JFactory::getUser()->authorise('core.admin', $this->option) && parent::allowSave($data, $key));
}
/**
* Overrides JControllerForm::allowEdit
*
* Checks that non-Super Admins are not editing Super Admins.
*
* @param array An array of input data.
* @param string The name of the key for the primary key.
*
* @return boolean
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check if this group is a Super Admin
if (JAccess::checkGroup($data[$key], 'core.admin')) {
// If I'm not a Super Admin, then disallow the edit.
if (!JFactory::getUser()->authorise('core.admin')) {
return false;
}
}
return parent::allowEdit($data, $key);
}
}
The same content is in 6 releases, Joomla 1.7.0 to 1.7.5. See them all, or every version of this file.