Code restructure push

This commit is contained in:
twotalesanimation
2025-12-04 15:09:44 +02:00
parent 86faad7a78
commit be2b757f4e
111 changed files with 17297 additions and 19420 deletions

View File

@@ -0,0 +1,41 @@
<?php
header('Content-Type: application/json');
$rootPath = dirname(dirname(dirname(__DIR__)));
require_once($rootPath . '/src/config/connection.php');
require_once($rootPath . '/src/config/functions.php');
require_once($rootPath . '/vendor/autoload.php');
use GuzzleHttp\Client;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$data = json_decode(file_get_contents('php://input'), true);
if (!isset($data['email'], $data['name'], $data['token'])) {
echo json_encode([
'success' => false,
'message' => 'Missing required fields.'
]);
exit;
}
$email = $data['email'];
$name = $data['name'];
$token = $data['token'];
if (sendVerificationEmail($email, $name, $token)) {
$_SESSION['message'] = "Verification mail resend successful!";
echo json_encode([
'success' => true,
'message' => "Verification email sent to $email."
]);
} else {
$_SESSION['message'] = "Verification mail resend FAILED!";
echo json_encode([
'success' => false,
'message' => "Failed to send verification email to $email."
]);
}
}