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