Alternc  latest
Alternc logiel libre pour l'hébergement
logs_list.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Show a list of all found log files for an account
22  * and allow to see / tail / download them
23  *
24  * @copyright AlternC-Team 2000-2017 https://alternc.com/
25  */
26 
27 require_once("../class/config.php");
28 include_once("head.php");
29 
30 $list=$log->list_logs_directory_all($log->get_logs_directory());
31 ?>
32 <h3><?php __("Logs Listing"); ?></h3>
33 <hr id="topbar"/>
34 <br />
35 <?php
36 echo $msg->msg_html_all();
37 
38 if(!$list || empty($list['dir'])){
39  $msg->raise("INFO", "logs", _("You have no web logs to list at the moment."));
40  echo $msg->msg_html_all();
41  include_once('foot.php');
42  exit;
43 }
44 ?>
45 <p>
46 <?php __("Here are web logs of your account.<br/>You can download them to do specific extract and statistics.");?>
47 </p>
48 <table class="tlist">
49  <thead>
50  <tr><th><?php __("Name");?></th><th align=center><?php __("Creation Date"); ?></th><th><?php __("Size"); ?></th><th><?php __("Download link");?></th></tr>
51  </thead>
52  <tbody>
53 <?php
54 //listing of every logs of the current user.
55 while (list($key,$val)=each($list)){
56  foreach($val as $k => $v){
57  ?>
58  <tr class="lst">
59  <td><?php echo $v['name']; ?></td>
60  <td><?php echo $v['creation_date']; ?></td>
61  <td><?php echo format_size($v['filesize']); ?></td>
62  <td><?php echo "<a href=\"logs_download.php?file=".$v['downlink']."\">"._("Download")."</a>";
63  if ((time()-14400)<$v['mtime']) {
64  echo " &nbsp; <a href=\"logs_tail.php?file=".$v['downlink']."\">"._("Follow")."</a>";
65  }
66 ?></td>
67  </tr>
68 <?php
69  } //foreach
70 } // while
71 ?>
72  </tbody>
73 </table>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
format_size($size, $html=0)
Definition: functions.php:430
__($str)
Definition: functions.php:404
$list
Show a list of all found log files for an account and allow to see / tail / download them.
Definition: logs_list.php:30
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14