You are here

function og_xmlrpc_get_user_groups in Organic groups 6

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

File

includes/og.xmlrpc.inc, line 41

Code

function og_xmlrpc_get_user_groups($username, $password, $uid) {
  $caller = user_authenticate($username, $password);
  if ($caller->uid) {
    if ($caller->uid == $uid || user_access('administer organic groups', $caller)) {
      return og_get_subscriptions($uid);
    }
    else {
      return og_xmlrpc_error(t('User is not allowed to retrieve membership information for another user.'));
    }
  }
  else {
    return og_xmlrpc_error(t('Wrong username or password.'));
  }
}