diff options
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/base.php b/lib/base.php index 7153e481eda..d0a2072cc66 100644 --- a/lib/base.php +++ b/lib/base.php @@ -114,8 +114,6 @@ class OC { public static string $configDir; - public static int $VERSION_MTIME = 0; - /** * requested app */ @@ -610,10 +608,9 @@ class OC { self::$CLI = (php_sapi_name() == 'cli'); - // Add default composer PSR-4 autoloader + // Add default composer PSR-4 autoloader, ensure apcu to be disabled self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php'; - OC::$VERSION_MTIME = filemtime(OC::$SERVERROOT . '/version.php'); - self::$composerAutoloader->setApcuPrefix('composer_autoload_' . md5(OC::$SERVERROOT . '_' . OC::$VERSION_MTIME)); + self::$composerAutoloader->setApcuPrefix(null); try { self::initPaths(); @@ -991,16 +988,17 @@ class OC { // Check if Nextcloud is installed or in maintenance (update) mode if (!$systemConfig->getValue('installed', false)) { \OC::$server->getSession()->clear(); + $logger = Server::get(\Psr\Log\LoggerInterface::class); $setupHelper = new OC\Setup( $systemConfig, Server::get(\bantu\IniGetWrapper\IniGetWrapper::class), Server::get(\OCP\L10N\IFactory::class)->get('lib'), Server::get(\OCP\Defaults::class), - Server::get(\Psr\Log\LoggerInterface::class), + $logger, Server::get(\OCP\Security\ISecureRandom::class), Server::get(\OC\Installer::class) ); - $controller = new OC\Core\Controller\SetupController($setupHelper); + $controller = new OC\Core\Controller\SetupController($setupHelper, $logger); $controller->run($_POST); exit(); } @@ -1123,7 +1121,7 @@ class OC { } $l = Server::get(\OCP\L10N\IFactory::class)->get('lib'); OC_Template::printErrorPage( - $l->t('404'), + '404', $l->t('The page could not be found on the server.'), 404 ); @@ -1134,11 +1132,14 @@ class OC { * Check login: apache auth, auth token, basic auth */ public static function handleLogin(OCP\IRequest $request): bool { + if ($request->getHeader('X-Nextcloud-Federation')) { + return false; + } $userSession = Server::get(\OC\User\Session::class); if (OC_User::handleApacheAuth()) { return true; } - if (self::tryAppEcosystemV2Login($request)) { + if (self::tryAppAPILogin($request)) { return true; } if ($userSession->tryTokenLogin($request)) { @@ -1179,17 +1180,17 @@ class OC { } } - protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool { + protected static function tryAppAPILogin(OCP\IRequest $request): bool { $appManager = Server::get(OCP\App\IAppManager::class); - if (!$request->getHeader('AE-SIGNATURE')) { + if (!$request->getHeader('AUTHORIZATION-APP-API')) { return false; } - if (!$appManager->isInstalled('app_ecosystem_v2')) { + if (!$appManager->isInstalled('app_api')) { return false; } try { - $appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class); - return $appEcosystemV2Service->validateExAppRequestToNC($request); + $appAPIService = Server::get(OCA\AppAPI\Service\AppAPIService::class); + return $appAPIService->validateExAppRequestToNC($request); } catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) { return false; } |