debugging access denied

This commit is contained in:
Flatlogic Bot 2026-02-25 20:14:17 +00:00
parent 7673b8e4dc
commit 3f43980699
4 changed files with 7 additions and 17 deletions

View File

@ -141,8 +141,6 @@ try {
if ($product['is_loyalty']) {
$loyalty_items_indices[] = count($processed_items);
} elseif ($redeem_loyalty) {
throw new Exception("Redemption is only allowed when all items in the cart are loyalty-eligible.");
}
$processed_items[] = [

View File

@ -690,10 +690,8 @@ document.addEventListener('DOMContentLoaded', () => {
if (data.success) {
receiptData.orderId = data.order_id;
// Show receipt for Quick Pay (where paymentTypeId is provided)
if (paymentTypeId !== null) {
printThermalReceipt(receiptData);
}
// Show receipt for both Quick Pay and Place Order
printThermalReceipt(receiptData);
showToast(`${_t('order_placed')} #${data.order_id}`, 'success');
clearCart();

View File

@ -1,6 +0,0 @@
PAYMENT_TYPES.forEach(pt => {
const col = document.createElement('div');
col.className = 'col-12';
col.innerHTML = `<button class="btn btn-outline-primary w-100 py-3 payment-btn" onclick="processOrder(${pt.id}, '${pt.name}')">${pt.name}</button>`;
paymentMethodsContainer.appendChild(col);
});

View File

@ -225,7 +225,7 @@ function render_pagination_controls($pagination, $extra_params = []) {
* Get the project root URL
*/
function get_base_url() {
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? 80) == 443 ? "https://" : "http://";
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? 80) == 443 || ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? "") === "https" ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$script = $_SERVER['SCRIPT_NAME'] ?? '/index.php';
@ -264,7 +264,7 @@ function init_session() {
ini_set('session.gc_maxlifetime', (string)$lifetime);
// Set cookie parameters before session_start
$isSecure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? 80) == 443;
$isSecure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] ?? 80) == 443 || ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? "") === "https";
session_set_cookie_params([
'lifetime' => $lifetime,