| Versions | |
|---|---|
| 4.7 – 5 | drupal_login($username, $password) |
Callback function from drupal_xmlrpc() for authenticating remote clients.
Remote clients are usually other Drupal instances.
modules/
<?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;
}
}
}
?>