Merge pull request #1173 from itflow-org/small-fix

Small perms fixes
This commit is contained in:
Johnny
2025-02-22 13:38:05 -05:00
committed by GitHub
5 changed files with 43 additions and 18 deletions

View File

@@ -11,6 +11,10 @@ if (isset($_GET['client_id'])) {
// Perms
enforceUserPermission('module_support');
$ticket_permission_snippet = '';
if (!empty($client_access_string)) {
$ticket_permission_snippet = "AND ticket_client_id IN ($client_access_string)";
}
// Initialize the HTML Purifier to prevent XSS
require_once "plugins/htmlpurifier/HTMLPurifier.standalone.php";
@@ -20,12 +24,6 @@ $purifier_config->set('Cache.DefinitionImpl', null); // Disable cache by setting
$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]);
$purifier = new HTMLPurifier($purifier_config);
// Ticket client access snippet
$ticket_permission_snippet = '';
if (!empty($client_access_string)) {
$ticket_permission_snippet = "AND ticket_client_id IN ($client_access_string)";
}
if (isset($_GET['ticket_id'])) {
$ticket_id = intval($_GET['ticket_id']);
@@ -51,7 +49,7 @@ if (isset($_GET['ticket_id'])) {
if (mysqli_num_rows($sql) == 0) {
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1><a class='btn btn-lg btn-secondary mt-3' href='tickets.php'><i class='fa fa-fw fa-arrow-left'></i> Go Back</a></center>";
include_once "footer.php";
include_once "includes/footer.php";
} else {
$row = mysqli_fetch_array($sql);
@@ -981,7 +979,7 @@ if (isset($_GET['ticket_id'])) {
</td>
</tr>
<?php
}
}
?>
</table>
</div>