From a34b42e736f67edfa500feb65f22a03d57017c0e Mon Sep 17 00:00:00 2001 From: Louis Chmn Date: Thu, 25 Jun 2026 11:36:42 +0200 Subject: [PATCH] feat(whitelisting): Explicitly tell which app is blocked to user Signed-off-by: Louis Chmn --- lib/AppWhitelist.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/AppWhitelist.php b/lib/AppWhitelist.php index 7fc2f9a4..e95be513 100644 --- a/lib/AppWhitelist.php +++ b/lib/AppWhitelist.php @@ -77,10 +77,13 @@ public function isUrlAllowed(IUser $user, string|false $url): bool { } public function verifyAccess(IUser $user, IRequest $request): void { - if (!$this->isUrlAllowed($user, $request->getPathInfo())) { + $url = $request->getPathInfo(); + $app = $this->getRequestedApp($url); + + if (!$this->isUrlAllowed($user, $url)) { header('HTTP/1.0 403 Forbidden'); Template::printErrorPage($this->l10n->t( - 'Access to this resource is forbidden for guests.' + "Access to this resource ($app) is forbidden for guests." )); exit; }