Skip to content

Commit

Permalink
Add admin notifications on claim submission. (#2)
Browse files Browse the repository at this point in the history
* Add admin notifications

* Build 1.0.3
  • Loading branch information
jonerickson authored Oct 16, 2023
1 parent 1c12d5a commit 4786cd2
Show file tree
Hide file tree
Showing 31 changed files with 270 additions and 33 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"laravel/pint": "^1.13"
}
}
85 changes: 85 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/data/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<setting key="dcma_warning_enable"><![CDATA[{"key":"dcma_warning_enable","default":""}]]></setting>
<setting key="dcma_warning_moderate_content"><![CDATA[{"key":"dcma_warning_moderate_content","default":""}]]></setting>
<setting key="dcma_warning_posting_restriction"><![CDATA[{"key":"dcma_warning_posting_restriction","default":""}]]></setting>
<setting key="dmca_admin_group"><![CDATA[{"key":"dmca_admin_group","default":""}]]></setting>
<setting key="dmca_approval_email"><![CDATA[{"key":"dmca_approval_email","default":""}]]></setting>
<setting key="dmca_automatic_deletion"><![CDATA[{"key":"dmca_automatic_deletion","default":""}]]></setting>
<setting key="dmca_claim_filed_email"><![CDATA[{"key":"dmca_claim_filed_email","default":""}]]></setting>
Expand Down
15 changes: 12 additions & 3 deletions src/data/emails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $report, $email</template_data><template_content_plaintext>{$message|raw}
{$report|raw}

-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_submitted_admin</template_name><template_content_html><![CDATA[<br>
A new claim has been submitted.
<br>
<br>
{$report|raw}
<br>
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$report, $email</template_data><template_content_plaintext>A new claim has been submitted.
{$report|raw}

-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_filed</template_name><template_content_html><![CDATA[{$message|raw}
{$report|raw}
<br>
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $email</template_data><template_content_plaintext>{$message|raw}
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $report, $email</template_data><template_content_plaintext>{$message|raw}

-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>denied</template_name><template_content_html><![CDATA[<strong style="font-size: 17px">Hi {$name},</strong>
<br>
Expand Down Expand Up @@ -64,7 +73,7 @@
-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_firststrike</template_name><template_content_html><![CDATA[{$message|raw}
{$report|raw}
<br>
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $email</template_data><template_content_plaintext>{$message|raw}
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $report, $email</template_data><template_content_plaintext>{$message|raw}

-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_secondstrike</template_name><template_content_html><![CDATA[{$message|raw}
{$report|raw}
Expand All @@ -74,7 +83,7 @@
-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_thirdstrike</template_name><template_content_html><![CDATA[{$message|raw}
{$report|raw}
<br>
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $email</template_data><template_content_plaintext>{$message|raw}
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>]]></template_content_html><template_data>$message, $report, $email</template_data><template_content_plaintext>{$message|raw}

-- {setting="board_name"}</template_content_plaintext><template_pinned>0</template_pinned></template><template><template_app>dmca</template_app><template_name>notification_onhold</template_name><template_content_html><![CDATA[{$message|raw}
{$report|raw}
Expand Down
11 changes: 8 additions & 3 deletions src/data/lang.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="dmca" version="10002">
<app key="dmca" version="10003">
<word key="__app_dmca" js="0">DMCA Copyright Claim Manager</word>
<word key="menutab__dmca" js="0">DMCA Manager</word>
<word key="menutab__dmca_icon" js="0">flag</word>
Expand All @@ -13,6 +13,7 @@
<word key="notifications__dmca_Claim" js="0">Copyright Claims</word>
<word key="notifications__dmca_Claim_desc" js="0">Receive notifications regarding updates about your filed copyright claims.</word>
<word key="mailsub__dmca_notification_submitted" js="0">Your copyright claim was submitted</word>
<word key="mailsub__dmca_notification_submitted_admin" js="0">A copyright claim was submitted</word>
<word key="mailsub__dmca_notification_approved" js="0">Your copyright claim was approved</word>
<word key="mailsub__dmca_notification_onhold" js="0">Your copyright claim was placed on hold</word>
<word key="mailsub__dmca_notification_denied" js="0">Your copyright claim was denied</word>
Expand All @@ -22,6 +23,7 @@
<word key="mailsub__dmca_notification_secondstrike" js="0">The copyright claim that was filed against some content you posted was approved. This is your second strike</word>
<word key="mailsub__dmca_notification_thirdstrike" js="0">The copyright claim that was filed against some content you posted was approved. This is your last strike</word>
<word key="mailsub__dmca_submitted" js="0">Your copyright claim was submitted</word>
<word key="mailsub__dmca_submitted_admin" js="0">A copyright claim was submitted</word>
<word key="mailsub__dmca_approved" js="0">Your copyright claim was approved</word>
<word key="mailsub__dmca_onhold" js="0">Your copyright claim was placed on hold</word>
<word key="mailsub__dmca_denied" js="0">Your copyright claim was denied</word>
Expand All @@ -37,6 +39,7 @@
<word key="dmca_wizard_final" js="0">Final Steps</word>
<word key="dmca_settings" js="0">Settings</word>
<word key="dmca_settings_tab_claims" js="0">Claims Management</word>
<word key="dmca_settings_tab_admin_notifications" js="0">Admin Notifications</word>
<word key="dmca_settings_tab_notifications" js="0">Claimant Notifications</word>
<word key="dmca_settings_tab_form" js="0">Claim Form</word>
<word key="dmca_settings_groups" js="0">Groups</word>
Expand All @@ -59,6 +62,8 @@
<word key="dmca_warning_desc" js="0">The warning reason that is applied when a member receives a copyright infringement strike.</word>
<word key="dmca_group" js="0">Infringing Group</word>
<word key="dmca_group_desc" js="0">The group the member will be moved to when they receive their third strike. Select none to not move a member.</word>
<word key="dmca_admin_group" js="0">Admin Group</word>
<word key="dmca_admin_group_desc" js="0">Members of the selected group will receive notifications when a claim has been submitted.</word>
<word key="dmca_claim_intro" js="0">Claim Form Intro</word>
<word key="dmca_claim_intro_desc" js="0">Text that will be shown above the claim submission form.</word>
<word key="dmca_faq" js="0">Frequently Asked Questions</word>
Expand Down Expand Up @@ -88,8 +93,8 @@
<word key="phone" js="0">Telephone</word>
<word key="urls" js="0">Infringing URLs</word>
<word key="urls_desc" js="0">Post a link of each URL containing the copyrighted material.</word>
<word key="description" js="0">Describe The Original Work</word>
<word key="description_desc" js="0">Describe the copyrighted material in full detail, including links to the original work or evidence of source material.</word>
<word key="description_work" js="0">Describe The Original Work</word>
<word key="description_work_desc" js="0">Describe the copyrighted material in full detail, including links to the original work or evidence of source material.</word>
<word key="accept_terms" js="0">I Understand And Agree</word>
<word key="accept_terms_desc" js="0">By checking this box, you attest, under penalty of perjury, that you have a good faith belief that use of the material in this report is not authorized by the copyright owner, its agent, or the law; AND you are authorized to act on behalf of the copyright owner; AND you understand, under 17 U.S.C. § 512(f), you may be liable for any damages, including costs and attorneys' fees, if you knowingly materially misrepresent reported material.</word>
<word key="signature" js="0">Digital Signature</word>
Expand Down
4 changes: 4 additions & 0 deletions src/data/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"key": "dcma_warning_posting_restriction",
"default": ""
},
{
"key": "dmca_admin_group",
"default": ""
},
{
"key": "dmca_approval_email",
"default": ""
Expand Down
3 changes: 2 additions & 1 deletion src/data/versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"10000": "1.0.0",
"10001": "1.0.1",
"10002": "1.0.2"
"10002": "1.0.2",
"10003": "1.0.3"
}
8 changes: 8 additions & 0 deletions src/dev/email/notification_submitted_admin.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ips:template parameters="$report, $email" />
<br>
A new claim has been submitted.
<br>
<br>
{$report|raw}
<br>
<em style='color: #8c8c8c'>&mdash; {setting="board_name"}</em>
5 changes: 5 additions & 0 deletions src/dev/email/notification_submitted_admin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ips:template parameters="$report, $email" />
A new claim has been submitted.
{$report|raw}

-- {setting="board_name"}
9 changes: 7 additions & 2 deletions src/dev/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'notifications__dmca_Claim_desc' => 'Receive notifications regarding updates about your filed copyright claims.',

'mailsub__dmca_notification_submitted' => 'Your copyright claim was submitted',
'mailsub__dmca_notification_submitted_admin' => 'A copyright claim was submitted',
'mailsub__dmca_notification_approved' => 'Your copyright claim was approved',
'mailsub__dmca_notification_onhold' => 'Your copyright claim was placed on hold',
'mailsub__dmca_notification_denied' => 'Your copyright claim was denied',
Expand All @@ -29,6 +30,7 @@
'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_submitted_admin' => 'A copyright claim was submitted',
'mailsub__dmca_approved' => 'Your copyright claim was approved',
'mailsub__dmca_onhold' => 'Your copyright claim was placed on hold',
'mailsub__dmca_denied' => 'Your copyright claim was denied',
Expand All @@ -47,6 +49,7 @@

'dmca_settings' => 'Settings',
'dmca_settings_tab_claims' => 'Claims Management',
'dmca_settings_tab_admin_notifications' => 'Admin Notifications',
'dmca_settings_tab_notifications' => 'Claimant Notifications',
'dmca_settings_tab_form' => 'Claim Form',
'dmca_settings_groups' => 'Groups',
Expand All @@ -69,6 +72,8 @@
'dmca_warning_desc' => 'The warning reason that is applied when a member receives a copyright infringement strike.',
'dmca_group' => 'Infringing Group',
'dmca_group_desc' => 'The group the member will be moved to when they receive their third strike. Select none to not move a member.',
'dmca_admin_group' => 'Admin Group',
'dmca_admin_group_desc' => 'Members of the selected group will receive notifications when a claim has been submitted.',
'dmca_claim_intro' => 'Claim Form Intro',
'dmca_claim_intro_desc' => 'Text that will be shown above the claim submission form.',
'dmca_faq' => 'Frequently Asked Questions',
Expand Down Expand Up @@ -99,8 +104,8 @@
'phone' => 'Telephone',
'urls' => 'Infringing URLs',
'urls_desc' => 'Post a link of each URL containing the copyrighted material.',
'description' => 'Describe The Original Work',
'description_desc' => 'Describe the copyrighted material in full detail, including links to the original work or evidence of source material.',
'description_work' => 'Describe The Original Work',
'description_work_desc' => 'Describe the copyrighted material in full detail, including links to the original work or evidence of source material.',
'accept_terms' => 'I Understand And Agree',
'accept_terms_desc' => 'By checking this box, you attest, under penalty of perjury, that you have a good faith belief that use of the material in this report is not authorized by the copyright owner, its agent, or the law; AND you are authorized to act on behalf of the copyright owner; AND you understand, under 17 U.S.C. § 512(f), you may be liable for any damages, including costs and attorneys\' fees, if you knowingly materially misrepresent reported material.',
'signature' => 'Digital Signature',
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/ApprovalEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/ClaimFiledEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/ClaimIntro.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/DeletedEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/DeniedEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/Faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/FinalSteps.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/core/EditorLocations/FirstStrikeEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function canAttach($member, $field)
* @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
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;
Expand Down
Loading

0 comments on commit 4786cd2

Please sign in to comment.