Skip to content
Snippets Groups Projects
Commit 8b41689f authored by Robin Appelman's avatar Robin Appelman
Browse files

Only cache enabled apps when logged in

parent 81ecbbb0
No related branches found
No related tags found
No related merge requests found
...@@ -174,6 +174,7 @@ class OC_App { ...@@ -174,6 +174,7 @@ class OC_App {
} }
$appConfig = \OC::$server->getAppConfig(); $appConfig = \OC::$server->getAppConfig();
$appStatus = $appConfig->getValues(false, 'enabled'); $appStatus = $appConfig->getValues(false, 'enabled');
$user = \OC_User::getUser();
foreach ($appStatus as $app => $enabled) { foreach ($appStatus as $app => $enabled) {
if ($app === 'files') { if ($app === 'files') {
continue; continue;
...@@ -181,7 +182,6 @@ class OC_App { ...@@ -181,7 +182,6 @@ class OC_App {
if ($enabled === 'yes') { if ($enabled === 'yes') {
$apps[] = $app; $apps[] = $app;
} else if ($enabled !== 'no') { } else if ($enabled !== 'no') {
$user = \OC_User::getUser();
$groups = json_decode($enabled); $groups = json_decode($enabled);
if (is_array($groups)) { if (is_array($groups)) {
foreach ($groups as $group) { foreach ($groups as $group) {
...@@ -195,7 +195,9 @@ class OC_App { ...@@ -195,7 +195,9 @@ class OC_App {
} }
sort($apps); sort($apps);
array_unshift($apps, 'files'); array_unshift($apps, 'files');
self::$enabledAppsCache = $apps; if ($user) {
self::$enabledAppsCache = $apps;
}
return $apps; return $apps;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment