admin-config.php首行必须加守卫,防止被直接访问。守卫常量为DK_TPL_CFG_INC,由网关admin/template_config.php在include前define。
if (!defined('DK_TPL_CFG_INC')) {
http_response_code(403);
exit('Access denied');
}
如果直接访问admin-config.php文件(不通过网关),DK_TPL_CFG_INC未被定义,守卫会返回403并退出。这确保了设置页只能通过后台网关访问,防止未授权访问。