forked from craigk5n/webcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activity_log.php
59 lines (52 loc) · 1.97 KB
/
activity_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
<?php
/**
* Description:
* Display either the "Activity Log" (for events/tasks) or the
* "System Log" (entries not associated with an event).
*
* Input Parameters:
* startid - specified the id of the first log entry to display
* system - if specified, then view the system log (entries with no
* event id associated with them) rather than the event log.
*
* Security:
* User must be an admin user
* AND, if user access control is enabled, they must have access to
* activity logs. (This is because users may see event details
* for other groups that they are not supposed to have access to.)
*/
require_once 'includes/init.php';
if ( ! $is_admin || ( access_is_enabled()
&& ! access_can_access_function( ACCESS_ACTIVITY_LOG ) ) )
die_miserable_death ( print_not_auth() );
$eventsStr = translate ( 'Events' );
$nextStr = translate ( 'Next' );
$prevStr = translate ( 'Previous' );
$PAGE_SIZE = 25; // Number of entries to show at once.
$startid = getValue ( 'startid', '-?[0-9]+', true );
$sys = ( $is_admin && getGetValue ( 'system' ) != '' );
print_header();
echo generate_activity_log( '', $sys, $startid ) . '
<div class="navigation">'
// Go BACK in time.
. ( ! empty ( $nextpage ) ? '
<a class="prev" href="activity_log.php?startid=' . $nextpage
. ( $sys ? '&system=1' : '' ) . '">' . $prevStr . ' ' . $PAGE_SIZE
. ' ' . $eventsStr . '</a>' : '' );
if ( ! empty ( $startid ) ) {
$previd = $startid + $PAGE_SIZE;
$res = dbi_execute ( 'SELECT MAX( cal_log_id ) FROM webcal_entry_log' );
if ( $res ) {
if ( $row = dbi_fetch_row ( $res ) )
// Go FORWARD in time.
echo '
<a class="next" href="activity_log.php' . ( $row[0] <= $previd
? ( $sys ? '?system=1' : '' )
: '?startid=' . $previd . ( $sys ? '&system=1' : '' ) ) . '">'
. $nextStr . ' ' . $PAGE_SIZE . ' ' . $eventsStr . '</a><br>';
dbi_free_result ( $res );
}
}
echo '
</div>' . print_trailer();
?>