index.php 904 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. header('Content-Type: application/json');
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Header
  7. // include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_weblog.html');
  8. $v_domain = escapeshellarg($_GET['domain']);
  9. if ($_GET['type'] == 'access') $type = 'access';
  10. if ($_GET['type'] == 'error') $type = 'error';
  11. $data = exec (VESTA_CMD."v-list-web-domain-".$type."log $user ".$v_domain, $output, $return_var);
  12. $content = '';
  13. if ($return_var == 0 ) {
  14. foreach($output as $file) {
  15. $content .= htmlentities($file) . "\n";
  16. }
  17. }
  18. echo json_encode(
  19. array(
  20. 'data' => $content,
  21. 'prefix' => __('Last 70 lines of %s.%s.log', htmlentities($_GET['domain']), htmlentities($_GET['type']))
  22. )
  23. );
  24. // if ($return_var == 0 ) {
  25. // foreach($output as $file) {
  26. // echo htmlentities($file) . "\n";
  27. // }
  28. // }
  29. // echo " </pre>\n</body>\n</html>\n";