Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip session validation during app load (Fixes #20756) #20757

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/private/App/AppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,21 @@ public function hasProtectedAppType($types) {
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
*
Expand Down
6 changes: 5 additions & 1 deletion lib/private/legacy/OC_App.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ public static function loadApps(array $types = []): bool {
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) {
Expand Down