drupal_auth

Versions
4.6 – 4.7
drupal_auth($username, $password, $server)
5
drupal_auth($username, $password, $server = FALSE)

Implementation of hook_auth().

Code

modules/drupal/drupal.module, line 313

<?php
function drupal_auth($username, $password, $server = FALSE) {
  if (variable_get('drupal_authentication_service', 0)) {
    if (!$server) {
      $server = variable_get('drupal_default_da_server', '');
    }
    else if (variable_get('drupal_default_da_server_only', 0)) {
      if (variable_get('drupal_default_da_server', '') != $server) {
        return;
      }
    }
    if (!empty($server)) {
      $result = xmlrpc("http://$server/xmlrpc.php", 'drupal.login', $username, $password);
      if ($result === FALSE) {
        drupal_set_message(t('Error %code: %message', array('%code' => xmlrpc_errno(), '%message' => xmlrpc_error_msg())), 'error');
      }
      else {
        return $result;
      }
    }
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.