Common subdirectories: coresearches_orig/CVS and coresearches/CVS
diff -Nup coresearches_orig/coresearches.info coresearches/coresearches.info
--- coresearches_orig/coresearches.info	1969-12-31 16:00:00.000000000 -0800
+++ coresearches/coresearches.info	2007-12-18 11:04:33.000000000 -0800
@@ -0,0 +1,5 @@
+; $Id: $
+name = Core searches
+description = Allows selective disabling of user and node searching on the search settings page.
+package = Search
+dependencies = search
diff -Nup coresearches_orig/coresearches.install coresearches/coresearches.install
--- coresearches_orig/coresearches.install	1969-12-31 16:00:00.000000000 -0800
+++ coresearches/coresearches.install	2007-12-18 11:27:31.484375000 -0800
@@ -0,0 +1,5 @@
+<?php
+
+function coresearches_install() {
+  db_query("UPDATE {system} SET weight = -10 WHERE name = 'coresearches'");
+}
diff -Nup coresearches_orig/coresearches.module coresearches/coresearches.module
--- coresearches_orig/coresearches.module	1969-12-31 16:00:00.000000000 -0800
+++ coresearches/coresearches.module	2007-12-18 12:04:05.140625000 -0800
@@ -0,0 +1,91 @@
+<?php
+// $Id: $
+
+/**
+ * @file
+ * Makes user and node searching optional.
+ */
+
+/**
+ * Implementation of hook_menu().
+ */
+function coresearches_menu($may_cache) {
+  $items = array();
+
+  if (!$may_cache && arg(0) == 'search') {
+    $keys = search_get_keys();
+    $keys = strlen($keys) ? '/'. $keys : '';
+    $types = _coresearches_options();
+
+    $settings = variable_get('coresearches_types', $types);
+    foreach ($types as $type) {
+      if (!$settings[$type]) {
+        $items[] = array(
+          'path' => 'search/'. $type . $keys,
+          'access' => FALSE,
+        );
+      }
+    }
+  }
+
+  return $items;
+}
+
+/**
+ * Implementation of hook_form_alter().
+ *
+ * Add advanced fieldset to nodeprofile search forms.
+ */
+function coresearches_form_alter($form_id, &$form) {
+  if ($form_id == 'search_admin_settings') {
+    $options = _coresearches_options();
+    $form['coresearches'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Enabled search types'),
+      '#description' => t('Select the search types you wish to enable.'),
+      '#weight' => 0,
+    );
+    $form['coresearches']['coresearches_types'] = array(
+      '#type' => 'checkboxes',
+      '#default_value' => variable_get('coresearches_types', $options),
+      '#options' => drupal_map_assoc($options),
+    );
+  }
+  // By default node is set as the search type for search boxes.
+  // We may need to override this.
+  elseif (in_array($form_id, array('search_theme_form', 'search_block_form'))) {
+    $form['#submit']['coresearches_search_box_form_submit'] = array();
+  }
+}
+
+/**
+ * Process a block search form submission.
+ *
+ * If node searching is disabled, set the first enabled search implementation as the default. 
+ */
+function coresearches_search_box_form_submit($form_id, $form_values) {
+  $types = module_implements('search');
+  $coresearch_types = _coresearches_options();
+
+  $settings = variable_get('coresearches_types', $coresearch_types);
+  // If node is not disabled, return (leave it as the default).
+  if ($settings['node']) {
+    return;
+  }
+  foreach ($types as $key => $type) {
+    if (in_array($type, $coresearch_types) && !$settings[$type]) {
+      unset($types[$key]);
+    }
+  }
+  return 'search/'. current($types) .'/'. trim($form_values[$form_id .'_keys']);
+}
+
+/**
+ * Return a list of configurable search types.
+ */
+function _coresearches_options() {
+  // For now, we offer only node and user.
+  // $types = module_implements('search');
+  $types = array('node', 'user');
+  return $types;
+}
\ No newline at end of file
