]> source.dussan.org Git - nextcloud-server.git/commitdiff
Clear enabled apps cache after loading authentication app
authorVincent Petry <pvince81@owncloud.com>
Thu, 9 Oct 2014 11:22:14 +0000 (13:22 +0200)
committerVincent Petry <pvince81@owncloud.com>
Thu, 9 Oct 2014 12:34:41 +0000 (14:34 +0200)
Since getEnabledApps() depends on an authentication app to be loaded,
especially in the case of LDAP, the cache from getEnabledApps() is now
cleared to make sure that subsequent calls will properly return apps
that were enabled for groups.
This is because getEnabledApps() uses the inGroups() function from the
group manager provided by LDAP or any other authentication app.

lib/private/app.php

index 3eed9e3c443d69d54e47ad94dc89c75145916cf4..73f9a2ddd42e9b9f1ec5c151ee661b91e9b45478 100644 (file)
@@ -93,6 +93,13 @@ class OC_App {
                                throw new \OC\NeedsUpdateException();
                        }
                        require_once $app . '/appinfo/app.php';
+                       if (self::isType($app, array('authentication'))) {
+                               // since authentication apps affect the "is app enabled for group" check,
+                               // the enabled apps cache needs to be cleared to make sure that the
+                               // next time getEnableApps() is called it will also include apps that were
+                               // enabled for groups
+                               self::$enabledAppsCache = array();
+                       }
                }
        }