You are here

function og_xmlrpc_get_all_subscribers in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_xmlrpc.inc \og_xmlrpc_get_all_subscribers()
  2. 5 og_xmlrpc.inc \og_xmlrpc_get_all_subscribers()
  3. 5.2 og_xmlrpc.inc \og_xmlrpc_get_all_subscribers()
  4. 5.3 og_xmlrpc.inc \og_xmlrpc_get_all_subscribers()
  5. 5.7 og_xmlrpc.inc \og_xmlrpc_get_all_subscribers()
  6. 6.2 includes/og.xmlrpc.inc \og_xmlrpc_get_all_subscribers()
1 string reference to 'og_xmlrpc_get_all_subscribers'
og_xmlrpc in ./og.module
Implementation of hook_xmlrpc(). /*

File

includes/og.xmlrpc.inc, line 21

Code

function og_xmlrpc_get_all_subscribers($username, $password, $gid, $min_is_active, $min_is_admin) {
  $account = user_authenticate($username, $password);
  if ($account->uid) {
    if (in_array($gid, array_keys($account->og_groups)) || user_access('administer organic groups', $account)) {
      $sql = og_list_users_sql($min_is_active, $min_is_admin);
      $result = db_query($sql, $gid);
      while ($row = db_fetch_array($result)) {
        $users[$row['uid']] = $row;
      }
      return $users;
    }
    else {
      return og_xmlrpc_error(t('User is not a member of the specified group.'));
    }
  }
  else {
    return og_xmlrpc_error(t('Wrong username or password.'));
  }
}