Update: 2026-05-15 17:50:52

This commit is contained in:
Hamza-Ayed
2026-05-15 17:50:52 +03:00
parent 813197c869
commit cf8cf829d8
3 changed files with 51 additions and 11 deletions

View File

@@ -1,13 +1,29 @@
<?php
/**
* Public Invoice Verification Page
* GET /v1/verify?id=INVOICE_ID
*/
// Minimal public verification
if (!defined('ROOT_PATH')) define('ROOT_PATH', realpath(dirname(__DIR__, 2)));
// Load Env manually
$envFile = '/home/intaleqapp-musadaq/env/.env';
if (!file_exists($envFile)) $envFile = ROOT_PATH . '/.env';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
if (str_starts_with(trim($line), '#')) continue;
$parts = explode('=', $line, 2);
if (count($parts) === 2) {
$n = trim($parts[0]); $v = trim($parts[1], " \t\n\r\0\x0B\"'");
$_ENV[$n] = $v; $_SERVER[$n] = $v;
}
}
}
use App\Core\Database;
use App\Core\Encryption;
// die('REACHED VERIFY'); // Debug
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
try {
$invoiceId = $_GET['id'] ?? null;

View File

@@ -16,6 +16,7 @@ error_log("Router: Resolved route '{$route}'");
// Route map: route => [allowed_method, module_file]
$routes = [
'v.php' => ['GET', '../public/v.php'],
'verify' => ['GET', 'invoices/verify_public.php'],
'v1/auth/login' => ['POST', 'auth/login.php'],
'v1/auth/refresh' => ['POST', 'auth/refresh.php'],

View File

@@ -1,15 +1,38 @@
<?php
/**
* Standalone Public Invoice Verification Page
* Bypass index.php router to avoid any accidental redirects.
*/
// Barebones verification script
define('ROOT_PATH', realpath(dirname(__DIR__)));
define('APP_PATH', ROOT_PATH . '/app');
// 1. Load Bootstrap
require_once __DIR__ . '/../app/bootstrap/init.php';
// Minimal autoload for Core classes
spl_autoload_register(function ($class) {
$file = ROOT_PATH . '/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($file)) require $file;
});
use App\Core\Database;
use App\Core\Encryption;
// Load Environment variables manually if needed
$envFile = '/home/intaleqapp-musadaq/env/.env';
if (!file_exists($envFile)) $envFile = ROOT_PATH . '/.env';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
if (str_starts_with(trim($line), '#')) continue;
$parts = explode('=', $line, 2);
if (count($parts) === 2) {
$n = trim($parts[0]); $v = trim($parts[1], " \t\n\r\0\x0B\"'");
$_ENV[$n] = $v; $_SERVER[$n] = $v;
}
}
}
// die('V.PHP REACHED'); // Debug point
header('X-Debug-V: Reached');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
try {
$invoiceId = $_GET['id'] ?? null;