You are here

function blogapi_blogger_get_user_info in Drupal 4

Same name and namespace in other branches
  1. 5 modules/blogapi/blogapi.module \blogapi_blogger_get_user_info()
  2. 6 modules/blogapi/blogapi.module \blogapi_blogger_get_user_info()

Blogging API callback. Returns profile information about a user.

1 string reference to 'blogapi_blogger_get_user_info'
blogapi_xmlrpc in modules/blogapi.module
Implementation of hook_xmlrpc().

File

modules/blogapi.module, line 165
Enable users to post using applications that support XML-RPC blog APIs.

Code

function blogapi_blogger_get_user_info($appkey, $username, $password) {
  $user = blogapi_validate_user($username, $password);
  if ($user->uid) {
    $name = explode(' ', $user->realname ? $user->realname : $user->name, 2);
    return array(
      'userid' => $user->uid,
      'lastname' => $name[1],
      'firstname' => $name[0],
      'nickname' => $user->name,
      'email' => $user->mail,
      'url' => url('blog/' . $user->uid, NULL, NULL, true),
    );
  }
  else {
    return blogapi_error($user);
  }
}