summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Veyssier <eneiluj@posteo.net>2018-02-28 20:26:03 +0100
committerJulien Veyssier <eneiluj@posteo.net>2018-02-28 20:35:53 +0100
commit7da08121868ce6922151e13246f82e8935a6cc51 (patch)
tree1b6975bfdc1ee6ff300da384e7b5b5d0e5b84775
parent0cfdf4748f248e1b55fc459a05e7782a1e585716 (diff)
downloadnextcloud-server-7da08121868ce6922151e13246f82e8935a6cc51.tar.gz
nextcloud-server-7da08121868ce6922151e13246f82e8935a6cc51.zip
Do not throw AppNotEnabledException for app public pages - refs #6962, refs #5309
It allows non-logged user to access public pages of applications restricted to a group Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
-rw-r--r--lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
index bb3083c835c..4af39c99db3 100644
--- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
@@ -195,8 +195,9 @@ class SecurityMiddleware extends Middleware {
* 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();
}