PluginProbe
GDPR / trunk
GDPR vtrunk
trunk 1.4.7 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2
gdpr / admin / partials / tools.php

tools.php in GDPR trunk, at admin/partials/tools.php

134 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Provide a admin area view for the plugin
5 *
6 * This file is used to markup the admin-facing aspects of the plugin.
7 *
8 * @link https://trewknowledge.com
9 * @since 1.0.0
10 *
11 * @package GDPR
12 * @subpackage admin/partials
13 */
14
15 include_once plugin_dir_path( __FILE__ ) . 'templates/tmpl-tools.php';
16
17 if ( isset( $_GET['type'], $_GET['key'] ) ) { // phpcs:ignore
18
19 if ( 'data-breach-confirmed' === $_GET['type'] ) { // phpcs:ignore
20 $key = sanitize_text_field( wp_unslash( $_GET['key'] ) ); // phpcs:ignore
21
22 $data_breach = get_option( 'gdpr_data_breach_initiated', array( 'key' => '' ) );
23 if ( ! empty( $data_breach ) ) {
24 if ( $key === $data_breach['key'] ) {
25 GDPR_Email::prepare_data_breach_emails( $key );
26 delete_option( 'gdpr_data_breach_initiated' );
27
28 $time = wp_next_scheduled( 'clean_gdpr_data_breach_request' );
29 if ( $time ) {
30 wp_unschedule_event( $time, 'clean_gdpr_data_breach_request' );
31 }
32
33 add_settings_error( 'gdpr', 'resolved', esc_html__( 'Data Breach confirmed. Preparing bulk emails.', 'gdpr' ), 'updated' );
34 }
35 }
36 }
37 }
38
39 ?>
40
41 <div class="wrap gdpr">
42 <h1><?php esc_html_e( 'Tools', 'gdpr' ); ?></h1>
43 <?php settings_errors(); ?>
44 <div class="nav-tab-wrapper">
45 <?php foreach ( $tabs as $key => $value ) : ?>
46 <a href="<?php echo esc_url( '#' . $key ); ?>" class="nav-tab">
47 <?php echo esc_html( $value ); ?>
48 </a>
49 <?php endforeach; ?>
50 </div>
51
52 <div class="gdpr-tab hidden" data-id="access">
53 <h2><?php esc_html_e( 'Access Data', 'gdpr' ); ?></h2>
54 <div class="postbox not-full">
55 <form class="gdpr-access-data-lookup" method="post">
56 <div class="inside">
57 <?php wp_nonce_field( 'gdpr-access-data', 'gdpr_access_data_nonce' ); ?>
58 <h4>
59 <label for="gdpr-request-email-lookup"><?php esc_html_e( 'Search by email', 'gdpr' ); ?></label>
60 </h4>
61 <input type="email" name="user_email" class="regular-text" placeholder="<?php esc_attr_e( 'email@domain.com', 'gdpr' ); ?>" required>
62 <?php submit_button( esc_html__( 'Search', 'gdpr' ), 'primary', '', false ); ?>
63 <span class="spinner"></span>
64 </div>
65 </form>
66 </div>
67 </div>
68
69 <div class="gdpr-tab hidden" data-id="data-breach">
70 <h2><?php esc_html_e( 'Data Breach', 'gdpr' ); ?></h2>
71 <form class="gdpr-data-breach-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
72 <?php wp_nonce_field( 'gdpr-data-breach', 'gdpr_data_breach_nonce' ); ?>
73 <input type="hidden" name="action" value="gdpr_data_breach">
74 <table class="form-table">
75 <tr>
76 <th><?php esc_html_e( 'Email content', 'gdpr' ); ?></th>
77 <td>
78 <textarea name="gdpr-data-breach-email-content" class="large-text" rows="5"></textarea>
79 <span class="description"><?php esc_html_e( 'The content that the end user will see before the below information.', 'gdpr' ); ?></span>
80 </td>
81 </tr>
82 <tr>
83 <th><?php esc_html_e( 'Nature of the personal data breach', 'gdpr' ); ?></th>
84 <td>
85 <textarea name="gdpr-data-breach-nature" class="large-text" rows="5" required></textarea>
86 <span class="description"><?php esc_html_e( 'Describe the nature of the personal data breach including where possible, the categories and the approximate number of data subjects concerned and the categories and the approximate number of personal data records concerned.', 'gdpr' ); ?></span>
87 </td>
88 </tr>
89 <tr>
90 <th><?php esc_html_e( 'Name and contact details of the data protection officer', 'gdpr' ); ?></th>
91 <td>
92 <textarea name="gdpr-name-contact-details-protection-officer" class="large-text" rows="5" required></textarea>
93 <span class="description"><?php esc_html_e( 'Communicate the name and contact details of the data protection officer or another point of contact where more information can be obtained.', 'gdpr' ); ?></span>
94 </td>
95 </tr>
96 <tr>
97 <th><?php esc_html_e( 'Likely consequences of the personal data breach', 'gdpr' ); ?></th>
98 <td>
99 <textarea name="gdpr-likely-consequences" class="large-text" rows="5" required></textarea>
100 </td>
101 </tr>
102 <tr>
103 <th><?php esc_html_e( 'Measures taken or proposed to be taken', 'gdpr' ); ?></th>
104 <td>
105 <textarea name="gdpr-measures-taken" class="large-text" rows="5" required></textarea>
106 <span class="description"><?php esc_html_e( 'Describe the measures taken or proposed to be taken by the controller to address the personal data breach, including, where appropriate, measures to mitigate its possible adverse effects.', 'gdpr' ); ?></span>
107 </td>
108 </tr>
109 </table>
110 <?php submit_button( esc_html__( 'Send confirmation email', 'gdpr' ), 'primary', '', false ); ?>
111 </form>
112 </div>
113
114 <div class="gdpr-tab hidden" data-id="audit-log">
115 <h2><?php esc_html_e( 'Audit Log', 'gdpr' ); ?></h2>
116 <div class="postbox not-full">
117 <form class="gdpr-audit-log-lookup" method="post">
118 <div class="inside">
119 <?php wp_nonce_field( 'gdpr-audit-log', 'gdpr_audit_log_nonce' ); ?>
120 <h4>
121 <label for="gdpr-request-email-lookup"><?php esc_html_e( 'Search by email', 'gdpr' ); ?></label>
122 </h4>
123 <input type="email" name="user_email" class="regular-text" placeholder="<?php esc_attr_e( 'email@domain.com', 'gdpr' ); ?>" required>
124 <input type="text" name="token" placeholder="<?php esc_attr_e( '6 digit token (optional)', 'gdpr' ); ?>">
125 <?php submit_button( esc_html__( 'Search', 'gdpr' ), 'primary', '', false ); ?>
126 <span class="spinner"></span>
127 </div>
128 </form>
129 </div>
130 </div>
131
132 <!-- #poststuff -->
133 </div>
134