? mollom.admin.inc
Index: mollom.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.install,v
retrieving revision 1.2.2.8
diff -u -p -r1.2.2.8 mollom.install
--- mollom.install	10 Jan 2009 10:51:30 -0000	1.2.2.8
+++ mollom.install	22 Mar 2009 20:03:05 -0000
@@ -45,16 +45,14 @@ function mollom_schema() {
       ),
       // The 'languages' field is still experimental; Mollom might not return a (consistent) value.
       'languages' => array(
-          'description' => t("The language(s) that the content might be written in."),
-          'type' => 'varchar',
-          'length' => 255,
-          'not null' => TRUE,
-          'default' => '',
-          ),
+        'description' => t("The language(s) that the content might be written in."),
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
       ),
-      'indexes' => array(
-     'session' => array('session'),
     ),
+    'indexes' => array('session' => array('session')),
     'primary key' => array('did'),
   );
   $schema['cache_mollom'] = array(
@@ -65,33 +63,39 @@ function mollom_schema() {
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-        'default' => ''),
+        'default' => '',
+      ),
       'data' => array(
         'description' => t('A collection of data to cache.'),
         'type' => 'blob',
         'not null' => FALSE,
-        'size' => 'big'),
+        'size' => 'big',
+      ),
       'expire' => array(
         'description' => t('A Unix timestamp indicating when the cache entry should expire, or 0 for never.'),
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0,
+      ),
       'created' => array(
         'description' => t('A Unix timestamp indicating when the cache entry was created.'),
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0,
+      ),
       'headers' => array(
         'description' => t('Any custom HTTP headers to be added to cached data.'),
         'type' => 'text',
-        'not null' => FALSE),
+        'not null' => FALSE,
+      ),
       'serialized' => array(
         'description' => t('A flag to indicate whether content is serialized (1) or not (0).'),
         'type' => 'int',
         'size' => 'small',
         'not null' => TRUE,
-        'default' => 0)
+        'default' => 0,
       ),
+    ),
     'indexes' => array('expire' => array('expire')),
     'primary key' => array('cid'),
   );
@@ -135,33 +139,39 @@ function mollom_update_2() {
         'type' => 'varchar',
         'length' => 255,
         'not null' => TRUE,
-        'default' => ''),
+        'default' => '',
+      ),
       'data' => array(
         'description' => t('A collection of data to cache.'),
         'type' => 'blob',
         'not null' => FALSE,
-        'size' => 'big'),
+        'size' => 'big',
+      ),
       'expire' => array(
         'description' => t('A Unix timestamp indicating when the cache entry should expire, or 0 for never.'),
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0,
+      ),
       'created' => array(
         'description' => t('A Unix timestamp indicating when the cache entry was created.'),
         'type' => 'int',
         'not null' => TRUE,
-        'default' => 0),
+        'default' => 0,
+      ),
       'headers' => array(
         'description' => t('Any custom HTTP headers to be added to cached data.'),
         'type' => 'text',
-        'not null' => FALSE),
+        'not null' => FALSE,
+      ),
       'serialized' => array(
         'description' => t('A flag to indicate whether content is serialized (1) or not (0).'),
         'type' => 'int',
         'size' => 'small',
         'not null' => TRUE,
-        'default' => 0)
+        'default' => 0,
       ),
+    ),
     'indexes' => array('expire' => array('expire')),
     'primary key' => array('cid'),
   );
@@ -195,4 +205,3 @@ function mollom_update_4() {
   db_add_field($ret, 'mollom', 'reputation', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''));
   return $ret;
 }
-
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.2.2.55
diff -u -p -r1.2.2.55 mollom.module
--- mollom.module	25 Feb 2009 07:41:00 -0000	1.2.2.55
+++ mollom.module	22 Mar 2009 20:03:13 -0000
@@ -44,8 +44,8 @@ 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_spam'] = array(
-        'title' => t('mark as abuse'),
-        'href' => "mollom/comment/$object->cid"
+      'title' => t('mark as abuse'),
+      'href' => "mollom/comment/$object->cid",
     );
 
     return $links;
@@ -53,8 +53,8 @@ function mollom_link($type, $object = NU
 
   if ($type == 'node' && user_access('administer nodes') && _mollom_get_mode($object->type .'_node_form')) {
     $links['node_spam'] = array(
-        'title' => t('Delete post'),
-        'href' => "mollom/node/$object->nid"
+      'title' => t('Delete post'),
+      'href' => "mollom/node/$object->nid",
     );
 
     return $links;
@@ -280,10 +280,10 @@ function mollom_report_contact($form_sta
   $form['feedback'] = _mollom_feedback_options();
 
   return confirm_form($form,
-  t('Are you sure you want to report the e-mail message as inappropriate?'),
-  isset($_GET['destination']) ? $_GET['destination'] : '',
-  t('This action cannot be undone.'),
-  t('Report as inappropriate'), t('Cancel'));
+    t('Are you sure you want to report the e-mail message as inappropriate?'),
+    isset($_GET['destination']) ? $_GET['destination'] : '',
+    t('This action cannot be undone.'),
+    t('Report as inappropriate'), t('Cancel'));
 }
 
 /**
@@ -626,7 +626,7 @@ function _mollom_update_comments() {
   while ($comment = db_fetch_object($result)) {
     $data = array(
       'post_title' => $comment->subject,
-      'post_body'  => $comment->comment,
+      'post_body' => $comment->comment,
     );
 
     $response = mollom('mollom.checkContent', $data);
@@ -658,9 +658,9 @@ 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>',
@@ -711,7 +711,8 @@ function mollom_admin_settings() {
         MOLLOM_FALLBACK_BLOCK => t('Block all submissions of protected forms until the server problems are resolved'),
         MOLLOM_FALLBACK_ACCEPT => t('Leave all forms unprotected and accept all submissions'),
       ),
-      '#description' => t('When the Mollom servers are down or otherwise unreachable, no text analysis is performed and no CAPTCHAs are generated. If this occurs, your Drupal site will use the configured fallback strategy, and will either accept all submissions without spam checking, or block all submissions until the server or connection problems are resolved. Subscribers to <a href="@pricing">Mollom Plus</a> receive access to <a href="@sla">Mollom\'s high-availability backend infrastructure</a>, not available to free users, reducing potential downtime.', array('@pricing' => 'http://mollom.com/pricing', '@sla' => 'http://mollom.com/standard-service-level-agreement')));
+      '#description' => t('When the Mollom servers are down or otherwise unreachable, no text analysis is performed and no CAPTCHAs are generated. If this occurs, your Drupal site will use the configured fallback strategy, and will either accept all submissions without spam checking, or block all submissions until the server or connection problems are resolved. Subscribers to <a href="@pricing">Mollom Plus</a> receive access to <a href="@sla">Mollom\'s high-availability backend infrastructure</a>, not available to free users, reducing potential downtime.', array('@pricing' => 'http://mollom.com/pricing', '@sla' => 'http://mollom.com/standard-service-level-agreement')),
+    );
   }
 
   $form['access-keys'] = array(
@@ -781,7 +782,7 @@ function mollom_elements() {
 }
 
 /**
- * Expand the mollom element via #process. 
+ * Expand the mollom element via #process.
  *
  * @param $element
  *   An associative array containing the properties of the element.
@@ -800,7 +801,7 @@ function mollom_expand_element($element,
   // state of validation of a form. That ID is valid for a specific user session
   // and for a given form_id only. We expire it as soon as the form is
   // submitted, to avoid it being replayed.
-  
+
   // The current state can come either from the $form_state, if the form
   // was just rebuilt in the same request...
   if (!empty($form_state['mollom'])) {
@@ -808,7 +809,7 @@ function mollom_expand_element($element,
   }
   // ... or from data posted by the user. In that case we validate that the correct
   // form_id and user session ID is used...
-  else if (!empty($edit['session_id']) && ($cache = cache_get($edit['session_id'], 'cache_mollom'))
+  elseif (!empty($edit['session_id']) && ($cache = cache_get($edit['session_id'], 'cache_mollom'))
     && $cache->data['#form_id'] === $form_state['values']['form_id'] && $cache->data['#user_session_id'] === session_id()) {
     $mollom_state = $cache->data;
   }
@@ -850,7 +851,7 @@ function mollom_expand_element($element,
     // TODO: find a better way to do this in D7.
     $_SERVER['REQUEST_METHOD'] = 'POST';
   }
-  
+
   if (!empty($mollom_state['#session_id'])) {
     // We store the Mollom session only if something useful was done.
     // We save it in two places: as an hidden form field and in the cache
@@ -878,7 +879,7 @@ function mollom_clean_state($form_id, $f
 }
 
 /**
- * Implementation of hook_theme.
+ * Implementation of hook_theme().
  */
 function mollom_theme() {
   return array(
@@ -1076,7 +1077,7 @@ 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);
 
@@ -1125,14 +1126,14 @@ function mollom($method, $data = array()
         }
         elseif ($error->code == MOLLOM_REDIRECT) {
           // If this is a network error, we go to the next server in the list.
-          $next = next($servers); 
-          
+          $next = next($servers);
+
           // Do nothing, we automatically select the next server.
           watchdog('mollom', 'The Mollom server %server asked to use the next Mollom server in the list: %next.', array('%server' => $server, '%next' => $next));
         }
         else {
           watchdog('mollom', 'Error @errno from %server: %message - %method - <pre>@data</pre>', array('@errno' => $error->code, '%server' => $server, '%message' => $error->message, '%method' => $method, '@data' => print_r($data, TRUE)), WATCHDOG_ERROR);
-       
+
           // If it is a 'clean' Mollom error we return instantly.
 
           if ($error->code == MOLLOM_ERROR) {
@@ -1140,7 +1141,7 @@ function mollom($method, $data = array()
           }
 
           // If this is a network error, we go to the next server in the list.
-          next($servers); 
+          next($servers);
         }
       }
       else {
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/Attic/mollom.test,v
retrieving revision 1.1.2.13
diff -u -p -r1.1.2.13 mollom.test
--- tests/mollom.test	31 Dec 2008 14:45:06 -0000	1.1.2.13
+++ tests/mollom.test	22 Mar 2009 20:03:15 -0000
@@ -357,12 +357,12 @@ class MollomCommentFormTestCase extends 
     $this->assertText(t('The CAPTCHA was not completed correctly. Please complete this new CAPTCHA and try again.'), t('The comment cannot be submitted when the CAPTCHA is incorrect.'));
     $this->assertFieldByID('edit-mollom-captcha', '', t('The CAPTCHA is present on the comment form after an incorrect CAPTCHA is submitted.'));
     $this->assertFieldByID('edit-mollom-session-id', $mollom_session_id, t('The Mollom Session ID is present on the comment form after a possible spam comment is previewed.'));
-    
+
     // Try to submit a correct answer for the CAPTCHA, but without one of the required field.
     $this->drupalPost(NULL, array('comment' => '', 'mollom[captcha]' => 'correct'), t('Preview'));
     $this->assertText(t('Comment field is required.'), t('An empty comment field triggers a rebuild of the form.'));
     $this->assertNoFieldByID('edit-mollom-captcha', '', t('The CAPTCHA is absent on the comment form after a correct CAPTCHA is submitted.'));
-    
+
     // Finally, we should be able to submit a comment.
     $this->drupalPost(NULL, array('comment' => 'spam'), t('Save'));
     $this->assertRaw('<p>spam</p>', t('The comment is finally posted and appears on the screen after it is submitted.'));
@@ -371,7 +371,7 @@ class MollomCommentFormTestCase extends 
   /**
    * Make sure that the comment submission form can be fully protected.
    */
-  function testTextAnalysisProtectedCommentForm() {  
+  function testTextAnalysisProtectedCommentForm() {
     // Enable Mollom text-classification for comments.
     $this->mollomSetAdminOptions(array('mollom_comment_form' => MOLLOM_MODE_ANALYSIS));
 
