forked from OpenIB/OpenIB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.php
43 lines (34 loc) · 938 Bytes
/
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
<?php
include 'inc/functions.php';
include 'inc/mod/pages.php';
function outputError($errCode, $errString) {
http_response_code($errCode);
error ($errString);
return 0;
}
if (!isset($_GET['board'])){
outputError(400, 'No input.');
}
if (!preg_match("/{$config['board_regex']}/u", $_GET['board'])) {
outputError(400, 'Bad input.');
}
if (!openBoard($_GET['board'])) {
outputError(404, 'No Board.');
}
if ($board['public_logs'] == 0) {
outputError(403, 'This board has public logs disabled. Ask the board owner to enable it.');
}
// Pagination starts at page 1 by default
$page = 1;
// Names are hidden by default
$hideNames = false;
// Show names if board is set for public logs
if ($board['public_logs'] == 2) {
$hideNames = true;
}
// Set pagination if set in query string
if (isset($_GET['page'])) {
$page = (int)$_GET['page'];
}
// Output mod board log
mod_board_log($board['uri'], $page, $hideNames, true);