drupal_auth
modules/drupal/drupal.module, строка 313
- Версии
- 5
drupal_auth($username, $password, $server = FALSE)
Implementation of hook_auth()
.
Код
<?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;
}
}
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии