registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); $context->registerEventListener(GroupDeletedEvent::class, GroupDeletedListener::class); $context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalListener::class); } public function boot(IBootContext $context): void { $context->injectFn(function (IMountProviderCollection $mountProviderCollection, ConfigAdapter $configAdapter) { $mountProviderCollection->registerProvider($configAdapter); }); $context->injectFn(function (BackendService $backendService, UserPlaceholderHandler $userConfigHandler) { $backendService->registerBackendProvider($this); $backendService->registerAuthMechanismProvider($this); $backendService->registerConfigHandler('user', function () use ($userConfigHandler) { return $userConfigHandler; }); }); // force-load auth mechanisms since some will register hooks // TODO: obsolete these and use the TokenProvider to get the user's password from the session $this->getAuthMechanisms(); } /** * @{inheritdoc} */ public function getBackends() { $container = $this->getContainer(); $backends = [ $container->get(Local::class), $container->get(FTP::class), $container->get(DAV::class), $container->get(OwnCloud::class), $container->get(SFTP::class), $container->get(AmazonS3::class), $container->get(Swift::class), $container->get(SFTP_Key::class), $container->get(SMB::class), $container->get(SMB_OC::class), ]; return $backends; } /** * @{inheritdoc} */ public function getAuthMechanisms() { $container = $this->getContainer(); return [ // AuthMechanism::SCHEME_NULL mechanism $container->get(NullMechanism::class), // AuthMechanism::SCHEME_BUILTIN mechanism $container->get(Builtin::class), // AuthMechanism::SCHEME_PASSWORD mechanisms $container->get(Password::class), $container->get(SessionCredentials::class), $container->get(LoginCredentials::class), $container->get(UserProvided::class), $container->get(GlobalAuth::class), $container->get(UserGlobalAuth::class), // AuthMechanism::SCHEME_OAUTH1 mechanisms $container->get(OAuth1::class), // AuthMechanism::SCHEME_OAUTH2 mechanisms $container->get(OAuth2::class), // AuthMechanism::SCHEME_PUBLICKEY mechanisms $container->get(RSA::class), $container->get(RSAPrivateKey::class), // AuthMechanism::SCHEME_OPENSTACK mechanisms $container->get(OpenStackV2::class), $container->get(OpenStackV3::class), $container->get(Rackspace::class), // Specialized mechanisms $container->get(AccessKey::class), $container->get(KerberosAuth::class), $container->get(KerberosApacheAuth::class), ]; } }