? 245720_no_uid0_01_D6.patch
? image_captcha/.DS_Store
? image_captcha/fonts/1456Gutenberg.TTF
? image_captcha/fonts/Army.ttf
? image_captcha/fonts/BABYK___.TTF
? image_captcha/fonts/actionj.ttf
? image_captcha/fonts/gnuolane free.ttf
? image_captcha/fonts/skinck.ttf
? image_captcha/fonts/subeve.ttf
? image_captcha/fonts/tiza.ttf
Index: captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v
retrieving revision 1.58.2.6
diff -u -u -p -r1.58.2.6 captcha.module
--- captcha.module	7 Apr 2008 22:25:45 -0000	1.58.2.6
+++ captcha.module	17 May 2008 15:37:03 -0000
@@ -113,6 +113,16 @@ function captcha_requirements($phase) {
       'value' => $t('Already @counter blocked form submissions', array('@counter' => variable_get('captcha_wrong_response_counter', 0))),
       'severity' => REQUIREMENT_INFO,
     );
+    // Check if there is an entry for uid=0 in the users table, this is required
+    // to have working a $_SESSION variable for anonymous users.
+    if (!db_result(db_query('SELECT COUNT(*) FROM {users} WHERE uid=%d', 0))) {
+      $requirements['captcha_no_sessions_for_anonymous'] = array(
+        'title' => $t('CAPTCHA'),
+        'value' => $t('No sessions for anonymous users.'),
+        'description' => $t('There is no entry for uid 0 in the %users table of the database. This disables persistent session data for anonymous users. Because the CAPTCHA module depends on this session data, CAPTCHAs will not work for anonymous users. Add a row for uid 0 to the %users table to resolve this.', array('%users' => 'users')),
+        'severity' => REQUIREMENT_ERROR,
+      );
+    }
   }
   return $requirements;
 }
@@ -323,7 +333,7 @@ function captcha_validate($form, &$form_
   // not that we use $form_state['clicked_button']['#post']['captcha_token']
   // here instead of $form_state['values']['captcha_token'], because the latter
   // contains the captcha_token of the new form, while the former contains
-  // not the captcha token of the posted form.
+  // the captcha token of the posted form.
   $captcha_token = $form_state['clicked_button']['#post']['captcha_token'];
   // Check if captcha_token exists
   if (!isset($_SESSION['captcha'][$form_id][$captcha_token])) {
