blogapi_validate_user

Versions
4.6 – 6
blogapi_validate_user($username, $password)

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

▾ 11 functions call blogapi_validate_user()

blogapi_blogger_delete_post in modules/blogapi.module
Blogging API callback. Removes the specified blog node.
blogapi_blogger_edit_post in modules/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_blogger_get_post in modules/blogapi.module
Blogging API callback. Returns a specified blog node.
blogapi_blogger_get_recent_posts in modules/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%2EgetRecentPostTitles"> returns a bandwidth-friendly list</a>.
blogapi_blogger_get_users_blogs in modules/blogapi.module
blogapi_blogger_get_user_info in modules/blogapi.module
Blogging API callback. Returns profile information about a user.
blogapi_blogger_new_post in modules/blogapi.module
Blogging API callback. Inserts a new blog post as a node.
blogapi_metaweblog_new_media_object in modules/blogapi.module
Blogging API callback. Inserts a file into Drupal.
blogapi_mt_get_post_categories in modules/blogapi.module
Blogging API callback. Returns a list of the taxonomy terms that are assigned to a particular node.
blogapi_mt_set_post_categories in modules/blogapi.module
Blogging API callback. Assigns taxonomy terms to a particular node.
blogap_mti_publish_post in modules/blogapi.module
Blogging API callback. Publishes the given node

Code

modules/blogapi.module, line 510

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

  $user = user_authenticate($username, $password);

  if ($user->uid) {
    if (user_access('edit own blog', $user)) {
      return $user;
    }
    else {
      return message_access();
    }
  }
  else {
    return t('Wrong username or password.');
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.