function blogapi_validate_user

6.x blogapi.module blogapi_validate_user($username, $password)

Ensure that the given user has permission to edit a blog.

12 calls to blogapi_validate_user()
blogapi_blogger_delete_post in drupal-6.x/modules/blogapi/blogapi.module
Blogging API callback. Removes the specified blog node.
blogapi_blogger_edit_post in drupal-6.x/modules/blogapi/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_blogger_get_post in drupal-6.x/modules/blogapi/blogapi.module
Blogging API callback. Returns a specified blog node.
blogapi_blogger_get_recent_posts in drupal-6.x/modules/blogapi/blogapi.module
Blogging API callback. Returns the latest few postings in a user's blog. $bodies TRUE <a href="http://movabletype.org/docs/mtmanual_programmatic.html#item_mt%2EgetRece... returns a bandwidth-friendly list</a>.
blogapi_blogger_get_users_blogs in drupal-6.x/modules/blogapi/blogapi.module

... See full list

File

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

Code

function blogapi_validate_user($username, $password) {
  global $user;

  $user = user_authenticate(array('name' => $username, 'pass' => $password));

  if ($user->uid) {
    if (user_access('administer content with blog api', $user)) {
      return $user;
    }
    else {
      return t('You do not have permission to edit this blog.');
    }
  }
  else {
    return t('Wrong username or password.');
  }
}