From 304de7a9998d2dbcbad1183d90a0bfb77370ec19 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Wed, 12 Feb 2025 11:50:04 +0700 Subject: [PATCH] fix 404 --- system/boot.php | 14 +++++++++----- ui/ui/admin/dashboard.tpl | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/system/boot.php b/system/boot.php index 2b3a85bb..ad8d454a 100644 --- a/system/boot.php +++ b/system/boot.php @@ -128,11 +128,15 @@ try { unset($menus, $menu_registered); include($sys_render); } else { - // header 404 - header("HTTP/1.0 404 Not Found"); - header("Content-Type: text/html; charset=utf-8"); - echo "404 Not Found"; - die(); + if( empty($_SERVER["HTTP_SEC_FETCH_DEST"]) || $_SERVER["HTTP_SEC_FETCH_DEST"] != 'document' ){ + // header 404 + header("HTTP/1.0 404 Not Found"); + header("Content-Type: text/html; charset=utf-8"); + echo "404 Not Found"; + die(); + }else{ + r2(getUrl('login')); + } } } catch (Throwable $e) { Message::sendTelegram( diff --git a/ui/ui/admin/dashboard.tpl b/ui/ui/admin/dashboard.tpl index b4b310d6..e6bfcca5 100644 --- a/ui/ui/admin/dashboard.tpl +++ b/ui/ui/admin/dashboard.tpl @@ -1,5 +1,6 @@ {include file="sections/header.tpl"} +
{if in_array($_admin['user_type'],['SuperAdmin','Admin', 'Report'])}