summaryrefslogtreecommitdiff
path: root/log.php
diff options
context:
space:
mode:
author8chan <admin@8chan.co>2015-02-25 17:21:49 -0800
committerczaks <marcin@6irc.net>2016-05-06 15:44:26 +0200
commit7911c374e86ef8fa69c4545867b9d9d3de12d5c6 (patch)
tree217ac7d32eff8acfaa6b08991dc792750edcedc3 /log.php
parent6dd1420f91410531bb2dac506f821d959bf74d0a (diff)
Public action logs commit (log.php)
Note: In a previous commit, I began making inc/mod/auth.php more modular with the check_login() function. Including it does NOT check mod login by default anymore like it does on vichan. You have to call check_login(). I've finally included it in inc/functions.php. If you have any custom pages that use inc/mod/auth.php, just including functions.php is enough now. =================================== Also: backports 351375185e5 (early 404)
Diffstat (limited to 'log.php')
-rw-r--r--log.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/log.php b/log.php
new file mode 100644
index 00000000..1a660c4c
--- /dev/null
+++ b/log.php
@@ -0,0 +1,24 @@
+<?php
+include 'inc/functions.php';
+include 'inc/mod/pages.php';
+
+if (!isset($_GET['board']) || !preg_match("/{$config['board_regex']}/u", $_GET['board'])) {
+ http_response_code(400);
+ error('Bad board.');
+}
+if (!openBoard($_GET['board'])) {
+ http_response_code(404);
+ error('No board.');
+}
+
+if ($config['public_logs'] == 0) error('This board has public logs disabled. Ask the board owner to enable it.');
+if ($config['public_logs'] == 1) $hide_names = false;
+if ($config['public_logs'] == 2) $hide_names = true;
+
+if (!isset($_GET['page'])) {
+ $page = 1;
+} else {
+ $page = (int)$_GET['page'];
+};
+
+mod_board_log($board['uri'], $page, $hide_names, true);