Index: webform.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v retrieving revision 1.124.2.106 diff -u -p -r1.124.2.106 webform.module --- webform.module 26 Jan 2010 03:59:09 -0000 1.124.2.106 +++ webform.module 30 Jan 2010 12:53:20 -0000 @@ -2488,3 +2488,49 @@ function webform_load_components($return // Ensure only wanted components are returned, even all are loaded. return $return_all ? $component_list : array_intersect_assoc($component_list, $enabled_list); } + +/** + * Implements hook_mollom_form_info(). + */ +function webform_mollom_form_info() { + $forms = array(); + $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.type = 'webform'")); + while ($nid = db_result($result)) { + $node = node_load($nid); + $additions = webform_load($node); + $node->webform = $additions->webform; + + $form_id = 'webform_client_form_' . $node->nid; + $forms[$form_id] = array( + 'title' => t('@name form', array('@name' => $node->title)), + 'mode' => MOLLOM_MODE_ANALYSIS, + 'bypass access' => array('access webform results', 'edit webforms'), + 'entity' => 'webform', + 'elements' => array(), + 'mapping' => array( + 'post_id' => 'details][sid', + ), + ); + // Add components as elements. + foreach ($node->webform['components'] as $cid => $component) { + if (in_array($component['type'], array('textfield', 'email', 'textarea'))) { + $forms[$form_id]['elements']['submitted][' . $component['form_key']] = check_plain(t($component['name'])); + } + } + // Assign field mappings based on webform configuration. + // @todo Is 'author_id' (uid) available for authenticated users, too? + $mappings = array( + 'post_title' => 'email_subject', + 'author_name' => 'email_from_name', + 'author_mail' => 'email_from_address', + ); + foreach ($mappings as $mapping => $setting) { + $component = $node->webform[$setting]; + if (isset($node->webform['components'][$component])) { + $forms[$form_id]['mapping'][$mapping] = 'submitted][' . $node->webform['components'][$component]['form_key']; + } + } + } + + return $forms; +} Index: webform_submissions.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/Attic/webform_submissions.inc,v retrieving revision 1.6.2.23 diff -u -p -r1.6.2.23 webform_submissions.inc --- webform_submissions.inc 14 Feb 2009 06:26:23 -0000 1.6.2.23 +++ webform_submissions.inc 30 Jan 2010 12:38:18 -0000 @@ -82,6 +82,11 @@ function webform_submission_delete($node db_query('DELETE FROM {webform_submitted_data} WHERE nid = %d AND sid = %d', $node->nid, $submission->sid); db_query('DELETE FROM {webform_submissions} WHERE nid = %d AND sid = %d', $node->nid, $submission->sid); + + // Delete Mollom session data. + if (module_exists('mollom')) { + mollom_data_delete('webform', $submission->sid); + } } /**