This commit is contained in:
sshambar 2021-06-04 09:49:20 +10:00 committed by GitHub
commit 66ba3262a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -342,6 +342,21 @@ class AppManager implements IAppManager {
return !empty($protectedTypes);
}
/**
* Whether a list of types contains only protected app types
*
* @param string[] $types
* @return bool
*/
public function hasOnlyProtectedAppTypes($types) {
if (empty($types)) {
return false;
}
$unprotectedTypes = array_diff($types, $this->protectedAppTypes);
return empty($unprotectedTypes);
}
/**
* Enable an app only for specific groups
*

View File

@ -117,8 +117,12 @@ class OC_App {
if ((bool) \OC::$server->getSystemConfig()->getValue('maintenance', false)) {
return false;
}
// If only protected types, don't filter by user (prevents
// session invalidation when loading prelogin/authentication
// types).
$all = \OC::$server->getAppManager()->hasOnlyProtectedAppTypes($types);
// Load the enabled apps here
$apps = self::getEnabledApps();
$apps = self::getEnabledApps(false, $all);
// Add each apps' folder as allowed class path
foreach ($apps as $app) {