Hi there,

I was trying to use this module but found that the anonymous users are unnable to flag another anonymous comments (they can report registered users comments).

Cheers, Simon.

CommentFileSizeAuthor
#3 abuse_own_content.patch702 byteszilverdistel

Comments

jaydub’s picture

Assigned: Unassigned » jaydub
jaydub’s picture

The abuse_link() function contains a test to check if the user is attempting to flag their own piece of content.

  if ($object && $user && $user->uid == $object->uid) {
    // Don't want user to flag their own content
    return $links;
  }

If you have an anonymous user who is viewing a node or comment created by another
anonymous user (or themselves really), then $user->uid == $object->uid will be true
as both will be the value of the anonymous user 0.

There is a quick workaround:

  if ($object && $user && ($user->uid != 0 && $user->uid == $object->uid)) {
    // Don't want user to flag their own content
    return $links;
  }

There are other problems with allowing anonymous users to be able to submit abuse
however. Until further module development allows for better controls over anonymous
reporting I think it's advisable to disable permission for anonymous users to report
abuse.

zilverdistel’s picture

Version: 5.x-1.x-dev » 6.x-1.1-alpha1
StatusFileSize
new702 bytes

I created a patch for this. It also excludes the admin from hiding the links from the abuse module. Ideally the code should check proper permissions.

jcisio’s picture

Status: Active » Needs work

A good step for a 3 year old problem :) To properly fix it:
- If uid==0 and $object->uid==0, then check $object->name with the current anonymous username. AFAIK, there is two anonymous users can't have a same name. If $user->name is empty, then we don't have other choice than accept it.
- Don't introduce uid 1 here. It changes the current behavior.

zilverdistel’s picture

You're right about the uid=1. That was only a quickfix that worked in my specific case. Ideally this should be handled as follows ...

There are the permissions 'administer abuse reports' and 'administer all abuse reports'.

administer abuse reports:
A user with this permission should be able to see the link 'View abuse history' if he's viewing his own content.

administer all abuse reports:
A user with this permission should allways be able to see the link 'View abuse history'.

jcisio’s picture

Title: Anonymous users can´t report another anonymous comments » Anonymous users can't report another anonymous comments
Assigned: jaydub » Unassigned

I don't see why uid 1 needs to report his own content. But yes, there should be a permission to hide own contents. New features will go in 2.x branch. I'm working on it, there could be not many major modification, but I need continous time to work. I hope it will be available soon.

Now we are fixing a bug.