mirror of
https://github.com/itflow-org/itflow
synced 2026-07-24 17:30:43 +00:00
Add secure file handler for client ticket attachment and file view along with client and contact permission isolation, add the handler links in asset and contact
This commit is contained in:
@@ -220,8 +220,6 @@ if (isset($_GET['client_id'])) {
|
||||
$client_url = '';
|
||||
}
|
||||
|
||||
enforceClientAccess();
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
@@ -863,7 +861,6 @@ ob_start();
|
||||
$file_name = escapeHtml($row['file_name']);
|
||||
$file_mime_type = escapeHtml($row['file_mime_type']);
|
||||
$file_description = escapeHtml($row['file_description']);
|
||||
$file_reference_name = escapeHtml($row['file_reference_name']);
|
||||
$file_ext = escapeHtml($row['file_ext']);
|
||||
if ($file_ext == 'pdf') {
|
||||
$file_icon = "file-pdf";
|
||||
@@ -891,7 +888,11 @@ ob_start();
|
||||
$file_created_at = escapeHtml($row['file_created_at']);
|
||||
?>
|
||||
<tr>
|
||||
<td><a class="text-dark" href="<?php echo "../uploads/clients/$client_id/$file_reference_name"; ?>" target="_blank" ><?php echo "$file_name<br><span class='text-secondary'>$file_description</span>"; ?></a></td>
|
||||
<td>
|
||||
<a class="text-dark" href="file.php?file_id=<?=$file_id ?>&action=view" target="_blank" >
|
||||
<?php echo "$file_name<br><span class='text-secondary'>$file_description</span>"; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $file_mime_type; ?></td>
|
||||
<td><?php echo $file_created_at; ?></td>
|
||||
</tr>
|
||||
@@ -821,11 +821,11 @@ ob_start();
|
||||
<tbody>
|
||||
<?php
|
||||
while ($row = mysqli_fetch_assoc($sql_linked_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = escapeHtml($row['file_name']);
|
||||
$file_description = escapeHtml($row['file_description']);
|
||||
$file_size = escapeHtml($row['file_size']);
|
||||
$file_size_KB = round($file_size / 1024);
|
||||
$file_reference_name = escapeHtml($row['file_reference_name']);
|
||||
$file_mime_type = escapeHtml($row['file_mime_type']);
|
||||
$file_created_at = escapeHtml($row['file_created_at']);
|
||||
|
||||
@@ -833,7 +833,9 @@ ob_start();
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<div><a href="../uploads/clients/<?= $client_id ?>/<?= $file_reference_name ?>" target="_blank"><?= $file_name ?></a></div>
|
||||
<div>
|
||||
<a href="file.php?file_id=<?= $file_id ?>&action=view" target="_blank"><?= $file_name ?></a>
|
||||
</div>
|
||||
<div class="text-secondary"><?= $file_description ?></div>
|
||||
</td>
|
||||
<td><?= $file_mime_type ?></td>
|
||||
Reference in New Issue
Block a user