? SolrPhpClient
Index: apachesolr.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.admin.inc,v
retrieving revision 1.1.2.36
diff -u -p -r1.1.2.36 apachesolr.admin.inc
--- apachesolr.admin.inc	15 Nov 2009 14:52:28 -0000	1.1.2.36
+++ apachesolr.admin.inc	25 Nov 2009 15:21:11 -0000
@@ -87,8 +87,8 @@ function apachesolr_settings() {
   $form['advanced']['apachesolr_read_only'] = array(
     '#type' => 'radios',
     '#title' => t('Index write access'),
-    '#default_value' => variable_get('apachesolr_read_only', 0),
-    '#options' => array(0 => t('Read and write (normal)'), 1 => t('Read only')),
+    '#default_value' => variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE),
+    '#options' => array(APACHESOLR_READ_WRITE => t('Read and write (normal)'), APACHESOLR_READ_ONLY => t('Read only')),
     '#description' => t('<em>Read only</em> stops this site from sending updates to your search index. Useful for development sites.'),
   );
   return system_settings_form($form);
@@ -140,8 +140,14 @@ function apachesolr_index_page() {
     $output .= $delete_msg;
   }
   $output .= '<p>' . l(t('View more details on the search index contents'), 'admin/reports/apachesolr') . "</p>\n";
+  if (variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE) == APACHESOLR_READ_WRITE) {
   // Display the Delete Index form.
   $output .= drupal_get_form('apachesolr_delete_index_form');
+  }
+  else {
+    drupal_set_message(t('The index is in read-only mode. Options for deleting and re-indexing are therefore not available. The index mode can be changed on the !settings_page', array('!settings_page' => l(t('settings page'), 'admin/settings/apachesolr'))), 'warning'); 
+  }
+  
 
   return $output;
 }
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.12.2.172
diff -u -p -r1.1.2.12.2.172 apachesolr.module
--- apachesolr.module	15 Nov 2009 14:52:28 -0000	1.1.2.12.2.172
+++ apachesolr.module	25 Nov 2009 15:21:11 -0000
@@ -6,6 +6,9 @@
  *   Integration with the Apache Solr search application.
  */
 
+define(APACHESOLR_READ_WRITE, 0);
+define(APACHESOLR_READ_ONLY, 1);
+
 /**
  * Implementation of hook_menu().
  */
