- md5
- 79ac54bac1a5b2bb3fa74bf7b281fd01
- sha1
- f9ec41901fa324b3e414db78e89b2e7b1c60cb81
- sha256
- 36a1af074e4918218351d35572c062053dc2fd1de35e69947c19a58b5cb1632e
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
<?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('user');
/**
* Supports an modal select of user that have access to com_messages
*
* @package Joomla.Administrator
* @subpackage com_messages
* @since 1.6
*/
class JFormFieldUserMessages extends JFormFieldUser
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
public $type = 'UserMessages';
/**
* Method to get the filtering groups (null means no filtering)
*
* @return array|null array of filtering groups or null.
* @since 1.6
*/
protected function getGroups()
{
// Compute usergroups
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id');
$query->from('#__usergroups');
$db->setQuery($query);
try
{
$groups = $db->loadColumn();
}
catch (RuntimeException $e)
{
JError::raiseNotice(500, $e->getMessage());
return null;
}
foreach ($groups as $i => $group)
{
if (JAccess::checkGroup($group, 'core.admin')) {
continue;
}
if (!JAccess::checkGroup($group, 'core.manage', 'com_messages')) {
unset($groups[$i]);
continue;
}
if (!JAccess::checkGroup($group, 'core.login.admin')) {
unset($groups[$i]);
continue;
}
}
return array_values($groups);
}
/**
* Method to get the users to exclude from the list of users
*
* @return array|null array of users to exclude or null to to not exclude them
* @since 1.6
*/
protected function getExcluded()
{
return array(JFactory::getUser()->id);
}
}
The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.