function drupal_auth in Drupal 4
Same name and namespace in other branches
- 5 modules/drupal/drupal.module \drupal_auth()
Implementation of hook_auth().
File
- modules/
drupal.module, line 312 - Lets users log in using a Drupal ID and can notify a central server about your site.
Code
function drupal_auth($username, $password, $server) {
if (variable_get('drupal_authentication_service', 0)) {
$result = xmlrpc("http://{$server}/xmlrpc.php", 'drupal.login', $username, $password);
if ($result === FALSE) {
drupal_set_message(t('Error %code : %message', array(
'%code' => theme('placeholder', xmlrpc_errno()),
'%message' => theme('placeholder', xmlrpc_error_msg()),
)), 'error');
}
else {
return $result;
}
}
}