1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-20 20:51:50 +01:00

New API endpoint: settings.php - get settings of board

This commit is contained in:
8chan 2015-02-25 17:16:44 -08:00
parent 46ba60fff1
commit fbb85593fa
2 changed files with 46 additions and 2 deletions

View File

@ -169,8 +169,6 @@
$config['syslog'] = true;
$config['wordfilters'][] = array('\rule', ''); // 'true' means it's a regular expression
$config['hour_max_threads'] = false;
$config['filters'][] = array(
'condition' => array(
@ -204,6 +202,7 @@ $config['cron_bans'] = true;
$config['mask_db_error'] = true;
$config['ban_appeals'] = true;
$config['show_sages'] = false;
$config['katex'] = false;
// 8chan specific mod pages
require '8chan-mod-pages.php';

45
settings.php Normal file
View File

@ -0,0 +1,45 @@
<?php
include 'inc/functions.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.');
}
header('Content-Type: text/json');
$safe_config['country_flags'] = $config['country_flags'];
$safe_config['field_disable_name'] = $config['field_disable_name'];
$safe_config['enable_embedding'] = $config['enable_embedding'];
$safe_config['force_image_op'] = $config['force_image_op'];
$safe_config['disable_images'] = $config['disable_images'];
$safe_config['poster_ids'] = $config['poster_ids'];
$safe_config['show_sages'] = $config['show_sages'];
$safe_config['auto_unicode'] = $config['auto_unicode'];
$safe_config['allow_roll'] = $config['allow_roll'];
$safe_config['image_reject_repost'] = $config['image_reject_repost'];
$safe_config['early_404'] = $config['early_404'];
$safe_config['allow_delete'] = $config['allow_delete'];
$safe_config['anonymous'] = $config['anonymous'];
$safe_config['blotter'] = $config['blotter'];
$safe_config['stylesheets'] = $config['stylesheets'];
$safe_config['default_stylesheet'] = $config['default_stylesheet'];
$safe_config['captcha'] = $config['captcha'];
$safe_config['force_subject_op'] = $config['force_subject_op'];
$safe_config['tor_posting'] = $config['tor_posting'];
$safe_config['new_thread_capt'] = $config['new_thread_capt'];
$safe_config['hour_max_threads'] = $config['hour_max_threads'];
$safe_config['disable_images'] = $config['disable_images'];
$safe_config['locale'] = $config['locale'];
$safe_config['allowed_ext_files'] = $config['allowed_ext_files'];
$safe_config['allowed_ext'] = $config['allowed_ext'];
$safe_config['user_flags'] = $config['user_flags'];
$safe_config['wordfilters'] = $config['wordfilters'];
$safe_config['latex'] = $config['katex'];
$safe_config['code_tags'] = in_array('js/code_tags/run_prettify.js', $config['additional_javascript']);
echo json_encode($safe_config);