Print statements

This commit is contained in:
towards-a-new-leftypol 2023-08-31 14:11:52 +00:00
parent a6cd12ed9f
commit 490c766a06
5 changed files with 15 additions and 2 deletions

1
.gitignore vendored
View File

@ -113,3 +113,4 @@ sfw/
tech/ tech/
ref/ ref/
ga/ ga/
Test/

View File

@ -15,6 +15,8 @@
$config['boards'] = array( $config['boards'] = array(
array( array(
'b', 'b',
'leftypol',
'Test'
) )
); );
@ -27,7 +29,7 @@ $config['prepended_foreign_boards'] = array(
// Board categories. Only used in the "Categories" theme. // Board categories. Only used in the "Categories" theme.
$config['categories'] = array( $config['categories'] = array(
'Leftypol' => array( 'Leftychan' => array(
'b', 'b',
) )
); );
@ -105,7 +107,7 @@ $config['thread_subject_in_title'] = true;
// this functionality is permanently disabled. // this functionality is permanently disabled.
$config['spam']['enabled'] = false; $config['spam']['enabled'] = false;
$config['spam_noticer']['enabled'] = true; $config['spam_noticer']['enabled'] = true;
$config['spam_noticer']['base_url'] = 'http://192.168.4.6:8888'; $config['spam_noticer']['base_url'] = 'http://localhost:8300';
$config['spam_noticer']['website_name'] = "leftychan_dev"; $config['spam_noticer']['website_name'] = "leftychan_dev";
/* /*

View File

@ -1810,6 +1810,7 @@ function mod_ban_post(string $board, $delete, $post_num, $token = false) {
$will_spamnoticer = isset($_POST['spamnoticer']); $will_spamnoticer = isset($_POST['spamnoticer']);
require_once 'inc/spamnoticer.php'; require_once 'inc/spamnoticer.php';
require_once 'inc/anti-bot.php';
if ($will_spamnoticer) { if ($will_spamnoticer) {
$spamnoticer_info = parse_spamnoticer_content_fields($_POST, $po); $spamnoticer_info = parse_spamnoticer_content_fields($_POST, $po);
@ -1820,6 +1821,7 @@ function mod_ban_post(string $board, $delete, $post_num, $token = false) {
$po, $po,
$board, $board,
$spamnoticer_info); $spamnoticer_info);
print_err('$spamnoticer_result: ' . $spamnoticer_result);
} }
$will_ban = $spamnoticer_info->ban; $will_ban = $spamnoticer_info->ban;

View File

@ -137,6 +137,7 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice
$status_code = $response->getStatusCode(); $status_code = $response->getStatusCode();
$result_body = (string) $response->getBody(); $result_body = (string) $response->getBody();
print_err($result_body);
return "$status_code $result_body"; return "$status_code $result_body";
} catch (GuzzleHttp\Exception\ConnectException $e) { } catch (GuzzleHttp\Exception\ConnectException $e) {
@ -204,6 +205,8 @@ function checkWithSpamNoticer($config, $post, $boardname) {
$result->client = $client; $result->client = $client;
print_err($response->getBody());
return $result; return $result;
} catch (GuzzleHttp\Exception\ConnectException $e) { } catch (GuzzleHttp\Exception\ConnectException $e) {
$result->reason = $e->getMessage(); $result->reason = $e->getMessage();

View File

@ -6,6 +6,7 @@
require_once 'inc/functions.php'; require_once 'inc/functions.php';
require_once 'inc/anti-bot.php'; require_once 'inc/anti-bot.php';
require_once 'inc/bans.php'; require_once 'inc/bans.php';
require_once 'inc/anti-bot.php'; // DELETE ME FOR DEBUGGING ONLY
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
@ -416,11 +417,15 @@ function handle_report(){
function handle_post(){ function handle_post(){
global $config,$dropped_post,$board, $mod,$pdo; global $config,$dropped_post,$board, $mod,$pdo;
print_err('handle_post BEGIN');
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) { if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
print_err('handle_post bot error 1');
error($config['error']['bot']); error($config['error']['bot']);
} }
print_err('handle_post NO SUCH bot error 1');
$post = array('board' => $_POST['board'], 'files' => array()); $post = array('board' => $_POST['board'], 'files' => array());
// Check if board exists // Check if board exists