forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home-log.php
67 lines (64 loc) · 2.04 KB
/
home-log.php
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
64
65
66
67
<?php
require_once('sys.includes.php');
/** Low level accesses are not permited */
if (CURRENT_USER_LEVEL != 9) {
prevent_direct_access();
}
else {
/**
* Very simple way to check if the file was
* called through ajax.
*/
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) {
$max_show_log = 10;
$log_action = $_GET['action'];
$log_query = "SELECT * FROM tbl_actions_log";
if (!empty($log_action)) {
$log_query .= " WHERE action = '$log_action'";
}
$log_query .= " ORDER BY id DESC LIMIT $max_show_log";
$sql_log = $database->query($log_query);
$log_count = mysql_num_rows($sql_log);
if ($log_count > 0) {
while($log = mysql_fetch_array($sql_log)) {
$rendered = render_log_action(
array(
'action' => $log['action'],
'timestamp' => $log['timestamp'],
'owner_id' => $log['owner_id'],
'owner_user' => $log['owner_user'],
'affected_file' => $log['affected_file'],
'affected_file_name' => $log['affected_file_name'],
'affected_account' => $log['affected_account'],
'affected_account_name' => $log['affected_account_name']
)
);
?>
<li>
<div class="log_ico">
<img src="img/log_icons/<?php echo $rendered['icon']; ?>.png" alt="Action icon">
</div>
<div class="home_log_text">
<div class="date"><?php echo $rendered['timestamp']; ?></div>
<div class="action">
<?php
if (!empty($rendered['1'])) { echo '<span>'.$rendered['1'].'</span> '; }
echo $rendered['text'].' ';
if (!empty($rendered['2'])) { echo '<span class="secondary">'.$rendered['2'].'</span> '; }
if (!empty($rendered['3'])) { echo ' '.$rendered['3'].' '; }
if (!empty($rendered['4'])) { echo '<span>'.$rendered['4'].'</span> '; }
?>
</div>
</div>
</li>
<?php
}
}
else {
?>
<li><?php _e('There are no results','cftp_admin'); ?></li>
<?php
}
}
}
?>