DMCA Copyright Claim Manager
DMCA Manager
flag
@@ -17,9 +17,10 @@
Your copyright claim was placed on hold
Your copyright claim was denied
The item in your copyright claim has been deleted
- A copyright claim has been filed against some content you posted - first strike
- A copyright claim has been filed against some content you posted - second strike
- A copyright claim has been filed against some content you posted - last strike
+ A copyright claim has been filed against some content you posted
+ The copyright claim that was filed against some content you posted was approved. This is your first strike
+ The copyright claim that was filed against some content you posted was approved. This is your second strike
+ The copyright claim that was filed against some content you posted was approved. This is your last strike
Your copyright claim was submitted
Your copyright claim was approved
Your copyright claim was placed on hold
@@ -75,6 +76,7 @@
Default Claim Submitted Email
The email that will be sent when a copyright claim is submitted.
Infringing Member Notifications
+ Claim Filed Email
First Strike Email
Second Strike Email
Third Strike Email
diff --git a/src/data/schema.json b/src/data/schema.json
index acc777b..11cd087 100755
--- a/src/data/schema.json
+++ b/src/data/schema.json
@@ -72,18 +72,6 @@
"unsigned": false,
"auto_increment": false
},
- "description": {
- "name": "description",
- "type": "TEXT",
- "length": null,
- "decimals": null,
- "values": null,
- "allow_null": true,
- "default": null,
- "comment": "",
- "unsigned": false,
- "auto_increment": false
- },
"updated_at": {
"name": "updated_at",
"type": "INT",
@@ -179,6 +167,18 @@
"comment": "",
"unsigned": false,
"auto_increment": false
+ },
+ "description_work": {
+ "name": "description_work",
+ "type": "TEXT",
+ "length": null,
+ "decimals": null,
+ "values": null,
+ "allow_null": true,
+ "default": null,
+ "comment": "",
+ "unsigned": false,
+ "auto_increment": false
}
},
"indexes": {
diff --git a/src/data/settings.json b/src/data/settings.json
index 793bead..a30eef9 100755
--- a/src/data/settings.json
+++ b/src/data/settings.json
@@ -23,6 +23,10 @@
"key": "dmca_automatic_deletion",
"default": ""
},
+ {
+ "key": "dmca_claim_filed_email",
+ "default": ""
+ },
{
"key": "dmca_claim_intro",
"default": ""
diff --git a/src/data/theme.xml b/src/data/theme.xml
index 8b13015..14c791a 100644
--- a/src/data/theme.xml
+++ b/src/data/theme.xml
@@ -60,13 +60,15 @@
Address: |
{address="$report->address"} |
+
+ Digital Signature: |
+ {$report->signature} |
+
Describe The Original Work: |
- {$report->description|raw} |
- Digital Signature: |
- {$report->signature} |
+ {$report->description_work|raw} |
diff --git a/src/data/versions.json b/src/data/versions.json
index 65c8477..8c91e48 100755
--- a/src/data/versions.json
+++ b/src/data/versions.json
@@ -1,4 +1,5 @@
{
"10000": "1.0.0",
- "10001": "1.0.1"
+ "10001": "1.0.1",
+ "10002": "1.0.2"
}
\ No newline at end of file
diff --git a/src/dev/email/filed.phtml b/src/dev/email/filed.phtml
new file mode 100644
index 0000000..5373da2
--- /dev/null
+++ b/src/dev/email/filed.phtml
@@ -0,0 +1,7 @@
+
+Hi {$name},
+
+{$message|raw}
+{$report|raw}
+
+— {setting="board_name"}
\ No newline at end of file
diff --git a/src/dev/email/filed.txt b/src/dev/email/filed.txt
new file mode 100644
index 0000000..4470700
--- /dev/null
+++ b/src/dev/email/filed.txt
@@ -0,0 +1,6 @@
+
+Hi {$name},
+{$message|raw}
+{$report|raw}
+
+-- {setting="board_name"}
\ No newline at end of file
diff --git a/src/dev/email/notification_filed.phtml b/src/dev/email/notification_filed.phtml
new file mode 100644
index 0000000..be6ce64
--- /dev/null
+++ b/src/dev/email/notification_filed.phtml
@@ -0,0 +1,5 @@
+
+{$message|raw}
+{$report|raw}
+
+— {setting="board_name"}
\ No newline at end of file
diff --git a/src/dev/email/notification_filed.txt b/src/dev/email/notification_filed.txt
new file mode 100644
index 0000000..4d5da07
--- /dev/null
+++ b/src/dev/email/notification_filed.txt
@@ -0,0 +1,4 @@
+
+{$message|raw}
+
+-- {setting="board_name"}
\ No newline at end of file
diff --git a/src/dev/html/front/report/report.phtml b/src/dev/html/front/report/report.phtml
index 1b946b5..eac40cf 100644
--- a/src/dev/html/front/report/report.phtml
+++ b/src/dev/html/front/report/report.phtml
@@ -42,13 +42,15 @@
Address: |
{address="$report->address"} |
+
+ Digital Signature: |
+ {$report->signature} |
+
Describe The Original Work: |
- {$report->description|raw} |
- Digital Signature: |
- {$report->signature} |
+ {$report->description_work|raw} |
diff --git a/src/dev/lang.php b/src/dev/lang.php
index 54b15cd..f008304 100644
--- a/src/dev/lang.php
+++ b/src/dev/lang.php
@@ -23,9 +23,10 @@
'mailsub__dmca_notification_onhold' => 'Your copyright claim was placed on hold',
'mailsub__dmca_notification_denied' => 'Your copyright claim was denied',
'mailsub__dmca_notification_deleted' => 'The item in your copyright claim has been deleted',
- 'mailsub__dmca_notification_firststrike' => 'A copyright claim has been filed against some content you posted - first strike',
- 'mailsub__dmca_notification_secondstrike' => 'A copyright claim has been filed against some content you posted - second strike',
- 'mailsub__dmca_notification_thirdstrike' => 'A copyright claim has been filed against some content you posted - last strike',
+ 'mailsub__dmca_notification_filed' => 'A copyright claim has been filed against some content you posted',
+ 'mailsub__dmca_notification_firststrike' => 'The copyright claim that was filed against some content you posted was approved. This is your first strike',
+ 'mailsub__dmca_notification_secondstrike' => 'The copyright claim that was filed against some content you posted was approved. This is your second strike',
+ 'mailsub__dmca_notification_thirdstrike' => 'The copyright claim that was filed against some content you posted was approved. This is your last strike',
'mailsub__dmca_submitted' => 'Your copyright claim was submitted',
'mailsub__dmca_approved' => 'Your copyright claim was approved',
@@ -85,6 +86,7 @@
'dmca_submitted_email' => 'Default Claim Submitted Email',
'dmca_submitted_email_desc' => 'The email that will be sent when a copyright claim is submitted.',
'dmca_settings_tab_strike_notifications' => 'Infringing Member Notifications',
+ 'dmca_claim_filed_email' => 'Claim Filed Email',
'dmca_first_strike_email' => 'First Strike Email',
'dmca_second_strike_email' => 'Second Strike Email',
'dmca_third_strike_email' => 'Third Strike Email',
diff --git a/src/extensions/core/EditorLocations/ClaimFiledEmail.php b/src/extensions/core/EditorLocations/ClaimFiledEmail.php
new file mode 100644
index 0000000..55289b3
--- /dev/null
+++ b/src/extensions/core/EditorLocations/ClaimFiledEmail.php
@@ -0,0 +1,130 @@
+Invision Power Services, Inc.
+ * @copyright (c) Invision Power Services, Inc.
+ * @license https://www.invisioncommunity.com/legal/standards/
+ * @package Invision Community
+ * @subpackage DMCA Copyright Claim Manager
+ * @since 29 Aug 2023
+ */
+
+namespace IPS\dmca\extensions\core\EditorLocations;
+
+/* To prevent PHP errors (extending class does not exist) revealing path */
+if (!\defined('\IPS\SUITE_UNIQUE_KEY')) {
+ header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 403 Forbidden');
+ exit;
+}
+
+/**
+ * Editor Extension: ClaimFiledEmail
+ */
+class _ClaimFiledEmail
+{
+ /**
+ * Can we use HTML in this editor?
+ *
+ * @param \IPS\Member $member The member
+ * @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
+ */
+ public function canUseHtml($member)
+ {
+ return false;
+ }
+
+ /**
+ * Can we use attachments in this editor?
+ *
+ * @param \IPS\Member $member The member
+ * @param \IPS\Helpers\Form\Editor $field The editor field
+ * @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
+ */
+ public function canAttach($member, $field)
+ {
+ return false;
+ }
+
+ /**
+ * Permission check for attachments
+ *
+ * @param \IPS\Member $member The member
+ * @param int|null $id1 Primary ID
+ * @param int|null $id2 Secondary ID
+ * @param string|null $id3 Arbitrary data
+ * @param array $attachment The attachment data
+ * @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
+ * @return bool
+ */
+ public function attachmentPermissionCheck($member, $id1, $id2, $id3, $attachment, $viewOnly=false): bool
+ {
+ /* Make sure that you add a relevant permission check to prevent attachments being accessed via ID enumeration. */
+ return true;
+ }
+
+ /**
+ * Attachment lookup
+ *
+ * @param int|null $id1 Primary ID
+ * @param int|null $id2 Secondary ID
+ * @param string|null $id3 Arbitrary data
+ * @return \IPS\Http\Url|\IPS\Content|\IPS\Node\Model
+ * @throws \LogicException
+ */
+ public function attachmentLookup($id1, $id2, $id3)
+ {
+ // return \IPS\Http\Url::internal( ... );
+ }
+
+ /**
+ * Rebuild attachment images in non-content item areas
+ *
+ * @param int|null $offset Offset to start from
+ * @param int|null $max Maximum to parse
+ * @return int Number completed
+ * @note This method is optional and will only be called if it exists
+ */
+ //public function rebuildAttachmentImages( $offset, $max )
+ //{
+ //}
+
+ /**
+ * Rebuild content post-upgrade
+ *
+ * @param int|null $offset Offset to start from
+ * @param int|null $max Maximum to parse
+ * @return int Number completed
+ * @note This method is optional and will only be called if it exists
+ */
+ //public function rebuildContent( $offset, $max )
+ //{
+ //}
+
+ /**
+ * @brief Store lazy loading status ( true = enabled )
+ */
+ protected $_lazyLoadStatus = null;
+
+ /**
+ * Rebuild content to add or remove lazy loading
+ *
+ * @param int|null $offset Offset to start from
+ * @param int|null $max Maximum to parse
+ * @param bool $status Enable/Disable lazy loading
+ * @return int Number completed
+ * @note This method is optional and will only be called if it exists
+ */
+ //public function rebuildLazyLoad( $offset, $max, $status=TRUE )
+ //{
+ //}
+
+ /**
+ * Total content count to be used in progress indicator
+ *
+ * @return int Total Count
+ */
+ //public function contentCount()
+ //{
+ // return \IPS\Db::i()->select( 'COUNT(*) as count', '...', "..." )->setKeyField('count')->first();
+ //}
+}
diff --git a/src/extensions/core/Notifications/Claim.php b/src/extensions/core/Notifications/Claim.php
index 57e873f..f6a8ad4 100644
--- a/src/extensions/core/Notifications/Claim.php
+++ b/src/extensions/core/Notifications/Claim.php
@@ -33,7 +33,7 @@ public static function configurationOptions(\IPS\Member $member = null): array
return array(
'membersuspension' => array(
'type' => 'standard',
- 'notificationTypes' => ['submitted', 'approved', 'onhold', 'denied', 'deleted', 'firststrike', 'secondstrike', 'thirdstrike'],
+ 'notificationTypes' => ['submitted', 'approved', 'onhold', 'denied', 'deleted', 'filed', 'firststrike', 'secondstrike', 'thirdstrike'],
'default' => ['email', 'inline'],
'disabled' => ['push'],
'description' => 'notifications__dmca_Claim_desc',
@@ -53,9 +53,9 @@ public static function configurationOptions(\IPS\Member $member = null): array
public function parse_submitted(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "Your copyright claim was submitted",
+ 'title' => "Your copyright claim was submitted.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "Your copyright claim was submitted",
+ 'content' => "Your copyright claim was submitted.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -70,9 +70,9 @@ public function parse_submitted(\IPS\Notification\Inline $notification, $htmlEsc
public function parse_approved(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "Your copyright claim was approved",
+ 'title' => "Your copyright claim was approved.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "Your copyright claim was approved",
+ 'content' => "Your copyright claim was approved.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -87,9 +87,9 @@ public function parse_approved(\IPS\Notification\Inline $notification, $htmlEsca
public function parse_onhold(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "Your copyright claim was placed on hold",
+ 'title' => "Your copyright claim was placed on hold.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "Your copyright claim was placed on hold",
+ 'content' => "Your copyright claim was placed on hold.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -104,9 +104,9 @@ public function parse_onhold(\IPS\Notification\Inline $notification, $htmlEscape
public function parse_denied(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "Your copyright claim was denied",
+ 'title' => "Your copyright claim was denied.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "Your copyright claim was denied",
+ 'content' => "Your copyright claim was denied.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -121,9 +121,26 @@ public function parse_denied(\IPS\Notification\Inline $notification, $htmlEscape
public function parse_deleted(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "The item in your copyright claim has been deleted",
+ 'title' => "The item in your copyright claim has been deleted.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "The item in your copyright claim has been deleted",
+ 'content' => "The item in your copyright claim has been deleted.",
+ 'author' => \IPS\Member::loggedIn(),
+ );
+ }
+
+ /**
+ * Parse notification: filed
+ *
+ * @param \IPS\Notification\Inline $notification The notification
+ * @param bool $htmlEscape TRUE to escape HTML in title
+ * @return array
+ */
+ public function parse_filed(\IPS\Notification\Inline $notification, $htmlEscape=true): array
+ {
+ return array(
+ 'title' => "A copyright claim has been filed against some content you posted. Check your email for more information.",
+ 'url' => \IPS\Http\Url::internal(''),
+ 'content' => "A copyright claim has been filed against some content you posted. Check your email for more information.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -138,9 +155,9 @@ public function parse_deleted(\IPS\Notification\Inline $notification, $htmlEscap
public function parse_firststrike(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "A copyright claim has been filed against some content you posted - first strike",
+ 'title' => "The copyright claim that was filed against some content you posted was approved. This is your first strike. Check your email for more information.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "A copyright claim has been filed against some content you posted - first strike",
+ 'content' => "The copyright claim that was filed against some content you posted was approved. This is your first strike. Check your email for more information.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -155,9 +172,9 @@ public function parse_firststrike(\IPS\Notification\Inline $notification, $htmlE
public function parse_secondstrike(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "A copyright claim has been filed against some content you posted - second strike",
+ 'title' => "The copyright claim that was filed against some content you posted was approved. This is your second strike. Check your email for more information.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "A copyright claim has been filed against some content you posted - second strike",
+ 'content' => "The copyright claim that was filed against some content you posted was approved. This is your second strike. Check your email for more information.",
'author' => \IPS\Member::loggedIn(),
);
}
@@ -172,9 +189,9 @@ public function parse_secondstrike(\IPS\Notification\Inline $notification, $html
public function parse_thirdstrike(\IPS\Notification\Inline $notification, $htmlEscape=true): array
{
return array(
- 'title' => "A copyright claim has been filed against some content you posted - last strike",
+ 'title' => "The copyright claim that was filed against some content you posted was approved. This is your last strike. Check your email for more information.",
'url' => \IPS\Http\Url::internal(''),
- 'content' => "A copyright claim has been filed against some content you posted - last strike",
+ 'content' => "The copyright claim that was filed against some content you posted was approved. This is your last strike. Check your email for more information.",
'author' => \IPS\Member::loggedIn(),
);
}
diff --git a/src/modules/admin/system/settings.php b/src/modules/admin/system/settings.php
index 914be5c..a713959 100644
--- a/src/modules/admin/system/settings.php
+++ b/src/modules/admin/system/settings.php
@@ -114,6 +114,11 @@ protected function manage()
$form->addTab('dmca_settings_tab_strike_notifications');
$form->addHeader('dmca_settings');
+ $form->add(new Form\Editor('dmca_claim_filed_email', \IPS\Settings::i()->dmca_claim_filed_email, true, [
+ 'autoSaveKey' => 'dmca_claim_filed_email',
+ 'app' => 'dmca',
+ 'key' => 'ClaimFiledEmail'
+ ]));
$form->add(new Form\Editor('dmca_first_strike_email', \IPS\Settings::i()->dmca_first_strike_email, true, [
'autoSaveKey' => 'dmca_first_strike_email',
'app' => 'dmca',
diff --git a/src/setup/upg_10002/data.json b/src/setup/upg_10002/data.json
new file mode 100644
index 0000000..1be4d9f
--- /dev/null
+++ b/src/setup/upg_10002/data.json
@@ -0,0 +1,23 @@
+{
+ "id": 10002,
+ "name": "1.0.2",
+ "steps": {
+ "queries": true,
+ "lang": true,
+ "theme": true,
+ "themeSettings": false,
+ "javascript": false,
+ "emailTemplates": true,
+ "hooks": false,
+ "acpSearchKeywords": false,
+ "settings": true,
+ "tasks": false,
+ "modules": false,
+ "widgets": false,
+ "customOptions": false,
+ "customRoutines": false
+ },
+ "forceMainUpgrader": false,
+ "forceManualDownloadNoCiC": false,
+ "forceManualDownloadCiC": false
+}
\ No newline at end of file
diff --git a/src/setup/upg_10002/emailTemplates.json b/src/setup/upg_10002/emailTemplates.json
new file mode 100644
index 0000000..7206172
--- /dev/null
+++ b/src/setup/upg_10002/emailTemplates.json
@@ -0,0 +1,8 @@
+{
+ "added": [
+ "notification_filed",
+ "filed"
+ ],
+ "edited": [],
+ "removed": []
+}
\ No newline at end of file
diff --git a/src/setup/upg_10002/lang.json b/src/setup/upg_10002/lang.json
new file mode 100644
index 0000000..4c42647
--- /dev/null
+++ b/src/setup/upg_10002/lang.json
@@ -0,0 +1,19 @@
+{
+ "normal": {
+ "added": [
+ "mailsub__dmca_notification_filed",
+ "dmca_claim_filed_email"
+ ],
+ "edited": [
+ "mailsub__dmca_notification_firststrike",
+ "mailsub__dmca_notification_secondstrike",
+ "mailsub__dmca_notification_thirdstrike"
+ ],
+ "removed": []
+ },
+ "js": {
+ "added": [],
+ "edited": [],
+ "removed": []
+ }
+}
\ No newline at end of file
diff --git a/src/setup/upg_10002/queries.json b/src/setup/upg_10002/queries.json
new file mode 100755
index 0000000..a330261
--- /dev/null
+++ b/src/setup/upg_10002/queries.json
@@ -0,0 +1,21 @@
+{
+ "1": {
+ "method": "changeColumn",
+ "params": [
+ "dmca_reports",
+ "description",
+ {
+ "name": "description_work",
+ "type": "TEXT",
+ "length": null,
+ "decimals": null,
+ "values": null,
+ "allow_null": true,
+ "default": null,
+ "comment": "",
+ "unsigned": false,
+ "auto_increment": false
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/src/setup/upg_10002/settings.json b/src/setup/upg_10002/settings.json
new file mode 100644
index 0000000..cb20db8
--- /dev/null
+++ b/src/setup/upg_10002/settings.json
@@ -0,0 +1,7 @@
+{
+ "added": [
+ "dmca_claim_filed_email"
+ ],
+ "edited": [],
+ "removed": []
+}
\ No newline at end of file
diff --git a/src/setup/upg_10002/theme.json b/src/setup/upg_10002/theme.json
new file mode 100644
index 0000000..0a7dd47
--- /dev/null
+++ b/src/setup/upg_10002/theme.json
@@ -0,0 +1,19 @@
+{
+ "html": {
+ "added": [],
+ "edited": [
+ "front\/report\/report"
+ ],
+ "removed": []
+ },
+ "css": {
+ "added": [],
+ "edited": [],
+ "removed": []
+ },
+ "resources": {
+ "added": [],
+ "edited": [],
+ "removed": []
+ }
+}
\ No newline at end of file
diff --git a/src/sources/Reports/Report.php b/src/sources/Reports/Report.php
index e549633..a2440ef 100644
--- a/src/sources/Reports/Report.php
+++ b/src/sources/Reports/Report.php
@@ -143,7 +143,7 @@ public function form(&$form)
}
}
}, null, null, 'other'));
- $form->add(new Editor('description', $this->description ?? null, true, [
+ $form->add(new Editor('description_work', $this->description_work ?? null, true, [
'app' => 'dmca',
'key' => 'ReportDescription',
'autoSaveKey' => 'dmca_report',
@@ -185,6 +185,26 @@ public function save()
} else {
Email::buildFromTemplate('dmca', 'submitted', [$this->name, Settings::i()->dmca_submitted_email, $this], Email::TYPE_TRANSACTIONAL)->send($this->email);
}
+
+ $urls = explode(',', $this->urls);
+
+ $emailProcessed = [];
+ foreach ($urls as $url) {
+ $item = self::findContentItem($url);
+
+ if (\is_object($item) && method_exists($item, 'author')) {
+ $infringingMember = $item->author();
+
+ if ($infringingMember && $infringingMember->member_id && !\in_array($infringingMember->member_id, $emailProcessed)) {
+
+ $notification = new Notification(Application::load('dmca'), 'filed', null, [Settings::i()->dmca_claim_filed_email, $this]);
+ $notification->recipients->attach($infringingMember);
+ $notification->send();
+
+ $emailProcessed[] = $infringingMember->member_id;
+ }
+ }
+ }
}
parent::save();