Exemplo n.º 1
0
 public static function getAdminGroups()
 {
     static $groups;
     if (!$groups) {
         require_once JPATH_COMPONENT . '/helpers/users.php';
         $groups = RSMembershipUsersHelper::getAdminGroups();
     }
     return $groups;
 }
Exemplo n.º 2
0
Arquivo: users.php Projeto: JozefAB/qk
 public static function getAdminUsers()
 {
     if (!is_array(self::$users)) {
         self::$users = array();
         if ($groups = self::getAdminGroups()) {
             $ids = array();
             foreach ($groups as $group) {
                 $ids = array_merge($ids, JAccess::getUsersByGroup($group, true));
             }
             $ids = array_unique($ids);
             if ($ids) {
                 $db = JFactory::getDbo();
                 $query = $db->getQuery(true);
                 $query->select('u.*')->from('#__users u')->where('u.id IN (' . implode(',', $ids) . ')')->order('u.username ASC');
                 $db->setQuery($query);
                 self::$users = $db->loadObjectList();
             }
         }
     }
     return self::$users;
 }