Disallow editing of reported posts.

A perfect place for code snippets to small to be a MOD or a library.
Or for examples on how to use our libraries.
Post Reply
User avatar
tumba25
Supporter
Supporter
Posts: 1052
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Disallow editing of reported posts.

Post by tumba25 »

Sometimes you report a post and ten minutes late the author edits his post, either removes all or just the offending part. But at those times you might not want to allow that.

This is a short snippet to stop users that are not moderators from editing reported posts. It is really small and there are no setting or possibility to set that at report time. Might improve it at some later time, or someone else does that.

OPEN posting.php
FIND

Code: Select all

   case 'edit':
      if ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id))
      {
         $is_authed = true;
      }
ADD AFTER

Code: Select all

      if ($post_data['post_reported'] && !$auth->acl_get('m_edit', $forum_id))
      {
         trigger_error($user->lang['NO_EDIT_REPORTED']);
      }

OPEN language/en/posting.php
FIND

Code: Select all

'NO_DELETE_POLL_OPTIONS'   => 'You cannot delete existing poll options.',
ADD AFTER

Code: Select all

   'NO_EDIT_REPORTED' => 'You are not allowed to edit reported posts.',
User avatar
Ooopsie
Supporter
Supporter
Posts: 1213
Joined: 19 Aug 2010, 16:34
Location: Index, WA
Contact:

Re: Disallow editing of reported posts.

Post by Ooopsie »

Something like this has never crossed my mind. Many thanks for the snippet....
Image
Oopsie
_____
Be who you are and say what you feel.
Those who mind don't matter.
Those who matter don't mind.
- Dr. Seuss

_____
And be kinder than necessary, for everyone
you meet is fighting some kind of battle.
Kroketten
New member
New member
Posts: 2
Joined: 19 Dec 2012, 07:16

Re: Disallow editing of reported posts.

Post by Kroketten »

Thanks, it's awesome!
brunoais
New member
New member
Posts: 1
Joined: 21 Dec 2012, 23:21

Re: Disallow editing of reported posts.

Post by brunoais »

Nice touch ;).
I hope phpBB 3.1 comes quick. With that one this change is not needed anymore.
Kroketten
New member
New member
Posts: 2
Joined: 19 Dec 2012, 07:16

Re: Disallow editing of reported posts.

Post by Kroketten »

brunoais wrote:Nice touch ;).
I hope phpBB 3.1 comes quick. With that one this change is not needed anymore.

How do you know that?
User avatar
bonelifer
Administrator
Administrator
Posts: 477
Joined: 24 Jun 2006, 17:48
Real name: William
Location: htpc.MythBuntu

Re: Disallow editing of reported posts.

Post by bonelifer »

Because brunoais participates at phpBB's development board(AREA51): http://area51.phpbb.com/phpBB/

Post Revisions:
http://area51.phpbb.com/phpBB/viewtopic ... 08&t=42893

This means a copy of a previous version of the post will remain in the DB.

Soft Delete:
http://area51.phpbb.com/phpBB/viewtopic ... 08&t=32712
https://github.com/phpbb/phpbb3/pull/1017

This means even if they delete the post, as long as they don't have the "Can permanently delete own posts" permission, then the post is only SOFT DELETED.
Post Reply