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

Files: 
CommentFileSizeAuthor
#14 245689.diff2.87 KBdrumm
PASSED: [[SimpleTest]]: [MySQL] 6,971 pass(es).
[ View ]

Comments

zooki’s picture

Has this been implemented yet??

If not, what would be the right solution?

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

Dries’s picture

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.

Michelle’s picture

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

Dave Reid’s picture

Title:Delete and ban user / IP» Integrate actions with the report to Mollom screen
StatusFileSize
new43.27 KB

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="<a href="http://mollom.com">http://mollom.com</a>" rel="nofollow">http://mollom.com">http://mollom.com</a></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')
  );
}
?>
Dave Reid’s picture

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.

sun’s picture

By implementing #717212: Remove "report to Mollom" links and integrate with entity delete confirmation forms instead, you will be able to install "whatever" module that integrates with the existing forms, i.e. existing modules. Not duplicating functionality. Not sure whether such a module exists though, but at least Comment module already integrates with trigger/actions and related modules.

Therefore, I'm inclined to mark this won't fix. Thoughts?

sun’s picture

Title:Integrate actions with the report to Mollom screen» Integrate actions with reporting functionality on delete confirmation forms
Version:6.x-1.x-dev» 7.x-1.x-dev

Revised title. Bumping to 7.x.

sam_squarewave’s picture

I keep getting spam accounts and this feature would be killer.

sun’s picture

Version:7.x-1.x-dev» 7.x-2.x-dev
drumm’s picture

drumm’s picture

Status:Active» Needs review
StatusFileSize
new2.75 KB
PASSED: [[SimpleTest]]: [MySQL] 6,971 pass(es).
[ View ]

Attached is a patch for this. The integration works consistently with the core admin content pages.

eshta’s picture

Status:Needs review» Needs work

So Mollom currently has defined actions to delete comments and nodes and unpublish them after the work here: https://www.drupal.org/node/655846
Seems like the goal of this request is to include the Mollom delete form confirmation on regular delete actions within vbo as well. Am I reading this right? If so:

+++ b/mollom.module
@@ -917,6 +917,26 @@ function mollom_form_alter(&$form, &$form_state, $form_id) {
+        switch ($field->get_entity_type()) {

This feels very hard-coded. We have a hook (hook_mollom_form_list) where entities have their Mollom configuration defined. This includes access handling for reporting to Mollom. We'd need to check that at the least. We also allow for a delete callback in this configuration. I understand that the callback provided is for a single deletion. Perhaps we either 1) expand the configuration to allow for multiple; and/or 2) if that's not provided utilize the delete callback in the configuration to handle each deletion. Feels like this should be generalized to apply to all Mollom-supported entities rather than just nodes/comments.

drumm’s picture

Mollom currently has mollom_action_unpublish_comment and mollom_action_unpublish_node, but no delete and report action. The message I got from #655846: Mollom Actions was that this issue should be used to extend the delete action, similar to the core content admin pages.

I think the hard-codedness of this is on par with mollom_form_node_admin_content_alter() and mollom_form_comment_multiple_delete_confirm_alter(). There is a bit more logic since VBO is more flexible, and I decided to adapt code from _views_bulk_operations_get_field() rather than call that internal function.

drumm’s picture

Status:Needs work» Needs review
StatusFileSize
new2.87 KB
PASSED: [[SimpleTest]]: [MySQL] 6,971 pass(es).
[ View ]

Attached is an updated patch for this. I've only tested comments and nodes, so those are the only two entity types supported. And that's in line with what I can see works with _mollom_actions_access_callbacks()

The first two changes in _mollom_actions_access_callbacks() fix handling of $info['report access'], which is an array of permission strings, not an individual permission string. The final change makes getting the allowed entity IDs back out a little easier.

(If the thinking has changed since #655846-2: Mollom Actions and adding mollom_action_delete_{node|comment} next to the unpublish actions is actually the way we want to go, I can go in that direction.)

drumm’s picture

Anything I can do to help review here? Is the general approach okay?