drupal_auth

5 drupal.module drupal_auth($username, $password, $server = FALSE)

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;
    }
  }
}
Login or register to post comments