This module provides control and sending complaints to the comments.

Drupal 6 and 7 module version are available.

Features:

  • link to complaints about the comment will be added automatically;
  • complaints sent by AJAX;
  • module stores timestamp, IP address and user ID for each complaint;
  • author comment can not complain about your own comment;
    • for authorized users, verifies the user ID;
    • for anonymous users, checked by IP-address.
  • each user can complain about a comment only once:
    • for authorized users, verifies the user ID;
    • for anonymous users, checked by IP-address.
  • support views module;
  • form for the administration of complaints;
  • simple generation of links for complaints in the code.

Tasks:

  • the use of popup message to send complaints;
  • specifying the reasons for complaint.

Screenshot
Project page
Git repository

Drupal 6 module version: (git clone --branch 6.x-1.x http://git.drupal.org/sandbox/ilyin.eugenegmail.com/1406982.git comment_abuse)
Drupal 7 module version: (git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ilyin.eugenegmail.com/1406982.git comment_abuse)

Reviews of other projects:
http://drupal.org/node/1429208#comment-5561768
http://drupal.org/node/1426462#comment-5561978
http://drupal.org/node/1419816#comment-5562028
Additional review:
http://drupal.org/node/1435294#comment-5586272
http://drupal.org/node/1433838#comment-5586334
http://drupal.org/node/1431854#comment-5586410
Additional review:
http://drupal.org/node/1437126#comment-5590804
http://drupal.org/node/1437082#comment-5590832
http://drupal.org/node/1436718#comment-5590856
Additional review:
http://drupal.org/node/1419486#comment-5592046
http://drupal.org/node/1418366#comment-5592204
http://drupal.org/node/1427016#comment-5592238

CommentFileSizeAuthor
#4 some.jpg193.94 KBeugene.ilyin
#6 list.jpg33.5 KBeugene.ilyin
screenshot.jpg40.91 KBeugene.ilyin

Comments

patrickd’s picture

Status: Needs review » Needs work

welcome

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

Duplication?
There is already a module called abuse (http://drupal.org/project/abuse) that seems to have similar functionality. Can you explain why your module should be promoted instead of joining forces with the creators of abuse?
I think that this could also be done quite simple with a rules+flags+views combination, is there a need for it?

eugene.ilyin’s picture

Issue summary: View changes

Switched to 6.x-1.0 branch.

eugene.ilyin’s picture

Hello.

Thank you for http://ventral.org/pareview. It's very good tool.

Now I use 6.x-1.x branch.
I corrected the code errors in my module and added the file readme.txt.

My module allows you to send the complaint only to the comments. He is more purposeful.
It's very simple to use and contains only the most necessary functions.
In my module, a simple form of administrative complaints to the comments in the style of the standard listings Drupal.
The module also allows you to send a complaint AJAX and anonymous users should not specify any information (email, name, etc.), just click for report.
I developed this module because it was necessary for me to my current project.
My current project contains a large number of comments, and most users are anonymous.
I need a simple tool for complaints to the comments.

Beginner Drupal developer to be simple to install my module and start using. It is much easier than the "rules + flags + views" and does not require the installation of these modules.

patrickd’s picture

it would be nice to have a direct comparison of comment abuse and abuse

eugene.ilyin’s picture

Status: Closed (fixed) » Needs work
Issue tags: -PAreview: security
StatusFileSize
new193.94 KB
Abuse Comment abuse
Abuse module when you click the "Report" link you be redirected you to a form where you fill in the field reason and message and then returns back to the page.
If you are anonymous you must enter name and email address also.
Comment abuse module click the "Report" sends AJAX request and immediately informs the user that the complaint was received. The next release will be to attach a message via popup, but this field is not required.
Abuse does not check for anonymous users on IP address Comment abuse check for anonymous users on IP address
Ugly panel moderator. The panel moderator in the style of the standard Drupal listings.
Only Drupal 6 version. Drupal 6 & 7 version.





I tested the abuse module and I did not like:

  • I can't allow comment in panel moderation, but I super admin (screenshot).
  • If I'm an anonymous user, I can not complain about the comments of other anonymous users.
  • When I complained about the comment, he withdrew from publication, but the description shown for the node continues 3 comments, although the actual display 2.
webchick’s picture

Issue summary: View changes

add review links

IRuslan’s picture

Couple of notes.

'access callback' => TRUE,

It's undesirable. Access callback must check some permission, or custom callback.
If you hardcode callback to TRUE in code, you could not change it in UI.

function comment_abuse_list_page() {
  return drupal_get_form('comment_abuse_list_form');
}
function comment_abuse_options() {
  return drupal_get_form('comment_abuse_options_form');
}

This functions are useless now. You should set 'drupal_get_form' as 'page callback', and name of form in 'page arguments' for appropriate items in hook_menu.

In comment_abuse_get_allowed_comment_links_by_nid() function in SQL query
'WHERE ca.cid is NULL'
better will be (uppercase for all MySQL keywords)
'WHERE ca.cid IS NULL'

In comment_abuse_list_form() when you use pager_query, 50 - count of rows should be configurable, e.g. variable_get(...)

In comment_abuse_list_form_submit() cids collected and concatenated manually, use db_placeholders() instead.

In comment_abuse_link() what sense of static variable $comment_allow?

In JS file use Drupal.behaviors (see for details http://drupal.org/node/304258 ) instead default JQuery DOM ready bind - $(function(){}).

I guess almost all views handlers are useless. They make default things. Also there is a good practice to name handlers in that manner:
[MODULE_NAME]_handler_[HANDLER_TYPE]_[HANDLER_NAME]. HANDLER_TYPE - filter, sort, field, etc.. So relationship handler named wrong.

Also add indices to comment_abuse table on uid and nid fields, i guess it will be usefull.

eugene.ilyin’s picture

StatusFileSize
new33.5 KB

Okay!

I have updated
'access callback' => TRUE

Now it looks like this: 'access callback' => user_access('send complaints on comments')

Page callback now looks like this

'page callback' => 'drupal_get_form',
'page arguments' => array('comment_abuse_list_form')

Your MySQL syntax notice been applied.

Pager has beed refactored. Now there is a possibility to choose the number of complaints per page (default 10).
You can see it in screenshot.

Others fix a little later, and now I really want to sleep :D (3:17 AM)

eugene.ilyin’s picture

Now I use placeholders in comment_abuse_list_form_submit()

static variable in comment_abuse_link need for get once ID comments, for which complaint button are allowed.

Drupal behaviors used now.

eugene.ilyin’s picture

Issue summary: View changes

update repository link

eugene.ilyin’s picture

Issue summary: View changes

update rep path

eugene.ilyin’s picture

Views handlers and list of complaints on comments, has been refactored.
I added indexes for cid and uid in comment_abuse table.

I and my friend tested this module, bugs has been fixed.

If there are no errors will be found a couple of days I start to develop versions of the module for Drupal 7. I think I can do it for a week.

eugene.ilyin’s picture

Status: Needs work » Needs review

Review please! :D
Or promote to the full version if you think this project is good.

eugene.ilyin’s picture

Issue summary: View changes

update rep path

eugene.ilyin’s picture

fixed bug with permissions of complaints to comments

eugene.ilyin’s picture

Now the user can not complain about your own comments. For registered users verified User ID, and check for anonymous IP address.

Review please or promote to the full version if you think this project is good.

eugene.ilyin’s picture

Issue summary: View changes

set branch for git path

eugene.ilyin’s picture

Issue summary: View changes

update git rep address

eugene.ilyin’s picture

Issue summary: View changes

Updated list of features.

eugene.ilyin’s picture

Drupal 7 module version is ready!

eugene.ilyin’s picture

Added feature to control the count of complaints to the comments in moderation page for Drupal 7.

eugene.ilyin’s picture

review my module please.

patrickd’s picture

I'm sorry for the delay, but there are hundreds of applications and only a hand full of reviewers.
You can speed up you application by getting a review bonus, see #1410826: [META] Review bonus

eugene.ilyin’s picture

Thank you! I will be happy to help you.

eugene.ilyin’s picture

Issue summary: View changes

Update module description.

eugene.ilyin’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Issue summary: View changes

nvm

eugene.ilyin’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Issue tags: +PAreview: review bonus

I did a review of three other projects.

eugene.ilyin’s picture

Review my module please.

JupiterIII’s picture

I've reviewed and tested the 7.x version on my own core box. It works quite well, and makes excellent use of the content dashboard. It works great presently; though I have a suggestion for future development (if you intend to develop further): the "Status" column in the GUI is a "0" or "1". I understand that the 0 means unpublished and 1 means published, however it would be an excellent feature to translate that into "published" or "unpublished" (for simplicity's sake).

Beyond that, I find this to be a fantastic addition to any site that uses comments regularly.

eugene.ilyin’s picture

Thank you. Of course I will develop this project.
As soon as he get full version and the developers will use it, I can understand the direction in which works is most important.

I have a suggestion for future development (if you intend to develop further): the "Status" column in the GUI is a "0" or "1". I understand that the 0 means unpublished and 1 means published, however it would be an excellent feature to translate that into "published" or "unpublished" (for simplicity's sake).

It's a good idea, but in drupal 6 conversely comments with status 0 are published and with the status 1 of an unpublished. This can create confusing, but I'll thinking about it.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  • comment_abuse.info: empty comment, so remove that line.
  • comment_abuse_install(): don't concatenate translatable string like that, use placeholders instead.
  • comment_abuse_uninstall(): drupal_uninstall_schema() is not necessary in Drupal 7. Also don't touch the system table, this is all handled by drupal core.
  • define('__COMMENT_ABUSE_COMPLAINT_RECEIVED_MESSAGE', 'Your complaint has been received.');: all user facing text should run through t() for translation. Also in other places.
  • comment_abuse_init(): why do you need hook_init()? This will add the javascript to pages that don't even have comments on them. Why can't you use hook_comment_view()?
  • comment_abuse_content(): why do you take the uid from the path and not from the acting user? This is a security issue as an attacker with the "send complaints on comments" permission can insert data on behalf of another user by just sending a different user id!
  • $_SERVER['REMOTE_ADDR']: use ip_address() instead.
  • comment_abuse_admin(): why do you need to read from $_POST?
  • "variable_get('comment_abuse_complaint_received_message', __COMMENT_ABUSE_COMPLAINT_RECEIVED_MESSAGE)": this is user provided text, so you need to sanitize it to avoid XSS attacks. Please read the documentation about handling text in a secure fashion: http://drupal.org/node/28984

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Thank you for review. I fixed all errors.
When ventral.org/pareview again up and running, I can check my code style.

comment_abuse_admin(): why do you need to read from $_POST?

I get parameters from $_POST for delete comments. This is done by analogy with the comments module in the Drupal core.

eugene.ilyin’s picture

Issue tags: -PAreview: review bonus
eugene.ilyin’s picture

Status: Needs work » Needs review
Issue tags: +PAreview: review bonus

Module reviewed by ventral.org/pareview again and errors has not found.

klausi’s picture

Status: Needs review » Needs work

manual review:

  • "'#default_value' => check_plain(...)": form default values are sanitized by the form API automatically for you. Please read handling text in a secure fashion again: http://drupal.org/node/28984
  • "$comment->content['links']['comment']['#links']['comment-complaint']": use the power of the render system. If the title should be plain text, then don't set "html" to TRUE. Then you don't have to use check_plain() yourself. And for the attributes: no need to use check_plain() here either, as this will be passed through drupal_attributes(). Take a look at theme_links(), that is the function that will render your links: http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_links/7
  • comment_abuse_list_form(): "'#title' => check_plain($comment->subject),": same here, the render system will sanitize that for you. And of course double escaping is bad, so you should avoid that.

Otherwise I think this is nearly ready. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

Status: Needs work » Needs review
Issue tags: +PAreview: review bonus

I corrected your remarks. Thanks for your links to documents that have been useful to me.

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

Otherwise looks good to me. Removing review bonus tag, if there are still changes required you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Issue summary: View changes

add review links

eugene.ilyin’s picture

Issue summary: View changes

add review link

eugene.ilyin’s picture

I added @file doc block into all files.

About that:

comment_abuse_list_form(): "'#title' => check_plain($comment->subject),": same here, the render system will sanitize that for you. And of course double escaping is bad, so you should avoid that.

I looked "Form elements #description and #title" in http://drupal.org/node/28984.
I understand the title and description fields are not automatically sanitized in forms api and I have to do it myself.

Pareview script in ventral.org/pareview return this:

sites/all/modules/pareview_temp/test_candidate/./comment_abuse.admin.inc:
+135: [critical] Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
+144: [critical] Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.

Now I added check_plain in this lines.

eugene.ilyin’s picture

Issue tags: +PAreview: review bonus

I did new reviews.

You set "reviewed & tested by the community" status to my project. What now?

klausi’s picture

But the #title is not part of a form element in your case, it is part of link render array. Looks like a false positive in the coder review module.

About the project application workflow: a git administrator other than me will take a final look and either grant you the git vetted user role or bump this issue back to needs work if there are any outstanding issues that I missed.

eugene.ilyin’s picture

Okay. Now I remove check_plain from these lines.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

klausi’s picture

Issue tags: -PAreview: review bonus

Removing review bonus tag.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

PA robot’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.