index.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  3. if ((!isset($_SESSION['FILEMANAGER_KEY'])) || (empty($_SESSION['FILEMANAGER_KEY']))) {
  4. header("Location: /login/");
  5. exit;
  6. }
  7. $user = $_SESSION['user'];
  8. if (($_SESSION['user'] == 'admin') && (!empty($_SESSION['look']))) {
  9. $user=$_SESSION['look'];
  10. }
  11. if (!empty($_REQUEST['path'])) {
  12. $path = htmlspecialchars($_REQUEST['path'], ENT_QUOTES, 'UTF-8');
  13. if (!empty($_REQUEST['raw'])) {
  14. header('content-type: image/jpeg');
  15. passthru (VESTA_CMD . "v-open-fs-file " . $user . " " . escapeshellarg($path));
  16. exit;
  17. }
  18. }
  19. else {
  20. die('File not found');
  21. }
  22. ?>
  23. <!DOCTYPE html>
  24. <html>
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <title>fotorama</title>
  28. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  29. <link href="//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.2/fotorama.css" rel="stylesheet">
  30. <script src="//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.2/fotorama.js"></script>
  31. </head>
  32. <body>
  33. <div style="background-color: #eee; /*display: inline-block; vertical-align: middle;*/ height: 100%; text-align: center; /*position: absolute; /*top: 50%; left: 50%; margin-top: -50px; margin-left: -50px; /*data-maxheight="100%" data-maxwidth="100%" */"
  34. class="fotoram" data-fit="scaledown" data-allowfullscreen="true" data-nav="false">
  35. <img src="/view/file/?path=<?=$path?>&raw=true" style="background: #3A6F9A; vertical-align: middle; /*max-height: 25px; max-width: 160px;*/" />
  36. </div>
  37. </body>
  38. </html>