log.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
[UCenter] (C)2001-2099 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: log.php 1059 2011-03-01 07:25:09Z monkey $
*/
!defined('IN_UC') && exit('Access Denied');
class control extends adminbase {
function __construct() {
$this->control();
}
function control() {
parent::__construct();
$this->check_priv();
if(!$this->user['isfounder'] && !$this->user['allowadminlog']) {
$this->message('no_permission_for_this_module');
}
$this->check_priv();
}
function onls() {
$logdir = UC_ROOT.'data/logs/';
$dir = opendir($logdir);
$logs = $loglist = array();
while($entry = readdir($dir)) {
if(is_file($logdir.$entry) && strpos($entry, '.php') !== FALSE) {
$logs = array_merge($logs, file($logdir.$entry));
}
}
closedir($dir);
$logs = array_reverse($logs);
foreach($logs AS $k => $v) {
if(count($v = explode("\t", $v)) > 1) {
$v[3] = $this->date($v[3]);
$v[4] = $this->lang[$v[4]];
$loglist[$k] = $v;
}
}
$page = max(1, intval($_GET['page']));
$start = ($page - 1) * UC_PPP;
$num = count($loglist);
$multipage = $this->page($num, UC_PPP, $page, 'admin.php?m=log&a=ls');
$loglist = array_slice($loglist, $start, UC_PPP);
$this->view->assign('loglist', $loglist);
$this->view->assign('multipage', $multipage);
$this->view->display('admin_log');
}
}
?>