You are here

function og_xmlrpc_subscribe_user in Organic groups 5.3

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

File

./og_xmlrpc.inc, line 4

Code

function og_xmlrpc_subscribe_user($username, $password, $gid, $uid) {
  $admin = user_authenticate($username, $password);
  if ($admin->uid) {
    $account = user_load(array(
      'uid' => $uid,
    ));
    if ($account->uid) {
      $return = og_subscribe_user($gid, $account);
      return $return;
    }
    else {
      return og_xmlrpc_error(t('Unrecognized user ID: %uid.', array(
        '%uid' => $uid,
      )));
    }
  }
  else {
    return og_xmlrpc_error(t('Wrong username or password.'));
  }
}