diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/private/util.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 424c27e74a7..e9e081a48fd 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -827,9 +827,17 @@ class OC_Util { if ($defaultPage) { $location = $urlGenerator->getAbsoluteURL($defaultPage); } else { - $defaultApp = \OCP\Config::getSystemValue('defaultapp', 'files'); - $defaultApp = OC_App::cleanAppId(strip_tags($defaultApp)); - $location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $defaultApp); + $appId = 'files'; + $defaultApps = explode(',', \OCP\Config::getSystemValue('defaultapp', 'files')); + // find the first app that is enabled for the current user + foreach ($defaultApps as $defaultApp) { + $defaultApp = OC_App::cleanAppId(strip_tags($defaultApp)); + if (OC_App::isEnabled($defaultApp)) { + $appId = $defaultApp; + break; + } + } + $location = $urlGenerator->linkTo($appId, 'index.php'); } } OC_Log::write('core', 'redirectToDefaultPage: '.$location, OC_Log::DEBUG); |