? LICENSE.txt
Index: mollom.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.install,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 mollom.install
--- mollom.install	1 Nov 2008 17:14:01 -0000	1.1.2.4
+++ mollom.install	22 Mar 2009 19:54:44 -0000
@@ -2,6 +2,11 @@
 // $Id: mollom.install,v 1.1.2.4 2008/11/01 17:14:01 dries Exp $
 
 /**
+ * @file
+ * Install and uninstall functions as well as schema definition for the Mollom module.
+ */
+
+/**
  * Implementation of hook_install().
  */
 function mollom_install() {
@@ -16,7 +21,7 @@ function mollom_install() {
         INDEX (session)
       );");
       break;
-      
+
     case 'pgsql':
       db_query("CREATE TABLE {mollom} (
         did varchar(255) NOT NULL default '',
Index: mollom.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.js,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 mollom.js
--- mollom.js	17 Jun 2008 01:18:53 -0000	1.1.2.3
+++ mollom.js	22 Mar 2009 19:54:44 -0000
@@ -1,3 +1,4 @@
+// $Id$
 
 if (Drupal.jsEnabled) {
   $(function() {
@@ -13,7 +14,7 @@ function getAudioCaptcha() {
   // Retrieve an audio CAPTCHA:
   var data = $.get(Drupal.settings.mollom_base_url + 'mollom/captcha/audio/' + mollomSessionId,
     function(data) {
-     // When data is successfully loaded, empty the captcha-div  
+     // When data is successfully loaded, empty the captcha-div
      // and replace its content with an audio CAPTCHA:
      $('div#captcha').empty().append(data);
 
@@ -30,13 +31,12 @@ function getImageCaptcha() {
   // Retrieve an audio CAPTCHA:
   var data = $.get(Drupal.settings.mollom_base_url + 'mollom/captcha/image/' + mollomSessionId,
     function(data) {
-     // When data is successfully loaded, empty the captcha-div  
+     // When data is successfully loaded, empty the captcha-div
      // and replace its content with an audio CAPTCHA:
      $('div#captcha').empty().append(data);
-     
+
      // Add an onclick-event handler for the new link:
      $('a#audio-captcha').click(getAudioCaptcha);
    });
    return false;
 }
-
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.1.2.35
diff -u -p -r1.1.2.35 mollom.module
--- mollom.module	1 Dec 2008 06:49:16 -0000	1.1.2.35
+++ mollom.module	22 Mar 2009 19:54:49 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: mollom.module,v 1.1.2.35 2008/12/01 06:49:16 dries Exp $
 
+/**
+ * @file
+ * Main file for the Mollom module, which protects against comment and contact form spam..
+ */
+
 define('MOLLOM_API_VERSION', '1.0');
 
 define('MOLLOM_ANALYSIS_HAM'     , 1);
@@ -20,9 +25,9 @@ define('MOLLOM_REDIRECT', 1200);
 
 function mollom_help($section) {
   if ($section == 'admin/settings/mollom') {
-    return t("Allowing users to react, participate and contribute while still keeping your site's content under control can be a huge challenge. Mollom is a web service that helps you identify content quality and, more importantly, helps you stop spam. When content moderation becomes easier, you have more time and energy to interact with your web community. More information about Mollom is available on the <a href=\"@mollom-website\">Mollom website</a> or in the <a href=\"@mollom-faq\">Mollom FAQ</a>. For support, please consult the <a href=\"@mollom-support\">Mollom support page</a>.", 
-        array('@mollom-website' => 'http://mollom.com', 
-              '@mollom-faq' => 'http://mollom.com/faq', 
+    return t("Allowing users to react, participate and contribute while still keeping your site's content under control can be a huge challenge. Mollom is a web service that helps you identify content quality and, more importantly, helps you stop spam. When content moderation becomes easier, you have more time and energy to interact with your web community. More information about Mollom is available on the <a href=\"@mollom-website\">Mollom website</a> or in the <a href=\"@mollom-faq\">Mollom FAQ</a>. For support, please consult the <a href=\"@mollom-support\">Mollom support page</a>.",
+        array('@mollom-website' => 'http://mollom.com',
+              '@mollom-faq' => 'http://mollom.com/faq',
               '@mollom-support' => 'http://mollom.com/support'));
   }
 }
@@ -31,66 +36,70 @@ function mollom_link($type, $object = NU
   // We extend the comment links so people can send feedback:
   if ($type == 'comment' && user_access('administer comments') && _mollom_get_mode('comment_form')) {
     $links['comment_delete'] = array(
-        'title' => t('delete'),
-        'href' => "mollom/comment/$object->cid"
-        );
+      'title' => t('delete'),
+      'href' => "mollom/comment/$object->cid",
+    );
 
     return $links;
   }
 
   if ($type == 'node' && user_access('administer nodes') && _mollom_get_mode($object->type .'_node_form')) {
     $links['node_spam'] = array(
-        'title' => t('delete'),
-        'href' => "mollom/node/$object->nid"
-        );
+      'title' => t('delete'),
+      'href' => "mollom/node/$object->nid",
+    );
 
     return $links;
   }
 }
 
 function mollom_menu($may_cache) {
-  
+
   $items = array();
 
   if ($may_cache) {
     $items[] = array(
-        'path' => 'mollom/comment',
-        'title' => t('Report and delete'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('mollom_report_comment'),
-        'access' => user_access('administer comments'),
-        'type' => MENU_CALLBACK);
+      'path' => 'mollom/comment',
+      'title' => t('Report and delete'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('mollom_report_comment'),
+      'access' => user_access('administer comments'),
+      'type' => MENU_CALLBACK,
+    );
     $items[] = array(
-        'path' => 'mollom/node',
-        'title' => t('Report and delete'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('mollom_report_node'),
-        'access' => user_access('administer nodes'),
-        'type' => MENU_CALLBACK);
+      'path' => 'mollom/node',
+      'title' => t('Report and delete'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('mollom_report_node'),
+      'access' => user_access('administer nodes'),
+      'type' => MENU_CALLBACK,
+    );
     $items[] = array(
-        'path' => 'mollom/contact',
-        'title' => t('Report and delete'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('mollom_report_contact'),
-        'access' => TRUE, // Everyone can report contact form feedback
-        'type' => MENU_CALLBACK);
+      'path' => 'mollom/contact',
+      'title' => t('Report and delete'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('mollom_report_contact'),
+      'access' => TRUE, // Everyone can report contact form feedback
+      'type' => MENU_CALLBACK,
+    );
     $items[] = array(
-        'path' => 'admin/settings/mollom',
-        'description' => t('Mollom is a web service that helps you manage your community.'),
-        'title' => t('Mollom'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('mollom_admin_settings'),
-        'access' => user_access('administer site configuration'),
-        'type' => MENU_NORMAL_ITEM
-        );
-    
+      'path' => 'admin/settings/mollom',
+      'description' => t('Mollom is a web service that helps you manage your community.'),
+      'title' => t('Mollom'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('mollom_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM,
+    );
+
     // A menu callback that is used for AJAX purposes:
     $items[] = array(
-        'path' => 'mollom/captcha',
-        'title' => t('Request CAPTCHA'),
-        'callback' => 'mollom_ajax_callback',
-        'access' => TRUE,
-        'type' => MENU_CALLBACK);
+      'path' => 'mollom/captcha',
+      'title' => t('Request CAPTCHA'),
+      'callback' => 'mollom_ajax_callback',
+      'access' => TRUE,
+      'type' => MENU_CALLBACK,
+    );
   }
 
   return $items;
@@ -164,7 +173,7 @@ function _mollom_feedback_options() {
       'profanity' => t('Report as obscene, violent or profane content'),
       'low-quality' => t('Report as low-quality content or writing'),
       'unwanted' => t('Report as unwanted, taunting or off-topic content'),
-  ),
+    ),
     '#default_value' => 'none',
     '#description' => t("Mollom is a web service that helps you moderate your site's content: see <a href=\"http://mollom.com\">http://mollom.com</a> for more information.  By sending feedback to Mollom, you teach Mollom what content you like and what content you dislike.  Like that, Mollom can do a better job helping you to moderate your site's content. If you want to report multiple posts at once, you can use Mollom's bulk operations on the content and comment administration pages."),
   );
@@ -194,9 +203,9 @@ function mollom_report_comment_submit($f
 
   if ($form_values['confirm']) {
     if ($comment = _comment_load($form_values['cid'])) {
-      // Load the Mollom session data: 
+      // Load the Mollom session data:
       $data = mollom_get_data('comment-'. $comment->cid);
-     
+
       // Provide feedback to Mollom if available:
       if ($data->session && $form_values['feedback']) {
         mollom('mollom.sendFeedback', array('session_id' => $data->session, 'feedback' => $form_values['feedback']));
@@ -235,27 +244,27 @@ function mollom_report_node($nid) {
 function mollom_report_node_submit($form_id, $form_values) {
   if ($form_values['confirm']) {
     if ($node = node_load($form_values['nid'])) {
-      // Load the Mollom session data: 
+      // Load the Mollom session data:
       $data = mollom_get_data('node-'. $node->nid);
-     
+
       // Provide feedback to Mollom if available:
       if ($data->session && $form_values['feedback']) {
         mollom('mollom.sendFeedback', array('session_id' => $data->session, 'feedback' => $form_values['feedback']));
       }
 
-      // Delete the node. Calling this function will delete any comments, 
+      // Delete the node. Calling this function will delete any comments,
       // clear the cache and print a status message.
       node_delete($node->nid);
     }
   }
-  
+
   return '<front>';
 }
 
 /**
  * This function adds a 'report as inappropriate' link to the e-mails that are sent
  * by the contact module.
- */ 
+ */
 function mollom_mail_alter($key, $to, $subject, &$body, $from, $headers) {
   $response = $GLOBALS['mollom_response'];
   if (isset($response) && isset($response['session_id'])) {
@@ -269,7 +278,7 @@ function mollom_mail_alter($key, $to, $s
 function mollom_report_contact($session) {
   $form['session'] = array('#type' => 'value', '#value' => $session);
   $form['feedback'] = _mollom_feedback_options();
-  
+
   return confirm_form($form,
       t('Are you sure you want to report the e-mail message as inappropriate?'),
       $_GET['destination'] ? $_GET['destination'] : '',
@@ -285,7 +294,7 @@ function mollom_report_contact_submit($f
     mollom('mollom.sendFeedback', array('session_id' => $form_values['session'], 'feedback' => $form_values['feedback']));
     drupal_set_message('The e-mail has been reported as inappropriate.');
   }
-  
+
   drupal_goto();
 }
 
@@ -351,7 +360,7 @@ function mollom_comment_admin_overview_s
         }
 
         // Second, perform the proper operation on the comments:
-        if ($comment = _comment_load($cid)) { 
+        if ($comment = _comment_load($cid)) {
           if ($operation == 'unpublish') {
             db_query("UPDATE {comments} SET status = %d WHERE cid = %d", COMMENT_NOT_PUBLISHED, $cid);
             _comment_update_node_statistics($comment->nid);
@@ -366,7 +375,7 @@ function mollom_comment_admin_overview_s
 
     // Clear the cache:
     cache_clear_all();
-    
+
     if ($operation == 'delete') {
       drupal_set_message(t('The selected comments have been reported as spam and are deleted.'));
     }
@@ -387,7 +396,7 @@ function mollom_node_admin_overview_subm
         if ($data = mollom_get_data('node-'. $nid)) {
           mollom('mollom.sendFeedback', array('session_id' => $data->session, 'feedback' => 'spam'));
         }
-        
+
         if ($node = node_load($nid)) {
           if ($operation == 'unpublish') {
             db_query('UPDATE {node} SET status = 0 WHERE nid = %d', $nid);
@@ -401,7 +410,7 @@ function mollom_node_admin_overview_subm
 
     // Clear the cache:
     cache_clear_all();
-    
+
     if ($operation == 'delete') {
       drupal_set_message(t('The selected posts have been reported as spam and are deleted.'));
     }
@@ -419,14 +428,14 @@ function mollom_data_contact_mail_page($
   global $user;
 
   $data = array(
-      'post_title'  => $form_values['subject'],
-      'post_body'   => $form_values['message'],
-      'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
-      'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
-      'author_id'   => $user->uid > 0 ? $user->uid : NULL,
-      'author_ip'   => _mollom_ip_address(),
-      );
-  
+    'post_title'  => $form_values['subject'],
+    'post_body'   => $form_values['message'],
+    'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
+    'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
+    'author_id'   => $user->uid > 0 ? $user->uid : NULL,
+    'author_ip'   => _mollom_ip_address(),
+  );
+
   return $data;
 }
 
@@ -438,14 +447,14 @@ function mollom_data_contact_mail_user($
   global $user;
 
   $data = array(
-      'post_title'  => $form_values['subject'],
-      'post_body'   => $form_values['message'],
-      'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
-      'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
-      'author_id'   => $user->uid > 0 ? $user->uid : NULL,
-      'author_ip'   => _mollom_ip_address(),
-      );
-  
+    'post_title'  => $form_values['subject'],
+    'post_body'   => $form_values['message'],
+    'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
+    'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
+    'author_id'   => $user->uid > 0 ? $user->uid : NULL,
+    'author_ip'   => _mollom_ip_address(),
+  );
+
   return $data;
 }
 
@@ -457,14 +466,14 @@ function mollom_data_comment_form($form_
   global $user;
 
   $data = array(
-      'post_title'  => $form_values['subject'],
-      'post_body'   => $form_values['comment'],
-      'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
-      'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
-      'author_url'  => $form_values['homepage'],
-      'author_id'   => $user->uid > 0 ? $user->uid : NULL,
-      'author_ip'   => $form_values['cid'] ? '' : _mollom_ip_address(),
-      );
+    'post_title'  => $form_values['subject'],
+    'post_body'   => $form_values['comment'],
+    'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
+    'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
+    'author_url'  => $form_values['homepage'],
+    'author_id'   => $user->uid > 0 ? $user->uid : NULL,
+    'author_ip'   => $form_values['cid'] ? '' : _mollom_ip_address(),
+  );
 
   return $data;
 }
@@ -482,14 +491,14 @@ function mollom_data_node_form($form_val
   $content = drupal_render($data->content);
 
   $data = array(
-      'post_title' => $form_values['title'],
-      'post_body' => $content,
-      'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
-      'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
-      'author_url'  => $form_values['homepage'],
-      'author_id'   => $user->uid > 0 ? $user->uid : NULL,
-      'author_ip'   => $form_values['nid'] ? '' : _mollom_ip_address(),
-      );
+    'post_title'  => $form_values['title'],
+    'post_body'   => $content,
+    'author_name' => $form_values['name'] ? $form_values['name'] : $user->name,
+    'author_mail' => $form_values['mail'] ? $form_values['mail'] : $user->mail,
+    'author_url'  => $form_values['homepage'],
+    'author_id'   => $user->uid > 0 ? $user->uid : NULL,
+    'author_ip'   => $form_values['nid'] ? '' : _mollom_ip_address(),
+  );
 
   return $data;
 }
@@ -497,9 +506,9 @@ function mollom_data_node_form($form_val
 /**
  * This function is a generic validate function that will protect any given
  * form as long there is a variable for it (i.e. as long it is configured to
- * be protected through Mollom). To protect a form in Drupal with Mollom, 
+ * be protected through Mollom). To protect a form in Drupal with Mollom,
  * just variable_set() the "mollom_$form_id" variable.
- */ 
+ */
 function mollom_validate($form_id, $form_values) {
   $data = array();
 
@@ -514,7 +523,7 @@ function mollom_validate($form_id, $form
   $pos = strpos($form_id, '_node_form');
   if ($pos !== FALSE) {
     // The node forms use dynamic form IDs so we had to create a special
-    // case for these. 
+    // case for these.
     $data = mollom_data_node_form($form_values);
   }
   else {
@@ -535,7 +544,7 @@ function mollom_validate($form_id, $form
 
 /**
  * Given a form ID, this function will return the strategy that is used
- * to protect this form.  Could be MOLLOM_MODE_DISABLED (none), 
+ * to protect this form.  Could be MOLLOM_MODE_DISABLED (none),
  * MOLLOM_MODE_CAPTCHA (CAPTCHAs only) or MOLLOM_MODE_ANALYSIS (text
  * analysis with smart CAPTCHA support).
  */
@@ -559,49 +568,55 @@ function mollom_protectable_forms() {
   if (!$forms) {
     if (module_exists('comment')) {
       $forms['comment_form'] = array(
-          'name' => 'comment form',
-          'mode' => MOLLOM_MODE_ANALYSIS);
+        'name' => 'comment form',
+        'mode' => MOLLOM_MODE_ANALYSIS,
+      );
     }
 
     if (module_exists('contact')) {
       $forms['contact_mail_page'] = array(
-          'name' => 'site-wide contact form',
-          'mode' => MOLLOM_MODE_ANALYSIS);
+        'name' => 'site-wide contact form',
+        'mode' => MOLLOM_MODE_ANALYSIS,
+      );
 
       $forms['contact_mail_user'] = array(
-          'name' => 'per-user contact forms',
-          'mode' => MOLLOM_MODE_ANALYSIS);
+        'name' => 'per-user contact forms',
+        'mode' => MOLLOM_MODE_ANALYSIS,
+      );
     }
 
     $forms['user_register'] = array(
-        'name' => 'user registration form',
-        'mode' => MOLLOM_MODE_CAPTCHA);
+      'name' => 'user registration form',
+      'mode' => MOLLOM_MODE_CAPTCHA,
+    );
 
     $forms['user_pass'] = array(
-        'name' => 'user password request form',
-        'mode' => MOLLOM_MODE_CAPTCHA);
+      'name' => 'user password request form',
+      'mode' => MOLLOM_MODE_CAPTCHA,
+    );
 
     // Add all the node types:
-    $types = node_get_types('names'); 
+    $types = node_get_types('names');
     foreach ($types as $type => $name) {
       $forms[$type .'_node_form'] = array(
-          'name' => strtolower($name) ." form",
-          'mode' => MOLLOM_MODE_ANALYSIS);
+        'name' => strtolower($name) ." form",
+        'mode' => MOLLOM_MODE_ANALYSIS,
+      );
     }
-  } 
-  
+  }
+
   return $forms;
 }
 
 // Temporary test code
 function _mollom_update_comments() {
-  $result = db_query('SELECT * FROM comments LIMIT 1000');
+  $result = db_query('SELECT * FROM {comments} LIMIT 1000');
   while ($comment = db_fetch_object($result)) {
-  
+
     $data = array(
-      'post_title'  => $comment->subject,
-      'post_body'   => $comment->comment,
-      );
+      'post_title' => $comment->subject,
+      'post_body' => $comment->comment,
+    );
 
     $response = mollom('mollom.checkContent', $data);
     if ($response['spam'] == MOLLOM_ANALYSIS_SPAM) {
@@ -618,7 +633,7 @@ function _mollom_update_comments() {
 function mollom_admin_settings() {
 
   // _mollom_update_comments();
-  
+
   $keys = variable_get('mollom_public_key', '') && variable_get('mollom_private_key', '');
 
   if ($keys) {
@@ -634,72 +649,72 @@ function mollom_admin_settings() {
     }
 
     $form['statistics'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Site usage statistics'),
-        '#collapsible' => TRUE,
-        );
+      '#type' => 'fieldset',
+      '#title' => t('Site usage statistics'),
+      '#collapsible' => TRUE,
+    );
     $form['statistics']['message'] = array(
-        '#value' => '<div><embed src="http://mollom.com/statistics.swf?key='. check_plain(variable_get('mollom_public_key', '')) .'" quality="high" width="100%" height="430" name="Mollom" align="middle" play="true" loop="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></div>'
-       );
-    
+      '#value' => '<div><embed src="http://mollom.com/statistics.swf?key='. check_plain(variable_get('mollom_public_key', '')) .'" quality="high" width="100%" height="430" name="Mollom" align="middle" play="true" loop="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></div>',
+    );
+
     $form['spam'] = array(
-        '#type'=> 'fieldset',
-        '#title' => t('Spam protection settings'),
-        '#description' => 
+      '#type' => 'fieldset',
+      '#title' => t('Spam protection settings'),
+      '#description' =>
           '<p>'. t("Mollom can be used to block all sorts of spam received by your website. Your Drupal site will send data you want checked for spam to the Mollom servers, which will reply with either 'spam' or 'ham' (not spam). If Mollom is not fully confident in its decision, it will ask the user to fill out a CAPTCHA.  On the rare occasion that Mollom asks the poster to fill out a CAPTCHA, Mollom assumes that all legitimate posters will take the extra time to fill out this CAPTCHA.  Using the CAPTCHA, Mollom avoids legitimate messages being incorrectly classified as spam and it eliminates the need to moderate messages that Mollom decided to block.  Administrators can still inspect the <a href=\"@logs\">logs</a> to see what Mollom has blocked.", array('@logs' => url('admin/logs/watchdog'))) .'</p>'.
           '<p>'. t("To perform its service, Mollom processes, stores and compares the data submitted by your site's visitors as explained in our <a href=\"http://mollom.com/service-agreement-free-subscriptions\">Web Service Privacy Policy</a>. As the controller of the data being processed, it is your responsibility to inform your website's visitors, and to obtain appropriate consent from them to allow Mollom to process their data.") .'</p>'.
           '<p>'. t("More information about how Mollom works, is available on the <a href=\"@mollom-workings\">\"How Mollom works\" page</a> and the <a href=\"@mollom-faq\">Mollom FAQ</a>.", array('@mollom-workings' => 'http://mollom.com/how-mollom-works', '@mollom-faq' => 'http://mollom.com/faq')) .'</p>',
-        '#collapsible' => TRUE,
-        );
-    
+      '#collapsible' => TRUE,
+    );
+
     $forms = mollom_protectable_forms();
     foreach ($forms as $formid => $details) {
       $name = 'mollom_'. $formid;
       $form['spam'][$name] = array(
-          '#type' => 'checkbox',
-          '#title' => t('Protect @name', array('@name' => $details['name'])),
-          '#default_value' => variable_get($name, MOLLOM_MODE_DISABLED),
-          );
+        '#type' => 'checkbox',
+        '#title' => t('Protect @name', array('@name' => $details['name'])),
+        '#default_value' => variable_get($name, MOLLOM_MODE_DISABLED),
+      );
     }
-    
+
     $form['server'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Server settings'),
-        '#collapsible' => TRUE,
-        );
+      '#type' => 'fieldset',
+      '#title' => t('Server settings'),
+      '#collapsible' => TRUE,
+    );
     $form['server']['mollom_fallback'] = array(
-        '#type' => 'radios',
-        '#title' => t('Fallback strategy'),
-        '#default_value' => variable_get('mollom_fallback', MOLLOM_FALLBACK_BLOCK ), // we default to treating everything as inappropriate
-        '#options' => array(
-          MOLLOM_FALLBACK_BLOCK  => t('Block all submissions on the protected forms until the server problems are resolved'),
-          MOLLOM_FALLBACK_ACCEPT => t('Leave all forms unprotected and accept all submissions') 
-         ),
-        '#description' => t('In the event that Mollom stopped servicing your requests, i.e. because a certain usage quota was reached, your Drupal site will use the configured fallback strategy.  You can choose to blindly accept all submissions without spam checking, or you can choose to block all submissions until this problem is resolved.  You can also <a href="@pricing">upgrade to Mollom Plus</a>: paying customers automatically get access to <a href="@sla">Mollom\'s high-availability backend infrastructure</a> not available to free users.', array('@pricing' => 'http://mollom.com/pricing', '@sla' => 'http://mollom.com/standard-service-level-agreement'))
-        );
+      '#type' => 'radios',
+      '#title' => t('Fallback strategy'),
+      '#default_value' => variable_get('mollom_fallback', MOLLOM_FALLBACK_BLOCK ), // we default to treating everything as inappropriate
+      '#options' => array(
+        MOLLOM_FALLBACK_BLOCK => t('Block all submissions on the protected forms until the server problems are resolved'),
+        MOLLOM_FALLBACK_ACCEPT => t('Leave all forms unprotected and accept all submissions')
+      ),
+      '#description' => t('In the event that Mollom stopped servicing your requests, i.e. because a certain usage quota was reached, your Drupal site will use the configured fallback strategy.  You can choose to blindly accept all submissions without spam checking, or you can choose to block all submissions until this problem is resolved.  You can also <a href="@pricing">upgrade to Mollom Plus</a>: paying customers automatically get access to <a href="@sla">Mollom\'s high-availability backend infrastructure</a> not available to free users.', array('@pricing' => 'http://mollom.com/pricing', '@sla' => 'http://mollom.com/standard-service-level-agreement')),
+    );
   }
-  
+
   $form['access-keys'] = array(
-      '#type'=> 'fieldset',
-      '#title' => t('Mollom access keys'),
-      '#description' => t('In order to use Mollom, you need a public and a private key. Visit <a href="http://mollom.com/user">http://mollom.com/user</a> and create a user account to obtain a private and a public access key.'),
-      '#collapsible' => TRUE,
-      '#collapsed' => $keys,
-      );
+    '#type' => 'fieldset',
+    '#title' => t('Mollom access keys'),
+    '#description' => t('In order to use Mollom, you need a public and a private key. Visit <a href="http://mollom.com/user">http://mollom.com/user</a> and create a user account to obtain a private and a public access key.'),
+    '#collapsible' => TRUE,
+    '#collapsed' => $keys,
+  );
   $form['access-keys']['mollom_public_key'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Public key'),
-      '#default_value' => variable_get('mollom_public_key', ''),
-      '#description' => t('The public key is used to uniquely identify you.'),
-      '#required' => TRUE
-      );
+    '#type' => 'textfield',
+    '#title' => t('Public key'),
+    '#default_value' => variable_get('mollom_public_key', ''),
+    '#description' => t('The public key is used to uniquely identify you.'),
+    '#required' => TRUE,
+  );
   $form['access-keys']['mollom_private_key'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Private key'),
-      '#default_value' => variable_get('mollom_private_key', ''),
-      '#description' => t('The private key is used to prevent someone from hijacking your requests. It is like a password and should never be shared with anyone.'),
-      '#required' => TRUE,
-      );
+    '#type' => 'textfield',
+    '#title' => t('Private key'),
+    '#default_value' => variable_get('mollom_private_key', ''),
+    '#description' => t('The private key is used to prevent someone from hijacking your requests. It is like a password and should never be shared with anyone.'),
+    '#required' => TRUE,
+  );
 
   return system_settings_form($form);
 }
@@ -709,7 +724,7 @@ function _mollom_fallback() {
   if ($fallback == MOLLOM_FALLBACK_BLOCK) {
     form_set_error('mollom', t("The spam filter that is installed on this site is currently not available. Per the site's policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple minutes."));
   }
-      
+
   watchdog('mollom', t('Mollom was unavailable (error: @errno - %error_msg)', array('@errno' => xmlrpc_errno(), '%error_msg' => xmlrpc_error_msg())), WATCHDOG_ERROR);
 }
 
@@ -735,7 +750,7 @@ function mollom_protect_form_analysis(&$
         $result = mollom('mollom.checkCaptcha', $data + array('session_id' => $_POST['session-id'], 'solution' => $_POST['captcha-solution'], 'author_ip' => _mollom_ip_address()));
 
         if (is_bool($result)) {
-          if ($result) { 
+          if ($result) {
             $GLOBALS['mollom_response']['spam'] = MOLLOM_ANALYSIS_HAM;
             $GLOBALS['mollom_response']['session_id'] = $_POST['session-id'];
             watchdog('mollom', t('Correct CAPTCHA: %message', array('%message' => $data['post_body'])));
@@ -752,7 +767,7 @@ function mollom_protect_form_analysis(&$
       else {
         form_set_error('analysis', t('We are sorry, but the spam filter on this site decided that your submission could be spam. Please fill in the CAPTCHA below to get your submission accepted.'));
         watchdog('mollom', t('Unsure: %message', array('%message' => $data['post_body'])));
-      }         
+      }
     }
   }
   else {
@@ -770,10 +785,10 @@ function mollom_protect_form_captcha(&$f
         // We make the response available to other form API handlers:
         $GLOBALS['mollom_response']['session_id'] = $_POST['session-id'];
 
-        if (!$result) {  
+        if (!$result) {
           form_set_error('captcha', t('The entered CAPTCHA solution is not correct. We generated a new CAPTCHA so please try again.'));
           watchdog('mollom', 'Incorrect CAPTCHA');
- 
+
           // Generate a new CAPTCHA:
           $GLOBALS['mollom_captcha'] = mollom('mollom.getImageCaptcha', array('author_ip' => _mollom_ip_address()));
         }
@@ -787,7 +802,7 @@ function mollom_protect_form_captcha(&$f
     }
     else {
       form_set_error('captcha', t('The CAPTCHA field is required.'));
-      
+
       // Generate a new CAPTCHA:
       $GLOBALS['mollom_captcha'] = mollom('mollom.getImageCaptcha', array('author_ip' => _mollom_ip_address()));
     }
@@ -802,8 +817,8 @@ function mollom_protect_form_captcha(&$f
 
 function mollom_captcha_prerender($form_id, &$form) {
   $response = $GLOBALS['mollom_response'];
-  
-  $mode = _mollom_get_mode($form_id);    
+
+  $mode = _mollom_get_mode($form_id);
 
   if ($mode == MOLLOM_MODE_ANALYSIS && $response['spam'] == MOLLOM_ANALYSIS_UNSURE) {
     $response = mollom('mollom.getImageCaptcha', array('author_ip' => _mollom_ip_address(), 'session_id' => $response['session_id']));
@@ -816,11 +831,11 @@ function mollom_captcha_prerender($form_
 
   if (isset($response['session_id'])) {
     $form['session-id'] = array(
-        '#type' => 'hidden',
-        '#name' => 'session-id',
-        '#id' => 'edit-session-id',
-        '#value' => $response['session_id'],
-        );
+      '#type' => 'hidden',
+      '#name' => 'session-id',
+      '#id' => 'edit-session-id',
+      '#value' => $response['session_id'],
+    );
 
     if ($captcha) {
       // Include the Javascript that allows the user to switch to an
@@ -830,24 +845,25 @@ function mollom_captcha_prerender($form_
       drupal_add_js(drupal_get_path('module', 'mollom') .'/mollom.js');
 
       // We add an image captcha to the form. We can't do this from the
-      // validate hook, hence the need for the #pre_render trick. In 
+      // validate hook, hence the need for the #pre_render trick. In
       // Drupal 6, we can simply use $form_state['rebuild'] = TRUE in
-      // the validate-hook, and rebuild the form from there but in 
+      // the validate-hook, and rebuild the form from there but in
       // Drupal 5, we have to use this prerender-hook hack.
-      // Because we're already past the prepare state of the form API, 
+      // Because we're already past the prepare state of the form API,
       // we have a little bit more work to do ...:
       $form['captcha-solution'] = array(
-          '#type' => 'textfield',
-          '#name' => 'captcha-solution',
-          '#id' => 'edit-captcha-solution',
-          '#parents' => array(),
-          '#title' => t('Word verification'),
-          '#field_prefix' => '<div id="captcha"><a href="http://mollom.com"><img src="'. url($response['url']) .'" alt="Mollom CAPTCHA" /></a> (<a href="#" id="audio-captcha">'. t('play audio CAPTCHA') .'</a>)</div>',
-          '#required' => TRUE,
-          '#size' => 10,
-          '#value' => $form['#post']['captcha'],
-          '#description' => t("Type the characters shown in the picture above; if you can't read them, submit the form and a new image will be generated."),
-          '#weight' => min($form['submit']['#weight'], $form['preview']['#weight']) + 1);
+        '#type' => 'textfield',
+        '#name' => 'captcha-solution',
+        '#id' => 'edit-captcha-solution',
+        '#parents' => array(),
+        '#title' => t('Word verification'),
+        '#field_prefix' => '<div id="captcha"><a href="http://mollom.com"><img src="'. url($response['url']) .'" alt="Mollom CAPTCHA" /></a> (<a href="#" id="audio-captcha">'. t('play audio CAPTCHA') .'</a>)</div>',
+        '#required' => TRUE,
+        '#size' => 10,
+        '#value' => $form['#post']['captcha'],
+        '#description' => t("Type the characters shown in the picture above; if you can't read them, submit the form and a new image will be generated."),
+        '#weight' => min($form['submit']['#weight'], $form['preview']['#weight']) + 1,
+      );
 
       // Move the preview and/or submit button below the captcha:
       $form['preview']['#weight'] += 2;
@@ -896,7 +912,7 @@ function _mollom_retrieve_server_list() 
     }
     else {
       watchdog('mollom', t('Error @errno: %server - %message - mollom.getServerList', array('@errno' => xmlrpc_errno(), '%server' => $server, '%message' => xmlrpc_error_msg()), WATCHDOG_ERROR));
-      
+
       // Reset the XMLRPC error:
       xmlrpc_error(0);  // FIXME: this is crazy.
     }
@@ -913,10 +929,10 @@ function _mollom_retrieve_server_list() 
 function mollom($method, $data = array()) {
   // Initialize refresh variable:
   $refresh = FALSE;
-  
+
   // Retrieve the list of Mollom servers from the database:
   $servers = variable_get('mollom_servers', NULL);
- 
+
   if ($servers == NULL) {
     // Retrieve a list of servers:
     $servers = _mollom_retrieve_server_list();
@@ -925,7 +941,7 @@ function mollom($method, $data = array()
     variable_set('mollom_servers', $servers);
   }
 
-  if (is_array($servers)) { 
+  if (is_array($servers)) {
     reset($servers);
     while ($server = current($servers)) {
       $result = xmlrpc($server .'/'. MOLLOM_API_VERSION, $method, $data + _mollom_authentication());
@@ -984,22 +1000,22 @@ function mollom($method, $data = array()
   variable_set('mollom_servers', array());
 
   // Report this error:
-  watchdog('mollom', t('No Mollom servers could be reached or all servers returned an error -- the server list was emptied.'), WATCHDOG_ERROR);  
+  watchdog('mollom', t('No Mollom servers could be reached or all servers returned an error -- the server list was emptied.'), WATCHDOG_ERROR);
 }
 
 /**
- * This function generate an array with all the information required to 
+ * This function generate an array with all the information required to
  * authenticate against Mollom. To prevent that requests are forged and
  * that you are impersonated, each request is signed with a hash computed
  * based on a private key and a timestamp.
  *
- * Both the client and the server share the secret key that is used to 
- * create the authentication hash based on a timestamp.  They both hash 
- * the timestamp with the secret key, and if the hashes match, the 
+ * Both the client and the server share the secret key that is used to
+ * create the authentication hash based on a timestamp.  They both hash
+ * the timestamp with the secret key, and if the hashes match, the
  * authenticity of the message has been validated.
  *
  * To avoid that someone can intercept a (hash, timestamp)-pair and
- * use that to impersonate a client, Mollom will reject the request 
+ * use that to impersonate a client, Mollom will reject the request
  * when the timestamp is more than 15 minutes off.
  *
  * Make sure your server's time is synchronized with the world clocks,
@@ -1029,6 +1045,6 @@ function _mollom_authentication() {
   $data['time'] = $time;
   $data['hash'] = $hash;
   $data['nonce'] = $nonce;
-  
+
   return $data;
 }
