Integrate actions with the report to Mollom screen

Michelle - April 12, 2008 - 00:59
Project:Mollom
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

This is perhaps out of scope for this module but it would save steps in moderating. On the screen that lets you choose how to report the spam, it would be nice to have checkboxes to ban user and ban the IP all in one shot.

Michelle

#1

zooki - May 17, 2009 - 14:38

Has this been implemented yet??

If not, what would be the right solution?

Also, can we configuer Mollom to not allow certain keywords / URLs..

#2

Dries - May 25, 2009 - 12:49

The Mollom screens can probably extended to provide that functionality. For the banning itself, we could leverage the IP blocking functionality that is part of Drupal core. This should be easy to implement.

#3

Michelle - May 25, 2009 - 16:05
Version:5.x-1.1» 6.x-1.x-dev

Nice. :) When I asked this a year ago, I was totally on Drupal 5. I've now moved all but one site to D6 and that one is in progress. So I'm changing my request to D6. :)

Michelle

#4

Dave Reid - October 14, 2009 - 00:21
Title:Delete and ban user / IP» Integrate actions with the report to Mollom screen

Marked #603174: Delete comment AND block user AND delete all comments by user as a duplicate of this issue.

The best way to accomplish this would to integrate actions with the report to Mollom page. Here's a quick mockup of how it would work:

245689-report-page.png

<?php
function mollom_menu() {
  ...
 
$items['mollom/report/node/%node'] = array(
   
'title' => 'Report to Mollom',
   
'page callback' => 'mollom_report_node_page',
   
'page arguments' => array(3),
   
'access callback' => TRUE,
  );
  ...
}

function
mollom_report_node_page($node) {
  return
drupal_get_form('mollom_report_form', 'node', $node, $node->title, user_load($node->uid));
}

function
mollom_get_object_actions($type) {
 
$actions = array();
 
$query = db_query("SELECT aid, description FROM {actions} WHERE type = '%s'", $type);
  while (
$action = db_fetch_object($query)) {
   
$actions[$action->aid] = $action->description;
  }
  return
$actions;
}

function
mollom_report_form($form_state, $type, $object, $object_title, $account = NULL) {
 
$form['object'] = array('#type' => 'value', '#value' => $object);
 
$form['account'] = array('#type' => 'value', '#value' => $account);

 
$form['object_feedback'] = array(
   
'#type' => 'select',
   
'#title' => t('How to report to Mollom'),
   
'#options' => array(
     
'none' => t("Don't send feedback to Mollom"),
     
'spam' => t('Report as spam or unsolicited advertising'),
     
'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 about the content you like and dislike, allowing Mollom to do a better job helping you 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."),
  );

 
$object_actions = mollom_get_object_actions($type);
 
$form['object_action'] = array(
   
'#type' => 'select',
   
'#title' => t('Action to perform on node %nodetitle', array('%nodetitle' => $object_title)),
   
'#options' => array(0 => 'None') + $object_actions,
   
'#defaul_value' => 0,
   
'#access' => $object_actions,
  );

 
$user_actions = mollom_get_object_actions('user');
 
$form['user_action'] = array(
   
'#type' => 'select',
   
'#title' => t('Action to perform on authoring user %username', array('%username' => $account->name)),
   
'#options' => array(0 => 'None') + $user_actions,
   
'#defaul_value' => 0,
   
'#access' => $account && $account->uid,
  );

  return
confirm_form(
   
$form,
   
t('Are you sure you want to report %object to Mollom?', array('%object' => $object_title)),
    isset(
$_GET['destination']) ? $_GET['destination'] : '',
   
t('This action cannot be undone.'),
   
t('Delete'),
   
t('Cancel')
  );
}
?>

AttachmentSize
245689-report-page.png 43.27 KB

#5

Dave Reid - October 14, 2009 - 16:20

Better yet might be to have 'reported node to Mollom' and 'reported comment to Mollom' available as a trigger which can be assigned actions normally.

 
 

Drupal is a registered trademark of Dries Buytaert.