Jump to content

? Reporting sends an email to the incriminated member… ?


LaCollision

Recommended Posts

Out of curiosity, was the member that's content was reported also a moderator? 

I honestly don't see this being a thing.  The more likely solution is that the person being reported had permissions to view reports and had e-mail notifications turned on for those reports.

Link to comment
Share on other sites

/* Send notification to mods */
		$moderators = array( 'm' => array(), 'g' => array() );
		foreach ( \IPS\Db::i()->select( '*', 'core_moderators' ) as $mod )
		{
			$canView = FALSE;
			if ( $mod['perms'] == '*' )
			{
				$canView = TRUE;
			}
			if ( $canView === FALSE )
			{
				$perms = json_decode( $mod['perms'], TRUE );
				
				if ( isset( $perms['can_view_reports'] ) AND $perms['can_view_reports'] === TRUE )
				{
					$canView = TRUE;
				}
			}
			if ( $canView === TRUE )
			{
				$moderators[ $mod['type'] ][] = $mod['id'];
			}
		}
		$notification = new \IPS\Notification( \IPS\Application::load('core'), 'report_center', $index, array( $index, $reportInsert, $this ) );
		foreach ( \IPS\Db::i()->select( '*', 'core_members', ( count( $moderators['m'] ) ? \IPS\Db::i()->in( 'member_id', $moderators['m'] ) . ' OR ' : '' ) . \IPS\Db::i()->in( 'member_group_id', $moderators['g'] ) . ' OR ' . \IPS\Db::i()->findInSet( 'mgroup_others', $moderators['g'] ) ) as $member )
		{
			$notification->recipients->attach( \IPS\Member::constructFromData( $member ) );
		}
		$notification->send();

The notification is sent here.  It's looking for individual members with 'can_view_reports' permissions and any groups that have 'can_view_reports' permissions.  If the member being reported is in one of the groups with that permission, they'd get notified. 

That said, I could possibly see the benefit in having the moderator being reported excluded from notifications and hide the report from them in the report center, but that's more of a bandaid... If a moderator is legitimately being reported, their moderator status should be re-considered. IMO, I don't see this being a programatic solution but rather an administration solution. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...