Index: mollom.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.admin.inc,v
retrieving revision 1.1.2.34
diff -u -p -r1.1.2.34 mollom.admin.inc
--- mollom.admin.inc	3 Sep 2010 18:53:51 -0000	1.1.2.34
+++ mollom.admin.inc	8 Sep 2010 22:09:34 -0000
@@ -456,11 +456,17 @@ function mollom_admin_settings(&$form_st
       // Mollom should work or not.
       drupal_set_message(t('We contacted the Mollom servers to verify your keys: the Mollom services are operating correctly. We are now blocking spam.'));
     }
-    elseif ($status['keys valid'] === NETWORK_ERROR) {
-      drupal_set_message(t('We tried to contact the Mollom servers but we encountered a network error. Please make sure that your web server can make outgoing HTTP requests.'), 'error');
-    }
-    elseif ($status['keys valid'] === MOLLOM_ERROR) {
-      drupal_set_message(t('We contacted the Mollom servers to verify your keys: your keys do not exist or are no longer valid. Please visit the <em>Manage sites</em> page on the Mollom website again: <a href="@mollom-user">@mollom-user</a>.', array('@mollom-user' => 'http://mollom.com/user')), 'error');
+    else {
+      if ($status['keys valid'] === NETWORK_ERROR) {
+        drupal_set_message(t('We tried to contact the Mollom servers but we encountered a network error. Please make sure that your web server can make outgoing HTTP requests.'), 'error');
+      }
+      elseif ($status['keys valid'] === MOLLOM_ERROR) {
+        drupal_set_message(t('We contacted the Mollom servers to verify your keys: your keys do not exist or are no longer valid. Please visit the <em>Manage sites</em> page on the Mollom website again: <a href="@mollom-user">@mollom-user</a>.', array('@mollom-user' => 'http://mollom.com/user')), 'error');
+      }
+      if (!$status['uid0 valid']) {
+        drupal_set_message(t('Missing data record for the anonymous user (uid 0) in the {users} table.'), 'error');
+        watchdog('mollom', 'Missing data record for the anonymous user (uid 0) in the {users} table.', array(), WATCHDOG_EMERG);
+      }
     }
   }
 
Index: mollom.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.info,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 mollom.info
--- mollom.info	17 Nov 2009 17:01:49 -0000	1.2.2.2
+++ mollom.info	8 Sep 2010 22:09:47 -0000
@@ -2,3 +2,7 @@
 name = Mollom
 description = Protects forms against spam.
 core = 6.x
+
+; Support for http://drupal.org/project/module_supports
+conflicts[] = no_anon
+conflicts[] = fbconnect
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.2.2.157
diff -u -p -r1.2.2.157 mollom.module
--- mollom.module	3 Sep 2010 18:53:51 -0000	1.2.2.157
+++ mollom.module	8 Sep 2010 22:18:49 -0000
@@ -1071,6 +1071,7 @@ function _mollom_status($reset = FALSE) 
   // Load stored status.
   $status = variable_get('mollom_status', array(
     'keys valid' => FALSE,
+    'uid0 valid' => TRUE,
   ));
 
   // Both API keys are required.
@@ -1078,9 +1079,25 @@ function _mollom_status($reset = FALSE) 
   $private_key = variable_get('mollom_private_key', '');
   $status['keys'] = (!empty($public_key) && !empty($private_key));
 
-  // If we have keys and are asked to reset, check whether keys are valid.
-  if ($status['keys'] && $reset) {
-    $status['keys valid'] = mollom('mollom.verifyKey');
+  if ($reset) {
+    // If we have keys, check whether keys are valid.
+    if ($status['keys']) {
+      $status['keys valid'] = mollom('mollom.verifyKey');
+    }
+    // Attempt to fix bogus anonymous user id after MySQL import that did not
+    // use SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+    // @see system_status()
+    if (!db_result(db_query_range("SELECT 1 FROM {users} WHERE uid = 0", 0, 1))) {
+      // "uid = 0" would trigger the auto_increment mechanism on MySQL <4.1.1,
+      // even in NO_AUTO_VALUE_ON_ZERO mode.
+      // @see http://drupal.org/node/204411
+      db_query("UPDATE {users} SET uid = uid - uid WHERE name = '' AND pass = '' AND status = 0");
+      if (!db_affected_rows()) {
+        $status['uid0 valid'] = FALSE;
+      }
+    }
+
+    // Update stored status.
     variable_set('mollom_status', $status);
   }
 
