Makes the two functions of drupal.module -- remote authentication
and the remote directory -- separately configurable.

http://drupal.org/node/12143


--- drupal.module	Mon Jan 10 16:00:02 2005
+++ drupal.module	Sat Mar  5 14:17:14 2005
@@ -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 <a href=\"%drupal-sites\">Drupal sites</a> page. Requires the cron feature to be enabled.", array("%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%drupal-sites" => "http://www.drupal.org/drupal-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	Wed Apr 13 14:02:23 2005
+++ user.module	Tue Apr 19 14:27:58 2005
@@ -780,7 +780,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;
