blogapi_validate_user

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 blogapi_validate_user($username, $password)

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

▾ 12 functions call blogapi_validate_user()

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

Code

modules/blogapi/blogapi.module, line 670

<?php
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.');
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen