You are here

function blogapi_blogger_get_post in Blog API 7.2

Same name and namespace in other branches
  1. 8 modules/blogapi_blogger/blogapi_blogger.module \blogapi_blogger_get_post()
  2. 7 blogapi.module \blogapi_blogger_get_post()

Service callback for blogger.getPost

1 string reference to 'blogapi_blogger_get_post'
blogapi_blogger_services_resources in modules/blogapi_blogger/blogapi_blogger.module
Implements hook_services_resources().

File

modules/blogapi_blogger/blogapi_blogger.module, line 406
Provides Blogger services for BlogAPI

Code

function blogapi_blogger_get_post($appid, $postid, $username, $password) {

  // Validate the user.
  $user = blogapi_validate_user($username, $password);
  $node = node_load($postid);
  if (!node_access('view', $node, $user) || !user_access('administer nodes')) {

    // User does not have permission to view the node.
    return services_error(t('You are not authorized to view post @postid', array(
      '@postid' => $postid,
    )), 403);
  }
  return blogapi_format_post_for_xmlrpc($node, TRUE);
}