| Server IP : 74.208.250.37 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : miferval ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/brainwavemx/app/Controller/frontend/ |
Upload File : |
<?php
declare(strict_types=1);
namespace App\Controller\Admin;
use App\Model\BlogModel;
use Mosaico\Controller\BaseController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class AjaxController extends BaseController
{
/**
* @var array
*/
protected $env;
public function __construct()
{
$this->auth();
$this->env = $this->getEnv();
}
public function sendContact(): string
{
if (isset($_POST['email'])) :
$data = [];
return json_encode($data);
else :
header('HTTP/1.0 404 Not Found');
die();
endif;
}
public function acceptedOrigins()
{
$accepted_origins = explode(',', $this->getEnv()['ORIGINS']);
if (isset($_SERVER['HTTP_ORIGIN'])) {
// same-origin requests won't set an origin. If the origin is set, it must be valid.
if (in_array($_SERVER['HTTP_ORIGIN'], $accepted_origins)) {
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
} else {
header("HTTP/1.1 403 Origin Denied");
die();
}
}
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header("Access-Control-Allow-Methods: POST, OPTIONS");
die();
}
}
}