You are here

function _acl_get_usernames in ACL 7

Implementation of acl_get_usernames().

2 calls to _acl_get_usernames()
acl_get_usernames in ./acl.module
Get the user names of an ACL.
_acl_edit_form in ./acl.admin.inc
Implementation of acl_edit_form().

File

./acl.admin.inc, line 11
Implementations of administration functions for the acl module.

Code

function _acl_get_usernames($acl_id) {
  $users = array();
  $result = db_query("SELECT u.uid, u.name FROM {users} u LEFT JOIN {acl_user} aclu ON aclu.uid = u.uid WHERE acl_id = :acl_id", array(
    'acl_id' => $acl_id,
  ));
  foreach ($result as $user) {
    $users[$user->uid] = _acl_format_username($user);
  }
  return $users;
}