Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -879,11 +879,12 @@ abstract class Content extends ActiveRecord
|
||||
*
|
||||
* @param string $reportContent Report content message from member
|
||||
* @param int $reportType Report type (see constants in \IPS\core\Reports\Report)
|
||||
* @param Member|null $member Member making the report (or NULL for loggedIn())
|
||||
* @param Member|null $member Member making the report (or NULL for loggedIn())
|
||||
* @param array $guestDetails Details for a guest report
|
||||
* @return Report
|
||||
* @throws UnexpectedValueException If there is a permission error - you should only call this method after checking canReport
|
||||
*/
|
||||
public function report( string $reportContent, int $reportType=1, Member|null $member=null ): Report
|
||||
public function report( string $reportContent, int $reportType=1, Member|null $member=null, array $guestDetails=array() ): Report
|
||||
{
|
||||
$member = ( $member ) ?: Member::loggedIn();
|
||||
|
||||
@@ -936,9 +937,16 @@ abstract class Content extends ActiveRecord
|
||||
'report_by' => (int) $member->member_id,
|
||||
'date_reported' => time(),
|
||||
'ip_address' => Request::i()->ipAddress(),
|
||||
'report_type' => $member->member_id ? $reportType : 0
|
||||
'report_type' => ( ! $member->member_id and Settings::i()->automoderation_enabled ) ? 0 : $reportType
|
||||
);
|
||||
|
||||
|
||||
if ( count( $guestDetails ) and isset( $guestDetails['email'] ) )
|
||||
{
|
||||
/* Guest name can be optional */
|
||||
$reportInsert['guest_name'] = isset( $guestDetails['name'] ) ? $guestDetails['name'] : '';
|
||||
$reportInsert['guest_email'] = $guestDetails['email'];
|
||||
}
|
||||
|
||||
$insertID = Db::i()->insert( 'core_rc_reports', $reportInsert );
|
||||
$reportInsert['id'] = $insertID;
|
||||
|
||||
|
||||
Reference in new issue
Block a user