From 20ae2ce5e02539719b971e53222f3e3328ff82a6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 15 May 2025 15:20:53 +0500 Subject: feat: custom captcha --- src/accounts.php | 5 -- src/captcha.php | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/config.sample.php | 5 +- 3 files changed, 154 insertions(+), 7 deletions(-) create mode 100644 src/captcha.php (limited to 'src') diff --git a/src/accounts.php b/src/accounts.php index 99d1a9c..72c766f 100644 --- a/src/accounts.php +++ b/src/accounts.php @@ -5,11 +5,6 @@ function authorize_user(bool $required = false): bool { session_start(); - if (!isset($_SESSION["captcha_solved"]) && !CLIENT_REQUIRES_JSON) { - header("Location: /captcha.php"); - exit; - } - if (!isset($_COOKIE["secret_key"]) && !isset($_SERVER["HTTP_AUTHORIZATION"])) { if (isset($_SESSION["user_id"])) { session_unset(); diff --git a/src/captcha.php b/src/captcha.php new file mode 100644 index 0000000..d6d2547 --- /dev/null +++ b/src/captcha.php @@ -0,0 +1,151 @@ + + + +