--- drupal.module Tue Oct 19 21:00:22 2004 +++ drupal.module Tue Oct 26 15:51:52 2004 @@ -44,6 +44,7 @@ function drupal_settings() { $output = form_textfield(t('Drupal XML-RPC server'), 'drupal_server', variable_get('drupal_server', 'http://www.drupal.org/xmlrpc.php'), 55, 128, t('The URL of your root Drupal XML-RPC server.')); $output .= form_radios(t('Drupal directory'), 'drupal_directory', variable_get('drupal_directory', 0), array(t('Disabled'), t('Enabled')), t("If enabled, your Drupal site will make itself known to the Drupal directory at the specified Drupal XML-RPC server. For this to work properly, you must set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"%drupal-xml-rpc\", your web site will get listed on the Drupal sites page. Requires the cron feature to be enabled.", array("%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%drupal-sites" => "http://www.drupal.org/sites/"))); + $output .= form_radios(t('Drupal authentication'), 'drupal_authenticate', variable_get('drupal_authenticate', 0), array(t('Disabled'), t('Enabled')), t("If enabled, users will be able to log in using a user name from the specified Drupal XML-RPC server.")); return $output; } @@ -152,15 +153,18 @@ function drupal_notify($server) { * Implementation of hook_info(). */ function drupal_info($field = 0) { - $info['name'] = 'Drupal'; - $info['protocol'] = 'XML-RPC'; + if (variable_get('drupal_authenticate', 0)) { + $info['name'] = 'Drupal'; + $info['protocol'] = 'XML-RPC'; - if ($field) { - return $info[$field]; - } - else { - return $info; + if ($field) { + return $info[$field]; + } + else { + return $info; + } } + return NULL; } /** @@ -168,15 +172,17 @@ function drupal_info($field = 0) { */ function drupal_auth($username, $password, $server) { - $message = new xmlrpcmsg('drupal.login', array(new xmlrpcval($username, 'string'), new xmlrpcval($password, 'string'))); + if (variable_get('drupal_authenticate', 0)) { + $message = new xmlrpcmsg('drupal.login', array(new xmlrpcval($username, 'string'), new xmlrpcval($password, 'string'))); - // TODO remove hard coded Port 80 - // TODO manage server/path such that HTTP_HOST/xml.rpc.php is not assumed - $client = new xmlrpc_client('/xmlrpc.php', $server, 80); - $result = $client->send($message, 5); - if ($result && !$result->faultCode()) { - $value = $result->value(); - $login = $value->scalarval(); + // TODO remove hard coded Port 80 + // TODO manage server/path such that HTTP_HOST/xml.rpc.php is not assumed + $client = new xmlrpc_client('/xmlrpc.php', $server, 80); + $result = $client->send($message, 5); + if ($result && !$result->faultCode()) { + $value = $result->value(); + $login = $value->scalarval(); + } } return $login; --- user.module Tue Oct 19 21:00:22 2004 +++ user.module Tue Oct 26 15:43:32 2004 @@ -760,7 +760,9 @@ function user_auth_help_links() { $links = array(); foreach (module_list() as $module) { if (module_hook($module, 'auth')) { - $links[] = l(module_invoke($module, 'info', 'name'), "user/help#$module"); + if ($link = l(module_invoke($module, 'info', 'name'), "user/help#$module")) { + $links[] = $links; + } } } return $links;