OwnCloud.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_External\Lib\Backend;
  8. use OCA\Files_External\Lib\Auth\AuthMechanism;
  9. use OCA\Files_External\Lib\Auth\Password\Password;
  10. use OCA\Files_External\Lib\DefinitionParameter;
  11. use OCP\IL10N;
  12. class OwnCloud extends Backend {
  13. public function __construct(IL10N $l, Password $legacyAuth) {
  14. $this
  15. ->setIdentifier('owncloud')
  16. ->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
  17. ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
  18. ->setText($l->t('Nextcloud'))
  19. ->addParameters([
  20. new DefinitionParameter('host', $l->t('URL')),
  21. (new DefinitionParameter('root', $l->t('Remote subfolder')))
  22. ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
  23. (new DefinitionParameter('secure', $l->t('Secure https://')))
  24. ->setType(DefinitionParameter::VALUE_BOOLEAN)
  25. ->setDefaultValue(true),
  26. (new DefinitionParameter('password', $l->t('Password')))
  27. ->setFlag(DefinitionParameter::FLAG_OPTIONAL)
  28. ->setType(DefinitionParameter::VALUE_PASSWORD),
  29. ])
  30. ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
  31. ->setLegacyAuthMechanism($legacyAuth)
  32. ;
  33. }
  34. }