You are here

function drupal_login in Drupal 5

Same name and namespace in other branches
  1. 4 modules/drupal.module \drupal_login()

Callback function from drupal_xmlrpc() for authenticating remote clients.

Remote clients are usually other Drupal instances.

1 string reference to 'drupal_login'
drupal_xmlrpc in modules/drupal/drupal.module
Implementation of hook_xmlrpc().

File

modules/drupal/drupal.module, line 376
Lets users log in using a Drupal ID and can notify a central server about your site.

Code

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;
    }
  }
}