]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only cache enabled apps when logged in
authorRobin Appelman <icewind@owncloud.com>
Mon, 23 Jun 2014 11:55:21 +0000 (13:55 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 23 Jun 2014 11:55:21 +0000 (13:55 +0200)
lib/private/app.php

index a62623905ffac617fee1f27ff4d67fc99c84e309..dc058cadc904a2e1b294dc4361c6514a3c49cefc 100644 (file)
@@ -174,6 +174,7 @@ class OC_App {
                }
                $appConfig = \OC::$server->getAppConfig();
                $appStatus = $appConfig->getValues(false, 'enabled');
+               $user = \OC_User::getUser();
                foreach ($appStatus as $app => $enabled) {
                        if ($app === 'files') {
                                continue;
@@ -181,7 +182,6 @@ class OC_App {
                        if ($enabled === 'yes') {
                                $apps[] = $app;
                        } else if ($enabled !== 'no') {
-                               $user = \OC_User::getUser();
                                $groups = json_decode($enabled);
                                if (is_array($groups)) {
                                        foreach ($groups as $group) {
@@ -195,7 +195,9 @@ class OC_App {
                }
                sort($apps);
                array_unshift($apps, 'files');
-               self::$enabledAppsCache = $apps;
+               if ($user) {
+                       self::$enabledAppsCache = $apps;
+               }
                return $apps;
        }