Skip to content

Commit ef6074d

Browse files
committed
1 missing on list_weblog.html
1 parent dfbbd95 commit ef6074d

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

web/download/web-log/index.php

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,40 @@
11
<?php
2+
23
// Init
3-
error_reporting(NULL);
4+
error_reporting(null);
45
session_start();
56
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
7+
if ((!$_GET['token']) || ($_SESSION['token'] != $_GET['token'])) {
8+
header('location: /list/user/');
9+
exit();
10+
}
11+
612
$v_domain = $_GET['domain'];
713
$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+
}
1020

1121
header("Cache-Control: public");
1222
header("Content-Description: File Transfer");
1323
header("Content-Disposition: attachment; filename=".$_GET['domain'].".".$type."-log.txt");
14-
header("Content-Type: application/octet-stream; ");
24+
header("Content-Type: application/octet-stream; ");
1525
header("Content-Transfer-Encoding: binary");
1626

1727
$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+
}
2034

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) {
2438
echo $file . "\n";
2539
}
2640
}

web/templates/pages/list_weblog.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<a href="/" class="l-logo"></a>
2323
<div class="l-menu clearfix">
2424
<div class="l-menu__item"><a href="/list/web/"><i class="fas fa-arrow-alt-circle-left"></i>&nbsp;&nbsp;&nbsp;<?=_('Back');?></a></div>
25-
<div class="l-menu__item <?php if($_GET['type'] == 'access') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access"><i class="fas fa-eye"></i>&nbsp;&nbsp;&nbsp;<?=_('Access Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
26-
<div class="l-menu__item <?php if($_GET['type'] == 'error') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error"><i class="fas fa-exclamation-circle"></i>&nbsp;&nbsp;&nbsp;<?=_('Error Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
25+
<div class="l-menu__item <?php if($_GET['type'] == 'access') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access&token=<?=$_SESSION['token']?>"><i class="fas fa-eye"></i>&nbsp;&nbsp;&nbsp;<?=_('Access Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=access" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
26+
<div class="l-menu__item <?php if($_GET['type'] == 'error') echo 'l-menu__item--active' ?>"><a href="/list/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error"><i class="fas fa-exclamation-circle"></i>&nbsp;&nbsp;&nbsp;<?=_('Error Log');?></a><a href="/download/web-log/?domain=<?=htmlentities($_GET['domain'])?>&type=error&token=<?=$_SESSION['token']?>" title="<?=_('Download');?>"><i class="fas fa-download"></i></a></div>
2727
</div>
2828
<div class="l-profile">
2929
<div class="l-menu__item"><a href="javascript:location.reload();" title="<?=_('Refresh');?>"><i class="fas fa-redo"></i></a></div>

0 commit comments

Comments
 (0)