Skip to content

Commit

Permalink
Merge pull request #51102 from nextcloud/backport/51019/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(files_external): Move definition parameter to the correct place
  • Loading branch information
sorbaugh authored Mar 3, 2025
2 parents dadee21 + 7e727b3 commit 0a9dcff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
namespace OCA\Files_External\Lib\Auth\Password;

use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Listener\StorePasswordListener;
Expand Down Expand Up @@ -79,6 +80,8 @@ public function __construct(
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('Log-in credentials, save in database'))
->addParameters([
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);

$eventDispatcher->addServiceListener(UserLoggedInEvent::class, StorePasswordListener::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace OCA\Files_External\Lib\Auth\Password;

use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use OCA\Files_External\Lib\SessionStorageWrapper;
use OCA\Files_External\Lib\StorageConfig;
Expand All @@ -48,7 +49,10 @@ public function __construct(IL10N $l, CredentialsStore $credentialsStore) {
$this->setIdentifier('password::sessioncredentials')
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('Log-in credentials, save in session'))
->addParameters([]);
->addParameters([
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);
}

public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
Expand Down
3 changes: 0 additions & 3 deletions apps/files_external/lib/Lib/Backend/OwnCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public function __construct(IL10N $l, Password $legacyAuth) {
(new DefinitionParameter('secure', $l->t('Secure https://')))
->setType(DefinitionParameter::VALUE_BOOLEAN)
->setDefaultValue(true),
(new DefinitionParameter('password', $l->t('Password')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL)
->setType(DefinitionParameter::VALUE_PASSWORD),
])
->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
->setLegacyAuthMechanism($legacyAuth)
Expand Down

0 comments on commit 0a9dcff

Please sign in to comment.