index.php 899 B

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