drupal_login

  1. drupal
    1. 4.7
    2. 5 drupal.module
Versions
4.7 – 5 drupal_login($username, $password)

Callback function from drupal_xmlrpc() for authenticating remote clients.

Remote clients are usually other Drupal instances.

Code

modules/drupal.module, line 353

<?php
function drupal_login($username, $password) {
  if (variable_get('drupal_authentication_service', 0)) {
    if ($user = user_load(array('name' => $username, 'pass' => $password, 'status' => 1))) {
      return $user->uid;
    }
    else {
      return 0;
    }
  }
}
?>