revise backend

This commit is contained in:
Michal Sedlák
2026-10-18 15:55:34 +02:00
parent dc452059f3
commit 99b1c96f4b
23 changed files with 681 additions and 720 deletions
+6 -12
View File
@@ -1,11 +1,6 @@
<?php
session_start();
if(!isset($_SESSION['uname'])){
header("location: ../../index.php");
session_destroy();
exit;
}
require_once __DIR__ . '/../../includes/auth.php';
requireLogin('../../index.php');
require_once __DIR__ . '/../../config/config.php';
require_once __DIR__ . '/../../includes/workspace.php';
@@ -15,7 +10,7 @@ if (!isset($_GET['file'])) {
die("No file specified");
}
$filePath = $_GET['file'];
$filePath = requireRemotePath($_GET['file'], $defaultPath);
$fileName = basename($filePath);
$fileSize = $sftp->stat($filePath)['size'];
@@ -105,8 +100,8 @@ if (isset($_GET['stream'])) {
break;
}
}
} catch (Exception $e) {
error_log("Streaming error: " . $e->getMessage());
} catch (Exception $exception) {
error_log("Streaming error: " . $exception->getMessage());
}
exit;
}
@@ -138,7 +133,6 @@ if (isset($_GET['stream'])) {
'class' => 'pdf-page',
]); ?>
<section class="content-panel pdf-workspace" aria-label="PDF document">
<div id="pdfContainer" class="container-fluid position-relative">
<div id="loadingMessage" class="d-flex align-items-center justify-content-center w-100 h-100">
@@ -166,7 +160,7 @@ if (isset($_GET['stream'])) {
</div>
</div>
<div class="actionButton">
<?php if (isset($_SESSION["downPer"]) && $_SESSION["downPer"] == true) : ?>
<?php if (hasPermission('downPer')) : ?>
<a href="download.php?file=<?= urlencode($filePath) ?>" class="btn btn-success m-3">Download</a>
<?php endif; ?>
</div>