|
6 | 6 |
|
7 | 7 | if (isset($_POST['add_certificate'])) { |
8 | 8 |
|
9 | | - validateTechRole(); |
| 9 | + enforceUserPermission('module_support', 2); |
10 | 10 |
|
11 | | - $client_id = intval($_POST['client_id']); |
12 | | - $name = sanitizeInput($_POST['name']); |
13 | | - $description = sanitizeInput($_POST['description']); |
14 | | - $domain = sanitizeInput($_POST['domain']); |
15 | | - $issued_by = sanitizeInput($_POST['issued_by']); |
16 | | - $expire = sanitizeInput($_POST['expire']); |
17 | | - $public_key = sanitizeInput($_POST['public_key']); |
18 | | - $notes = sanitizeInput($_POST['notes']); |
19 | | - $domain_id = intval($_POST['domain_id']); |
| 11 | + require_once 'post/user/certificate_model.php'; |
20 | 12 |
|
21 | 13 | // Parse public key data for a manually provided public key |
22 | 14 | if (!empty($public_key) && (empty($expire) && empty($issued_by))) { |
|
49 | 41 |
|
50 | 42 | if (isset($_POST['edit_certificate'])) { |
51 | 43 |
|
52 | | - validateTechRole(); |
| 44 | + enforceUserPermission('module_support', 2); |
53 | 45 |
|
| 46 | + require_once 'post/user/certificate_model.php'; |
54 | 47 | $certificate_id = intval($_POST['certificate_id']); |
55 | | - $name = sanitizeInput($_POST['name']); |
56 | | - $description = sanitizeInput($_POST['description']); |
57 | | - $domain = sanitizeInput($_POST['domain']); |
58 | | - $issued_by = sanitizeInput($_POST['issued_by']); |
59 | | - $expire = sanitizeInput($_POST['expire']); |
60 | | - $public_key = sanitizeInput($_POST['public_key']); |
61 | | - $notes = sanitizeInput($_POST['notes']); |
62 | | - $domain_id = intval($_POST['domain_id']); |
63 | | - $client_id = intval($_POST['client_id']); |
64 | 48 |
|
65 | 49 | // Parse public key data for a manually provided public key |
66 | 50 | if (!empty($public_key) && (empty($expire) && empty($issued_by))) { |
|
91 | 75 |
|
92 | 76 | if (isset($_GET['archive_certificate'])) { |
93 | 77 |
|
94 | | - validateTechRole(); |
| 78 | + enforceUserPermission('module_support', 2); |
95 | 79 |
|
96 | 80 | $certificate_id = intval($_GET['archive_certificate']); |
97 | 81 |
|
|
115 | 99 |
|
116 | 100 | if (isset($_GET['delete_certificate'])) { |
117 | 101 |
|
118 | | - validateAdminRole(); |
| 102 | + enforceUserPermission('module_support', 3); |
119 | 103 |
|
120 | 104 | $certificate_id = intval($_GET['delete_certificate']); |
121 | 105 |
|
|
138 | 122 | } |
139 | 123 |
|
140 | 124 | if (isset($_POST['bulk_delete_certificates'])) { |
141 | | - validateAdminRole(); |
| 125 | + enforceUserPermission('module_support', 3); |
142 | 126 | validateCSRFToken($_POST['csrf_token']); |
143 | 127 |
|
144 | 128 | $count = 0; // Default 0 |
|
169 | 153 |
|
170 | 154 | if (isset($_POST['export_client_certificates_csv'])) { |
171 | 155 |
|
172 | | - validateTechRole(); |
| 156 | + enforceUserPermission('module_support'); |
173 | 157 |
|
174 | 158 | $client_id = intval($_POST['client_id']); |
175 | 159 |
|
|
0 commit comments