From 352acd2d112eaafadcdea8457afecafce3cf00c3 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 28 Feb 2018 20:26:03 +0100 Subject: [PATCH] refs #6962, refs #5309; do not throw AppNotEnabledException for app public pages Signed-off-by: Julien Veyssier --- .../AppFramework/Middleware/Security/SecurityMiddleware.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php index bb3083c835c4f..4af39c99db3de 100644 --- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php @@ -195,8 +195,9 @@ public function beforeController($controller, $methodName) { * Checks if app is enabled (also includes a check whether user is allowed to access the resource) * The getAppPath() check is here since components such as settings also use the AppFramework and * therefore won't pass this check. + * If page is public, app does not need to be enabled for current user/visitor */ - if(\OC_App::getAppPath($this->appName) !== false && !$this->appManager->isEnabledForUser($this->appName)) { + if(\OC_App::getAppPath($this->appName) !== false && !$isPublicPage && !$this->appManager->isEnabledForUser($this->appName)) { throw new AppNotEnabledException(); }