getQuery(true) ->select('id') ->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); } }