From 57472eab3c7b035392c6a5aa240593ecaa7d1ccf Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 8 Dec 2025 21:53:36 +0500 Subject: upd: moved all /public/ files to the root folder --- public/captcha.php | 59 ------------------------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 public/captcha.php (limited to 'public/captcha.php') diff --git a/public/captcha.php b/public/captcha.php deleted file mode 100644 index b454b7d..0000000 --- a/public/captcha.php +++ /dev/null @@ -1,59 +0,0 @@ - 200, - "message" => "Solved!", - "data" => null - ]); - } else { - echo json_response([ - "status_code" => 400, - "message" => "Wrong answer!", - "data" => null - ], 400); - } - exit; -} - -$file_folder = $_SERVER["DOCUMENT_ROOT"] . '/static/img/captcha'; - -if (!CAPTCHA_ENABLE || ($_SESSION["captcha_solved"] ?? false) || !is_dir($file_folder)) { - $_SESSION["captcha_solved"] = true; - echo json_response([ - "status_code" => 200, - "message" => "No need to solve captcha", - "data" => null - ]); - exit; -} - -$files = scandir($file_folder); -array_splice($files, 0, 2); - -$filename = $files[random_int(0, count($files) - 1)]; -$filename = basename($filename, ".png"); - -$_SESSION["captcha_word"] = $filename; - -$image = generate_image_captcha( - CAPTCHA_SIZE[0], - CAPTCHA_SIZE[1], - random_int(1, 3), - $filename, - $file_folder -); - -echo json_response([ - "status_code" => 200, - "message" => null, - "data" => $image -]); \ No newline at end of file -- cgit v1.2.3