index.php 947 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // Init
  3. error_reporting(null);
  4. session_start();
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Check token
  7. verify_csrf($_GET);
  8. $v_domain = $_GET['domain'];
  9. $v_domain = escapeshellarg($_GET['domain']);
  10. if ($_GET['type'] == 'access') {
  11. $type = 'access';
  12. }
  13. if ($_GET['type'] == 'error') {
  14. $type = 'error';
  15. }
  16. header("Cache-Control: public");
  17. header("Content-Description: File Transfer");
  18. header("Content-Disposition: attachment; filename=".$_GET['domain'].".".$type."-log.txt");
  19. header("Content-Type: application/octet-stream; ");
  20. header("Content-Transfer-Encoding: binary");
  21. $v_domain = escapeshellarg($_GET['domain']);
  22. if ($_GET['type'] == 'access') {
  23. $type = 'access';
  24. }
  25. if ($_GET['type'] == 'error') {
  26. $type = 'error';
  27. }
  28. exec(HESTIA_CMD."v-list-web-domain-".$type."log $user ".$v_domain." 5000", $output, $return_var);
  29. if ($return_var == 0) {
  30. foreach ($output as $file) {
  31. echo $file . "\n";
  32. }
  33. }