Skip to content
Open
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
9 changes: 5 additions & 4 deletions apps/files_external/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use OCA\Files_External\Lib\Config\IBackendProvider;
use OCA\Files_External\Listener\GroupDeletedListener;
use OCA\Files_External\Listener\LoadAdditionalListener;
use OCA\Files_External\Listener\StorePasswordListener;
use OCA\Files_External\Listener\UserDeletedListener;
use OCA\Files_External\Service\BackendService;
use OCP\AppFramework\App;
Expand All @@ -51,7 +52,9 @@
use OCP\AppFramework\QueryException;
use OCP\Files\Config\IMountProviderCollection;
use OCP\Group\Events\GroupDeletedEvent;
use OCP\User\Events\PasswordUpdatedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\User\Events\UserLoggedInEvent;

/**
* @package OCA\Files_External\AppInfo
Expand All @@ -72,6 +75,8 @@ public function register(IRegistrationContext $context): void {
$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
$context->registerEventListener(GroupDeletedEvent::class, GroupDeletedListener::class);
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalListener::class);
$context->registerEventListener(UserLoggedInEvent::class, StorePasswordListener::class);
$context->registerEventListener(PasswordUpdatedEvent::class, StorePasswordListener::class);
$context->registerConfigLexicon(ConfigLexicon::class);
}

Expand All @@ -86,10 +91,6 @@ public function boot(IBootContext $context): void {
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();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Listener\StorePasswordListener;
use OCP\Authentication\Exceptions\CredentialsUnavailableException;
use OCP\Authentication\LoginCredentials\IStore as CredentialsStore;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IL10N;
use OCP\ISession;
use OCP\IUser;
use OCP\IUserBackend;
use OCP\LDAP\ILDAPProviderFactory;
use OCP\Security\ICredentialsManager;
use OCP\User\Events\PasswordUpdatedEvent;
use OCP\User\Events\UserLoggedInEvent;

/**
* Username and password from login credentials, saved in DB
Expand All @@ -35,7 +31,6 @@ public function __construct(
protected ISession $session,
protected ICredentialsManager $credentialsManager,
private CredentialsStore $credentialsStore,
IEventDispatcher $eventDispatcher,
private ILDAPProviderFactory $ldapFactory,
) {
$this
Expand All @@ -48,9 +43,6 @@ public function __construct(
->setFlag(DefinitionParameter::FLAG_HIDDEN)
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
]);

$eventDispatcher->addServiceListener(UserLoggedInEvent::class, StorePasswordListener::class);
$eventDispatcher->addServiceListener(PasswordUpdatedEvent::class, StorePasswordListener::class);
}

private function getCredentials(IUser $user): array {
Expand Down
Loading